From fafcdb815d85517080d99456fe908ee7597e9a8c Mon Sep 17 00:00:00 2001 From: Mannakitam Date: Wed, 4 Feb 2026 22:25:52 -0500 Subject: [PATCH 1/2] removed acces to data collection page --- client/static/partials/footer.ejs | 4 ++-- server/routers/login.js | 2 +- server/server.js | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/static/partials/footer.ejs b/client/static/partials/footer.ejs index 518b57b3..0612af48 100644 --- a/client/static/partials/footer.ejs +++ b/client/static/partials/footer.ejs @@ -6,12 +6,12 @@ -
+
- +
- -
- - <% if(selectedPage == "scouting-page") {%> -
alliance-position=<%=assignment.gm_alliance_position%>> - <% }else {%> - alliance-position=<%=assignment.gm_alliance_position%> style="display:none"> - <%}%> - - -
- - <%= assignment.match_display%> - -
- - -
- > <%= assignment.team_display %> -
- - -
- -
-
- -
- - -
-
-
- -
- - - - -
- -
- - -
-
-
- -
-
- -
- -
- - - - - - - - - - -
Drag RowAction
-
-
- -
- Auton - Tech Fouls -
- - - -
-
- - -
- - -
-
- -
-
- -
- Algae Dislodged -
- - - -
-
- -
- Algae in Opposite Alliance Processor -
- - - -
-
- -
- Human Player Scored in Net -
- - - -
-
- -
- Human Player Shots Missed -
- - - -
-
- - - -
- - Stage Position - -
- Robot Endgame -
- - -
- - -
- - -
- - -
- - -
-
-
- -
- Climb Position -
- - -
- - -
- - -
- - -
-
-
- - -
- Teleop + Endgame - Fouls -
- - - -
-
- -
-
Teleop + Endgame - Tech Fouls
-
- - - -
-
- -
- Robot entered opponent barge area -
- - - -
-
- -
- Robot plays defense -
- - - -
-
- -
- robot has coral ground pickup -
- - - -
-
- -
- robot has algae ground pickup -
- - - -
-
- -
- Comments -
- -
-
-
- - - - -
- - <% if(selectedPage == "comments-page") {%> -
- <% }else {%> - - <%}%> - - <% } else {%> - -
- - -
- - -

A match isn't running or you aren't assigned to scout

-
- -
- <% } %> + +
diff --git a/client/templates/template.ejs b/client/templates/template.ejs index 8aec3087..2f574031 100644 --- a/client/templates/template.ejs +++ b/client/templates/template.ejs @@ -3,6 +3,7 @@ Team 695: Scoutify + diff --git a/server/routers/data-collection.js b/server/routers/data-collection.js index f1b4efa4..5e557e2c 100644 --- a/server/routers/data-collection.js +++ b/server/routers/data-collection.js @@ -20,12 +20,6 @@ async function getGameNumbers() { return parseData(gameNumbers) } -async function getSeventhScouter(username) { - const [error, dbRes] = await database.query(database.getSeventhScouter(username)) - const seventhScouterRes = parseData(dbRes) - return seventhScouterRes[0].cgua_user_id -} - async function getRunningMatch() { const [error, dbres] = await database.query(SQL`select * from teamsixn_scouting_dev.current_game;`) const runningMatchResults = parseData(dbres) @@ -35,6 +29,13 @@ async function getRunningMatch() { return 1 } +/* +async function getSeventhScouter(username) { + const [error, dbRes] = await database.query(database.getSeventhScouter(username)) + const seventhScouterRes = parseData(dbRes) + return seventhScouterRes[0].cgua_user_id +} + async function getAssignment(username) { const [error, dbres] = await database.query(database.getAssignedTeam(username)) const assignment = parseData(dbres)[0] @@ -116,7 +117,9 @@ async function updateData(info, isSeventh) { } } } +*/ +///* router.get("/", async function (req, res) { //only gets used if the url == data-collection const isAdmin = await checkAdmin(req) const username = req.cookies["username"] @@ -126,31 +129,31 @@ router.get("/", async function (req, res) { //only gets used if the url == data- const runningMatch = await getRunningMatch() let assignment = null - const seventhScouter = await getSeventhScouter(username) + // const seventhScouter = 1 //await getSeventhScouter(username) - if (seventhScouter == username) { //assign user a random team - assignment = await getRandomAssignment(username, runningMatch) - } - else { //not a seventh scouter - assignment = await getAssignment(username) - } + // if (seventhScouter == username) { //assign user a random team + // assignment = await getRandomAssignment(username, runningMatch) + // } + // else { //not a seventh scouter + // assignment = await getAssignment(username) + // } const gameNumbers = await getGameNumbers() const matchup = await getMatchup(match) - consoleLog("\nMATCH DATA: ") - consoleLog(matchup) + //consoleLog("\nMATCH DATA: ") + //consoleLog(matchup) return res.render("data-collection", { matches: gameNumbers, lastMatch: match, runningMatch: runningMatch, - assignment: assignment, + assignment: "false", isAdmin: isAdmin, matchup: matchup, selectedPage: selectedPage }) }) - +//*/ router.post("/", function (req, res) { const body = req.body @@ -159,17 +162,7 @@ router.post("/", function (req, res) { body.username = req.cookies["username"] consoleLog(body, "2025 data") - if (body.type == "scouting") { - const seventhScouter = getSeventhScouter(body.username) - if(seventhScouter != body.username) { - consoleLog("Received:") - consoleLog(body) - updateData(body) - } - else { - consoleLog("Seventh scouter found") - } - } else if (body.type == "comments") { + if (body.type == "comments") { consoleLog("comments:") consoleLog(body.comments) for (const [team, comment] of Object.entries(body.comments)) { diff --git a/server/server.js b/server/server.js index 48b22340..6e579c94 100644 --- a/server/server.js +++ b/server/server.js @@ -23,7 +23,7 @@ const routeDirectory = "routers" const login = (await import(path.resolve(serverDirectory, routeDirectory, "login.js"))).default -//const dataCollection = (await import(path.resolve(serverDirectory, routeDirectory, "data-collection.js"))).default +const dataCollection = (await import(path.resolve(serverDirectory, routeDirectory, "data-collection.js"))).default const teamSummary = (await import(path.resolve(serverDirectory, routeDirectory, "team-summary.js"))).default @@ -174,7 +174,7 @@ app.use("/login", login) //it makes the app use the login router's get and post /******* */ //DATA COLLECTION -//app.use("/data-collection", dataCollection) +app.use("/data-collection", dataCollection) /******* */