Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7900e14
made route for manual schedule
skarumuri11 Feb 6, 2023
d449844
Commented out script to start testing
alannaping Feb 8, 2023
3da5438
worked on the Ui and inputting info
skarumuri11 Feb 8, 2023
7cbbd99
Seperateed entries into seperate forms
alannaping Feb 9, 2023
890fe09
Pivoted to an editable tabler (per maaz's request)
alannaping Feb 9, 2023
feb95e7
Built the base of the table and the number entry
alannaping Feb 10, 2023
50b387c
added scrollbar
skarumuri11 Feb 13, 2023
fab9802
figured out how to get it to interact
skarumuri11 Feb 13, 2023
18899cb
Stored the value from input
alannaping Feb 14, 2023
7b06f0b
Attempted to intergrate our value into the loop
alannaping Feb 14, 2023
9614376
got empty divs to show up on table
skarumuri11 Feb 15, 2023
8b65a48
working on UI stuff for the input
skarumuri11 Feb 15, 2023
3968b0c
Finished cleaning up some ui for the form
alannaping Feb 16, 2023
ea14061
Made table editable
alannaping Feb 16, 2023
524d8d1
tried working with the lock picture
skarumuri11 Feb 17, 2023
2d2bff1
Added the lock to the checkbox
alannaping Feb 23, 2023
33f7baa
LOCKBOX
alannaping Feb 27, 2023
df396b3
working on making the table lock after checkbox is selected
skarumuri11 Feb 27, 2023
0ba1aa8
Figured out next steps for locking
alannaping Feb 28, 2023
0fb7975
figured out how to make the locking work for the editable table
skarumuri11 Mar 1, 2023
a8694ed
Started grabbing data
alannaping Mar 2, 2023
7df9880
fixed the locking bugs
alannaping Mar 6, 2023
e01b48a
slightly broken but better practices
alannaping Mar 6, 2023
308f10d
fixed locking function
skarumuri11 Mar 7, 2023
8c4bfcb
finished getTeams method to scrape html data
skarumuri11 Mar 7, 2023
0171eb6
processedMatches array to store teams in selected match
skarumuri11 Mar 7, 2023
d0708df
Started formatting the data
alannaping Mar 8, 2023
b1beb2c
we have an array of objects for a match split by alliance
skarumuri11 Mar 13, 2023
5edb588
finished formatting and scraping data for admin
skarumuri11 Mar 13, 2023
e8c8116
confused
alannaping Mar 14, 2023
3fb962c
server stuff
alannaping Mar 16, 2023
7b387d4
where did the o come from
skarumuri11 Mar 20, 2023
2cc00a3
got data into admin (destringfy does not work)
skarumuri11 Apr 3, 2023
74033ae
fixed blue and red team array error
skarumuri11 Apr 3, 2023
512ffa3
working on authentication
skarumuri11 Apr 3, 2023
8931a29
finished authentication
alannaping Apr 5, 2023
e48c7f6
started on the match lock function
alannaping Apr 5, 2023
d1e8201
clean up and documentation
skarumuri11 Apr 6, 2023
0e6236f
Merge branch 'main' of https://github.com/HuskieRobotics/SPOT into ma…
skarumuri11 Apr 10, 2023
4350980
pulled main and fixed any errors
skarumuri11 Apr 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 56 additions & 56 deletions config/analysis-pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,34 +144,34 @@
"outputPath":"scores.auto",
"options":{
"weightedPaths":{
"countsAuto.placement31":6+1.666,
"countsAuto.placement32":6+1.666,
"countsAuto.placement33":6+1.666,
"countsAuto.placement34":6+1.666,
"countsAuto.placement35":6+1.666,
"countsAuto.placement36":6+1.666,
"countsAuto.placement37":6+1.666,
"countsAuto.placement38":6+1.666,
"countsAuto.placement39":6+1.666,
"countsAuto.placement21":4+1.666,
"countsAuto.placement22":4+1.666,
"countsAuto.placement23":4+1.666,
"countsAuto.placement24":4+1.666,
"countsAuto.placement25":4+1.666,
"countsAuto.placement26":4+1.666,
"countsAuto.placement27":4+1.666,
"countsAuto.placement28":4+1.666,
"countsAuto.placement29":4+1.666,
"autoCounts.hybrid.conePickupGrid":3+1.666,
"autoCounts.hybrid.conePickupCommunity":3+1.666,
"autoCounts.hybrid.conePickupFloor":3+1.666,
"autoCounts.hybrid.conePickupChute":3+1.666,
"autoCounts.hybrid.conePickupPlatform":3+1.666,
"autoCounts.hybrid.cubePickupGrid":3+1.666,
"autoCounts.hybrid.cubePickupCommunity":3+1.666,
"autoCounts.hybrid.cubePickupFloor":3+1.666,
"autoCounts.hybrid.cubePickupChute":3+1.666,
"autoCounts.hybrid.cubePickupPlatform":3+1.666
"countsAuto.placement31":7.666,
"countsAuto.placement32":7.666,
"countsAuto.placement33":7.666,
"countsAuto.placement34":7.666,
"countsAuto.placement35":7.666,
"countsAuto.placement36":7.666,
"countsAuto.placement37":7.666,
"countsAuto.placement38":7.666,
"countsAuto.placement39":7.666,
"countsAuto.placement21":5.666,
"countsAuto.placement22":5.666,
"countsAuto.placement23":5.666,
"countsAuto.placement24":5.666,
"countsAuto.placement25":5.666,
"countsAuto.placement26":5.666,
"countsAuto.placement27":5.666,
"countsAuto.placement28":5.666,
"countsAuto.placement29":5.666,
"autoCounts.hybrid.conePickupGrid":4.666,
"autoCounts.hybrid.conePickupCommunity":4.666,
"autoCounts.hybrid.conePickupFloor":4.666,
"autoCounts.hybrid.conePickupChute":4.666,
"autoCounts.hybrid.conePickupPlatform":4.666,
"autoCounts.hybrid.cubePickupGrid":4.666,
"autoCounts.hybrid.cubePickupCommunity":4.666,
"autoCounts.hybrid.cubePickupFloor":4.666,
"autoCounts.hybrid.cubePickupChute":4.666,
"autoCounts.hybrid.cubePickupPlatform":4.666
}
}
},
Expand All @@ -181,34 +181,34 @@
"outputPath":"scores.teleop",
"options":{
"weightedPaths":{
"countsTeleop.placement31":5+1.666,
"countsTeleop.placement32":5+1.666,
"countsTeleop.placement33":5+1.666,
"countsTeleop.placement34":5+1.666,
"countsTeleop.placement35":5+1.666,
"countsTeleop.placement36":5+1.666,
"countsTeleop.placement37":5+1.666,
"countsTeleop.placement38":5+1.666,
"countsTeleop.placement39":5+1.666,
"countsTeleop.placement21":3+1.666,
"countsTeleop.placement22":3+1.666,
"countsTeleop.placement23":3+1.666,
"countsTeleop.placement24":3+1.666,
"countsTeleop.placement25":3+1.666,
"countsTeleop.placement26":3+1.666,
"countsTeleop.placement27":3+1.666,
"countsTeleop.placement28":3+1.666,
"countsTeleop.placement29":3+1.666,
"teleopCounts.hybrid.conePickupGrid":2+1.666,
"teleopCounts.hybrid.conePickupCommunity":2+1.666,
"teleopCounts.hybrid.conePickupFloor":2+1.666,
"teleopCounts.hybrid.conePickupChute":2+1.666,
"teleopCounts.hybrid.conePickupPlatform":2+1.666,
"teleopCounts.hybrid.cubePickupGrid":2+1.666,
"teleopCounts.hybrid.cubePickupCommunity":2+1.666,
"teleopCounts.hybrid.cubePickupFloor":2+1.666,
"teleopCounts.hybrid.cubePickupChute":2+1.666,
"teleopCounts.hybrid.cubePickupPlatform":2+1.666
"countsTeleop.placement31":6.666,
"countsTeleop.placement32":6.666,
"countsTeleop.placement33":6.666,
"countsTeleop.placement34":6.666,
"countsTeleop.placement35":6.666,
"countsTeleop.placement36":6.666,
"countsTeleop.placement37":6.666,
"countsTeleop.placement38":6.666,
"countsTeleop.placement39":6.666,
"countsTeleop.placement21":4.666,
"countsTeleop.placement22":4.666,
"countsTeleop.placement23":4.666,
"countsTeleop.placement24":4.666,
"countsTeleop.placement25":4.666,
"countsTeleop.placement26":4.666,
"countsTeleop.placement27":4.666,
"countsTeleop.placement28":4.666,
"countsTeleop.placement29":4.666,
"teleopCounts.hybrid.conePickupGrid":3.666,
"teleopCounts.hybrid.conePickupCommunity":3.666,
"teleopCounts.hybrid.conePickupFloor":3.666,
"teleopCounts.hybrid.conePickupChute":3.666,
"teleopCounts.hybrid.conePickupPlatform":3.666,
"teleopCounts.hybrid.cubePickupGrid":3.666,
"teleopCounts.hybrid.cubePickupCommunity":3.666,
"teleopCounts.hybrid.cubePickupFloor":3.666,
"teleopCounts.hybrid.cubePickupChute":3.666,
"teleopCounts.hybrid.cubePickupPlatform":3.666
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions src/admin/public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ async function updateMatches(accessCode) {
document.querySelector("#match-list").innerHTML = "";

//rebuild matches view
console.log("all matches")
console.log(allMatches)
for (let match of allMatches) {
let matchElement = document.createElement("div");
matchElement.classList.add("match");
Expand Down Expand Up @@ -160,12 +162,14 @@ async function updateMatches(accessCode) {
checkbox.checked = false; //set it to unchecked while processing the request

//send a post request with the new match
console.log(match)
fetch("/admin/api/setMatch", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: accessCode
},

body: JSON.stringify(match),
}).then((res) => res.json()).then((success) => {
if (success === true) { //if the match is successfully updated on the server-side
Expand Down
27 changes: 22 additions & 5 deletions src/admin/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const ScoutingSync = require("../../scouting/scouting-sync")();
let router = Router();
const config = require("../../../config/config.json");
const { TeamMatchPerformance } = require("../../lib/db");
const axios = require("axios")
//const {processedManualMatches} = require("../../schedule/public/js/script")

const DEMO = false;

Expand Down Expand Up @@ -87,9 +89,24 @@ router.post("/setMatch", (req,res) => {
});

router.get("/matches", async (req,res) => {
res.json({
"allMatches": await ScoutingSync.getMatches(),
"currentMatch": ScoutingSync.match
})
//1 check if there is a manual schedu,e
//2 if there is a manual schedule, send it instead of the TBA one
//3 if there isnt send the TBA one
let manualSchedule = await axios.get('http://localhost:8080/schedule/matches').then(res=>res.data) // temp fix
console.log(manualSchedule)
if(Object.keys(manualSchedule).length != 0){ // find a better way to check if its empty
console.log("using manual schedule")
res.json({
"allMatches": manualSchedule,
"currentMatch": ScoutingSync.match
})
} else {
console.log("using tba schedule")
res.json({
"allMatches": await ScoutingSync.getMatches(),
"currentMatch": ScoutingSync.match
})
}

})
module.exports = router;
module.exports = router;
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const chalk = require("chalk");
const fs = require("fs");

app.set("view engine", "ejs");
let bodyParser = require("body-parser");
var bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

Expand All @@ -19,6 +19,7 @@ if (fs.existsSync("config/config.json")) {
app.use("/admin", require("./admin/admin.js"));
app.use("/setup", require("./setup/setup.js"));
app.use("/checklist", require("./checklist/checklist.js"));
app.use("/schedule", require("./schedule/schedule.js"));
} else {
console.log(chalk.cyan.bold.underline("config.json not detected! First time setup flow enabled on server."))
app.use("/",require("./setup/setup.js"));
Expand Down
111 changes: 111 additions & 0 deletions src/schedule/public/css/form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#form {
background-color: var(--bg);
}

#form .input {
background-color: var(--bg-alt);
border: black 2px solid;
color: black;
cursor: pointer;
text-align: left;
border-radius: 8px;
font-size: 1.5em;
padding: 8px 12px;
transition: 0.3s color, 0.3s border;
outline: none;
}


#form .input:focus {
border: var(--accent) 2px solid;
}

#form .label {
position: relative
}

#form .label > span {
position: absolute;
padding: 0 5px;
left: 25px;
/* background-color: var(--bg-alt); */
top: 38px;
border-radius: 5px;
font-size: 1.5em;
transition: 0.2s transform;
pointer-events: none;
color: var(--placeholder);
}

.input:focus + span, .input:valid + span {
transform: scale(0.75) translate(0px, -54px);
color: black !important;
}

.input {
width: 100%;
}


#form {
display: flex;
align-items: center;
justify-content: center;
}



#form .form {
background-color: var(--bg-alt);
border-radius: var(--border-radius);
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: 20% 30% 30% 20%;
width: 750px;
justify-items: center;
align-items: center;
height: 90vh;
gap: 2.5px;
padding: 20px;
}

