This commit is contained in:
orosmatthew 2023-09-10 14:17:54 -04:00
commit 3422727f32
17 changed files with 295 additions and 217 deletions

View File

@ -8,7 +8,7 @@
"name": "bwcontest", "name": "bwcontest",
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"@vscode/vsce": "^2.20.1", "@vscode/vsce": "^2.21.0",
"axios": "^1.5.0", "axios": "^1.5.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"tree-kill": "^1.2.2" "tree-kill": "^1.2.2"
@ -24,20 +24,20 @@
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/node": "20.x", "@types/node": "20.x",
"@types/vscode": "^1.81.0", "@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.4.1", "@typescript-eslint/parser": "^6.6.0",
"@vscode/test-electron": "^2.3.4", "@vscode/test-electron": "^2.3.4",
"concurrently": "^8.2.1", "concurrently": "^8.2.1",
"esbuild": "^0.19.2", "esbuild": "^0.19.2",
"eslint": "^8.48.0", "eslint": "^8.48.0",
"glob": "^10.3.3", "glob": "^10.3.4",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"postcss": "^8.4.28", "postcss": "^8.4.29",
"rollup-plugin-css-only": "^4.3.0", "rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-postcss": "^4.0.2", "rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.1.6", "rollup-plugin-svelte": "^7.1.6",
"svelte": "^4.2.0", "svelte": "^4.2.0",
"svelte-check": "^3.5.0", "svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4", "svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2" "typescript": "^5.2.2"
}, },
@ -990,9 +990,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/semver": { "node_modules/@types/semver": {
"version": "7.5.0", "version": "7.5.1",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz",
"integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==",
"dev": true "dev": true
}, },
"node_modules/@types/vscode": { "node_modules/@types/vscode": {
@ -1002,16 +1002,16 @@
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.6.0.tgz",
"integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", "integrity": "sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.5.1", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "6.4.1", "@typescript-eslint/scope-manager": "6.6.0",
"@typescript-eslint/type-utils": "6.4.1", "@typescript-eslint/type-utils": "6.6.0",
"@typescript-eslint/utils": "6.4.1", "@typescript-eslint/utils": "6.6.0",
"@typescript-eslint/visitor-keys": "6.4.1", "@typescript-eslint/visitor-keys": "6.6.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.4", "ignore": "^5.2.4",
@ -1037,15 +1037,15 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.6.0.tgz",
"integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", "integrity": "sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "6.4.1", "@typescript-eslint/scope-manager": "6.6.0",
"@typescript-eslint/types": "6.4.1", "@typescript-eslint/types": "6.6.0",
"@typescript-eslint/typescript-estree": "6.4.1", "@typescript-eslint/typescript-estree": "6.6.0",
"@typescript-eslint/visitor-keys": "6.4.1", "@typescript-eslint/visitor-keys": "6.6.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@ -1065,13 +1065,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz",
"integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", "integrity": "sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.4.1", "@typescript-eslint/types": "6.6.0",
"@typescript-eslint/visitor-keys": "6.4.1" "@typescript-eslint/visitor-keys": "6.6.0"
}, },
"engines": { "engines": {
"node": "^16.0.0 || >=18.0.0" "node": "^16.0.0 || >=18.0.0"
@ -1082,13 +1082,13 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.6.0.tgz",
"integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", "integrity": "sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "6.4.1", "@typescript-eslint/typescript-estree": "6.6.0",
"@typescript-eslint/utils": "6.4.1", "@typescript-eslint/utils": "6.6.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^1.0.1" "ts-api-utils": "^1.0.1"
}, },
@ -1109,9 +1109,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.6.0.tgz",
"integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", "integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^16.0.0 || >=18.0.0" "node": "^16.0.0 || >=18.0.0"
@ -1122,13 +1122,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz",
"integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", "integrity": "sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.4.1", "@typescript-eslint/types": "6.6.0",
"@typescript-eslint/visitor-keys": "6.4.1", "@typescript-eslint/visitor-keys": "6.6.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -1149,17 +1149,17 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.6.0.tgz",
"integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", "integrity": "sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.4.1", "@typescript-eslint/scope-manager": "6.6.0",
"@typescript-eslint/types": "6.4.1", "@typescript-eslint/types": "6.6.0",
"@typescript-eslint/typescript-estree": "6.4.1", "@typescript-eslint/typescript-estree": "6.6.0",
"semver": "^7.5.4" "semver": "^7.5.4"
}, },
"engines": { "engines": {
@ -1174,12 +1174,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "6.4.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz",
"integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", "integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.4.1", "@typescript-eslint/types": "6.6.0",
"eslint-visitor-keys": "^3.4.1" "eslint-visitor-keys": "^3.4.1"
}, },
"engines": { "engines": {
@ -1206,14 +1206,14 @@
} }
}, },
"node_modules/@vscode/vsce": { "node_modules/@vscode/vsce": {
"version": "2.20.1", "version": "2.21.0",
"resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.20.1.tgz", "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.21.0.tgz",
"integrity": "sha512-ilbvoqvR/1/zseRPBAzYR6aKqSJ+jvda4/BqIwOqTxajpvLtEpK3kMLs77+dJdrlygS+VrP7Yhad8j0ukyD96g==", "integrity": "sha512-KuxYqScqUY/duJbkj9eE2tN2X/WJoGAy54hHtxT3ZBkM6IzrOg7H7CXGUPBxNlmqku2w/cAjOUSrgIHlzz0mbA==",
"dependencies": { "dependencies": {
"azure-devops-node-api": "^11.0.1", "azure-devops-node-api": "^11.0.1",
"chalk": "^2.4.2", "chalk": "^2.4.2",
"cheerio": "^1.0.0-rc.9", "cheerio": "^1.0.0-rc.9",
"commander": "^6.1.0", "commander": "^6.2.1",
"glob": "^7.0.6", "glob": "^7.0.6",
"hosted-git-info": "^4.0.2", "hosted-git-info": "^4.0.2",
"jsonc-parser": "^3.2.0", "jsonc-parser": "^3.2.0",
@ -3027,9 +3027,9 @@
"optional": true "optional": true
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "10.3.3", "version": "10.3.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz",
"integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"foreground-child": "^3.1.0", "foreground-child": "^3.1.0",
@ -4462,9 +4462,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.28", "version": "8.4.29",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz",
"integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -5888,9 +5888,9 @@
} }
}, },
"node_modules/svelte-check": { "node_modules/svelte-check": {
"version": "3.5.0", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.5.0.tgz", "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.5.1.tgz",
"integrity": "sha512-KHujbn4k17xKYLmtCwv0sKKM7uiHTYcQvXnvrCcNU6a7hcszh99zFTIoiu/Sp/ewAw5aJmillJ1Cs8gKLmcX4A==", "integrity": "sha512-+Zb4iHxAhdUtcUg/WJPRjlS1RJalIsWAe9Mz6G1zyznSs7dDkT7VUBdXc3q7Iwg49O/VrZgyJRvOJkjuBfKjFA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@jridgewell/trace-mapping": "^0.3.17", "@jridgewell/trace-mapping": "^0.3.17",

View File

@ -88,25 +88,25 @@
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/node": "20.x", "@types/node": "20.x",
"@types/vscode": "^1.81.0", "@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.4.1", "@typescript-eslint/parser": "^6.6.0",
"@vscode/test-electron": "^2.3.4", "@vscode/test-electron": "^2.3.4",
"concurrently": "^8.2.1", "concurrently": "^8.2.1",
"esbuild": "^0.19.2", "esbuild": "^0.19.2",
"eslint": "^8.48.0", "eslint": "^8.48.0",
"glob": "^10.3.3", "glob": "^10.3.4",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"postcss": "^8.4.28", "postcss": "^8.4.29",
"rollup-plugin-css-only": "^4.3.0", "rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-postcss": "^4.0.2", "rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.1.6", "rollup-plugin-svelte": "^7.1.6",
"svelte": "^4.2.0", "svelte": "^4.2.0",
"svelte-check": "^3.5.0", "svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4", "svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2" "typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"@vscode/vsce": "^2.20.1", "@vscode/vsce": "^2.21.0",
"axios": "^1.5.0", "axios": "^1.5.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"tree-kill": "^1.2.2" "tree-kill": "^1.2.2"

3
sandbox/.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
build
.env

2
sandbox/.env.example Normal file
View File

@ -0,0 +1,2 @@
ADMIN_URL="http://localhost:5173"
REPO_URL="http://localhost:7006"

View File

@ -3,6 +3,6 @@ services:
sandbox: sandbox:
build: . build: .
environment: environment:
- ADMIN_URL=http://localhost:5173 - ADMIN_URL=${ADMIN_URL}
- REPO_URL=http://localhost:7006 - REPO_URL=${REPO_URL}
network_mode: 'host' network_mode: 'host'

View File

@ -6,7 +6,13 @@ RUN apt-get update
RUN apt-get install curl -y RUN apt-get install curl -y
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=20
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get install nodejs -y
RUN apt-get install git -y RUN apt-get install git -y

View File

@ -14,13 +14,36 @@
<a href="/admin/contests/create" class="btn btn-outline-success">Create</a> <a href="/admin/contests/create" class="btn btn-outline-success">Create</a>
</div> </div>
<div class="mt-3 list-group"> <div class="mt-3 table-responsive">
{#each data.contests as contest} <table class="table table-bordered table-hover">
<a <thead>
href={'/admin/contests/' + contest.id.toString()} <tr>
class={`list-group-item list-group-item-action ${ <th>Id</th>
contest.activeTeams === 0 ? '' : ' list-group-item-success' <th>Name</th>
}`}>{contest.name}</a <th>Status</th>
> <th>Actions</th>
{/each} </tr>
</thead>
<tbody>
{#each data.contests as contest}
<tr>
<td>{contest.id}</td>
<td>{contest.name}</td>
<td>
{#if contest.activeTeams === 0}
<span class="badge bg-secondary">Inactive</span>
{:else}
<span class="badge bg-success">Active</span>
{/if}
</td>
<td
><a
href={`/admin/contests/${contest.id.toString()}`}
class="btn btn-sm btn-outline-secondary">Details</a
></td
>
</tr>
{/each}
</tbody>
</table>
</div> </div>

View File

@ -11,12 +11,12 @@
</script> </script>
<svelte:head> <svelte:head>
<title>{data.name}</title> <title>Contest - {data.name}</title>
</svelte:head> </svelte:head>
<ConfirmModal bind:this={confirmModal} /> <ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-4">{data.name}</h1> <h1 style="text-align:center" class="mb-4"><i class="bi bi-flag"></i> Contest - {data.name}</h1>
<FormAlert /> <FormAlert />

View File

@ -4,8 +4,12 @@
export let data: PageData; export let data: PageData;
</script> </script>
<svelte:head>
<title>Printable Logins</title>
</svelte:head>
{#each data.teams as team} {#each data.teams as team}
<table class="table table-bordered table-striped"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>

View File

@ -44,8 +44,6 @@
<FormAlert /> <FormAlert />
<a href="/admin/contests" class="mb-3 btn btn-outline-secondary">Cancel</a>
<form method="POST" action="?/create" use:enhance> <form method="POST" action="?/create" use:enhance>
<h4>Name</h4> <h4>Name</h4>
<input name="name" class="form-control" /> <input name="name" class="form-control" />
@ -106,9 +104,8 @@
{/each} {/each}
</div> </div>
</div> </div>
<div class="row"> <div class="d-flex flex-row justify-content-end gap-2">
<div class="text-end"> <a href="/admin/contests" class="btn btn-outline-secondary">Cancel</a>
<button type="submit" class="btn btn-success">Create</button> <button type="submit" class="btn btn-success">Create</button>
</div>
</div> </div>
</form> </form>

View File

@ -19,11 +19,29 @@
{#if data.problems.length === 0} {#if data.problems.length === 0}
<div class="alert alert-warning">No problems</div> <div class="alert alert-warning">No problems</div>
{/if} {/if}
<div class="list-group">
{#each data.problems as problem} <div class="table-responsive">
<a <table class="table table-bordered table-hover">
href={'/admin/problems/' + problem.id.toString()} <thead>
class="list-group-item list-group-item-action">{problem.friendlyName}</a <tr>
> <th>Id</th>
{/each} <th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each data.problems as problem}
<tr>
<td>{problem.id}</td>
<td>{problem.friendlyName}</td>
<td
><a
href={`/admin/problems/${problem.id.toString()}`}
class="btn btn-sm btn-outline-secondary">Details</a
></td
>
</tr>
{/each}
</tbody>
</table>
</div> </div>

View File

@ -28,6 +28,10 @@
let confirmModal: ConfirmModal; let confirmModal: ConfirmModal;
</script> </script>
<svelte:head>
<title>Problem - {data.problemData.friendlyName}</title>
</svelte:head>
<ConfirmModal bind:this={confirmModal} /> <ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-1"> <h1 style="text-align:center" class="mb-1">

View File

@ -12,7 +12,6 @@ export const load = (async () => {
id: row.id, id: row.id,
createdAt: row.createdAt, createdAt: row.createdAt,
gradedAt: row.gradedAt, gradedAt: row.gradedAt,
message: row.message,
state: row.state, state: row.state,
problemName: problems.find((problem) => { problemName: problems.find((problem) => {
return problem.id == row.problemId; return problem.id == row.problemId;

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import type { PageData } from './$types'; import type { PageData } from './$types';
import { goto, invalidateAll } from '$app/navigation'; import { invalidateAll } from '$app/navigation';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
export let data: PageData; export let data: PageData;
@ -33,72 +33,69 @@
<h1 style="text-align:center" class="mb-4"><i class="bi bi-envelope-paper"></i> Submissions</h1> <h1 style="text-align:center" class="mb-4"><i class="bi bi-envelope-paper"></i> Submissions</h1>
<div class="row"> <div class="d-flex flex-row justify-content-end gap-2 align-items-center">
<div class="col-8"> {#if updating}
<p>Rows are color coded: Red - Incorrect, Green - Correct, Yellow - In Review</p> <div class="spinner-border spinner-border-sm text-secondary" />
</div> {/if}
<div class="col-4 text-end"> <strong>Last Updated: </strong>{data.timestamp.toLocaleTimeString()}
{#if updating}
<div class="spinner-border spinner-border-sm text-secondary" />
{/if}
<strong>Last Updated: </strong>{data.timestamp.toLocaleTimeString()}
</div>
</div> </div>
<table class="table table-bordered table-hover"> <div class="mt-3 table-responsive">
<thead> <table class="table table-bordered table-hover">
<tr> <thead>
<th>Team</th> <tr>
<th>Problem</th> <th>Team</th>
<th>Submit Time</th> <th>Problem</th>
<th>Graded Time</th> <th>State</th>
<th>Message</th> <th>Submit Time</th>
</tr> <th>Graded Time</th>
</thead> <th>Actions</th>
<tbody>
{#each data.submissions as submission}
<tr
on:click={() => {
goto('/admin/submissions/' + submission.id.toString());
}}
class={(submission.state == 'InReview'
? 'table-warning'
: submission.state == 'Correct'
? 'table-success'
: submission.state == 'Incorrect'
? 'table-danger'
: '') + ' submission-row'}
>
<td>
{#if submission.teamName}
{submission.teamName}
{/if}
</td>
<td>
{#if submission.problemName}
{submission.problemName}
{/if}
</td>
<td
>{submission.createdAt.toLocaleDateString() +
' ' +
submission.createdAt.toLocaleTimeString()}</td
>
<td>
{#if submission.gradedAt}
{submission.gradedAt.toLocaleDateString() +
' ' +
submission.gradedAt.toLocaleTimeString()}
{/if}
</td>
<td>{submission.message ? submission.message : ''}</td>
</tr> </tr>
{/each} </thead>
</tbody> <tbody>
</table> {#each data.submissions as submission}
<tr>
<style> <td>
.submission-row:hover { {#if submission.teamName}
cursor: pointer; {submission.teamName}
} {/if}
</style> </td>
<td>
{#if submission.problemName}
{submission.problemName}
{/if}
</td>
<td>
{#if submission.state === 'Queued'}
<span class="badge bg-secondary">Queued</span>
{:else if submission.state === 'InReview'}
<span class="badge bg-warning">In Review</span>
{:else if submission.state === 'Correct'}
<span class="badge bg-success">Correct</span>
{:else if submission.state === 'Incorrect'}
<span class="badge bg-danger">Incorrect</span>
{/if}
</td>
<td
>{submission.createdAt.toLocaleDateString() +
' ' +
submission.createdAt.toLocaleTimeString()}</td
>
<td>
{#if submission.gradedAt}
{submission.gradedAt.toLocaleDateString() +
' ' +
submission.gradedAt.toLocaleTimeString()}
{/if}
</td>
<td>
<a
href={`/admin/submissions/${submission.id.toString()}`}
class="btn btn-sm btn-outline-secondary">Details</a
>
</td>
</tr>
{/each}
</tbody>
</table>
</div>

View File

@ -31,12 +31,14 @@
</script> </script>
<svelte:head> <svelte:head>
<title>Submission</title> <title>Submission - {data.teamName} - {data.problemName}</title>
</svelte:head> </svelte:head>
<ConfirmModal bind:this={confirmModal} /> <ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-4">Submission</h1> <h1 style="text-align:center" class="mb-4">
<i class="bi bi-envelope-paper"></i> Submission - {data.teamName} - {data.problemName}
</h1>
{#if form && !form.success} {#if form && !form.success}
<div class="alert alert-danger">Error</div> <div class="alert alert-danger">Error</div>
@ -64,46 +66,52 @@
</div> </div>
</div> </div>
<table class="table table-bordered"> <div class="table-responsive">
<thead> <table class="table table-bordered">
<tr> <thead>
<th>Team</th> <tr>
<th>Problem</th> <th>Team</th>
<th>Submit Time</th> <th>Problem</th>
<th>Graded Time</th> <th>Status</th>
<th>Message</th> <th>Submit Time</th>
</tr> <th>Graded Time</th>
</thead> <th>Message</th>
<tbody> </tr>
<tr </thead>
class={(data.state == 'InReview' <tbody>
? 'table-warning' <tr>
: data.state == 'Correct' <td>
? 'table-success' {#if data.teamName}
: data.state == 'Incorrect' {data.teamName}
? 'table-danger' {/if}
: '') + ' submission-row'} </td>
> <td>
<td> {#if data.problemName}
{#if data.teamName} {data.problemName}
{data.teamName} {/if}
{/if} </td>
</td> <td>
<td> {#if data.state === 'Queued'}
{#if data.problemName} <span class="badge bg-secondary">Queued</span>
{data.problemName} {:else if data.state === 'InReview'}
{/if} <span class="badge bg-warning">In Review</span>
</td> {:else if data.state === 'Correct'}
<td>{data.submitTime.toLocaleDateString() + ' ' + data.submitTime.toLocaleTimeString()}</td> <span class="badge bg-success">Correct</span>
<td> {:else if data.state === 'Incorrect'}
{#if data.gradedTime} <span class="badge bg-danger">Incorrect</span>
{data.gradedTime.toLocaleDateString() + ' ' + data.gradedTime.toLocaleTimeString()} {/if}
{/if} </td>
</td> <td>{data.submitTime.toLocaleDateString() + ' ' + data.submitTime.toLocaleTimeString()}</td>
<td>{data.message ? data.message : ''}</td> <td>
</tr> {#if data.gradedTime}
</tbody> {data.gradedTime.toLocaleDateString() + ' ' + data.gradedTime.toLocaleTimeString()}
</table> {/if}
</td>
<td>{data.message ? data.message : ''}</td>
</tr>
</tbody>
</table>
</div>
{#if data.state == 'InReview'} {#if data.state == 'InReview'}
<div class="row"> <div class="row">

View File

@ -55,10 +55,27 @@
</form> </form>
{/if} {/if}
<div class="list-group"> <div class="table-responsive">
{#each data.teams as team} <table class="table table-bordered table-hover">
<a href={'/admin/teams/' + team.id.toString()} class="list-group-item list-group-item-action"> <thead>
{team.name} <tr>
</a> <th>Id</th>
{/each} <th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each data.teams as team}
<tr>
<td>{team.id}</td>
<td>{team.name}</td>
<td
><a href={`/admin/teams/${team.id.toString()}`} class="btn btn-sm btn-outline-secondary"
>Details</a
></td
>
</tr>
{/each}
</tbody>
</table>
</div> </div>

View File

@ -22,12 +22,12 @@
</script> </script>
<svelte:head> <svelte:head>
<title>Team</title> <title>Team - {data.team.name}</title>
</svelte:head> </svelte:head>
<ConfirmModal bind:this={confirmModal} /> <ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-4">{data.team.name}</h1> <h1 style="text-align:center" class="mb-4"><i class="bi bi-people"></i> Team - {data.team.name}</h1>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
@ -51,7 +51,7 @@
</div> </div>
</div> </div>
<table class="table table-bordered table-striped"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>