#form .form .title {
grid-area: 1/1/2/3;
margin: 0px 0;
font-size: 2em;
}

#form .form .save {
grid-area: 4/1/5/3;
font-size: 1.75em;
width: 90%;
background-color: var(--accent);
border-radius: var(--border-radius);
color: var(--bg-alt);
border: none;
margin: 6px 0;
height: 2em;
}

@media screen and (min-height: 600px) {
#form .form {
width: 350px;
height: auto;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
padding: 20px;
}
#form .form .title {
font-size: 2em
}
#form .form .save {
width: calc(100% - 24px);
margin: 12px 0;
}
#form .input {
width: 100%;
margin: 30px 0px;
}
}
28 changes: 28 additions & 0 deletions src/schedule/public/css/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:root {
--bg: #EFEFEF;
--text: #232323;
--bg-alt: #FEFEFE;
--accent: #30a2ff;
--accent-alt: #ff6030;
--error: #ff5166;
--light-gray: #bebebe;
--gray: #757575;
--green: #4caf50;
--placeholder: #a3a3a3;
--border-radius: 16px;
--font: Cairo, sans-serif
}
html {
overflow: hidden;
height: 100%;
position: fixed;
}

body {
height: 100%;
position: relative;
}

* {
font-family: var(--font, sans-serif)
}
Loading