将编译后的前端网页集成

master
cflsxjw 4 months ago
parent 1d1839bcbe
commit c406fe376f

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="PY-242.23339.19">
<data-source name="ROLLER_DB@localhost" uuid="9189e938-8553-4da1-b748-2f45425cc677">
<database-info product="MariaDB" version="11.5.2-MariaDB" jdbc-version="4.2" driver-name="MariaDB Connector/J" driver-version="3.3.3" dbms="MARIADB" exact-version="11.5.2" exact-driver-version="3.3">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="exact" quoted-identifiers="exact" />
<secret-storage>master_key</secret-storage>
<user-name>root</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema" qname="@" />
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
#n:ROLLER_DB
!<md> [0, 0, null, null, -2147483648, -2147483648]

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="7f2c66fe-b984-4e31-ab9d-6a3249f52661" name="Changes" comment="添加事件、分数更新、随机事件获取,学生被选择的概率现在和分数有关">
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="HTML File" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 0
}</component>
<component name="ProjectId" id="2nAHjIIC3toiqnwStIXb2lC17I8" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"DefaultHtmlFileTemplate": "HTML File",
"FastAPI.Fastapi-uvicorn.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"git-widget-placeholder": "master",
"last_opened_file_path": "/home/cflsxjw/Projects/PycharmProjects/roller-backend/main.py",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"DatabaseDriversLRU": [
"mariadb"
]
}
}]]></component>
<component name="RunManager">
<configuration name="Fastapi-uvicorn" type="Python.FastAPI">
<option name="file" value="$PROJECT_DIR$/main.py" />
<module name="roller-backend" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python" />
<option name="SDK_NAME" value="Python 3.12 (roller-backend)" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="launchJavascriptDebuger" value="false" />
<method v="2" />
</configuration>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-js-predefined-d6986cc7102b-5c90d61e3bab-JavaScript-PY-242.23339.19" />
<option value="bundled-python-sdk-0029f7779945-399fe30bd8c1-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-242.23339.19" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7f2c66fe-b984-4e31-ab9d-6a3249f52661" name="Changes" comment="" />
<created>1728409093473</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1728409093473</updated>
<workItem from="1728409094494" duration="363000" />
<workItem from="1728409463088" duration="3000" />
<workItem from="1728409485325" duration="170000" />
<workItem from="1728409667151" duration="44000" />
<workItem from="1728409717764" duration="161000" />
<workItem from="1728451724580" duration="7000" />
<workItem from="1728465410907" duration="2000" />
<workItem from="1728465424216" duration="8338000" />
<workItem from="1728535321018" duration="1000" />
<workItem from="1728536092559" duration="15806000" />
<workItem from="1728555550078" duration="553000" />
<workItem from="1728560872955" duration="1493000" />
<workItem from="1728610896574" duration="25000" />
<workItem from="1728611148994" duration="5473000" />
<workItem from="1728623522990" duration="4149000" />
<workItem from="1728628920067" duration="1447000" />
</task>
<task id="LOCAL-00001" summary="添加事件、分数更新、随机事件获取,学生被选择的概率现在和分数有关">
<option name="closed" value="true" />
<created>1728627992991</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1728627992991</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<ignored-roots>
<path value="$PROJECT_DIR$/.." />
</ignored-roots>
<MESSAGE value="添加事件、分数更新、随机事件获取,学生被选择的概率现在和分数有关" />
<option name="LAST_COMMIT_MESSAGE" value="添加事件、分数更新、随机事件获取,学生被选择的概率现在和分数有关" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/roller_backend$Fastapi_uvicorn.coverage" NAME="Fastapi-uvicorn Coverage Results" MODIFIED="1728629904321" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
</component>
</project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
@import"https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Itim&display=swap";@import"https://fonts.googleapis.com/css2?family=ZCOOL+QingKe+HuangYou&display=swap";@font-face{font-family:Kalam;src:url(/assets/Kalam-Regular-eH010FEw.ttf)}*{margin:0;padding:0}html{background-color:#91a3b4}.container{display:flex;height:100vh;flex-direction:row}.header{width:87vw;height:16.5vh;text-align:center;display:block;background-color:#3e4b5e;font-size:104px;font-family:Kalam,serif;color:#91a3b4}.main-content{width:100vh;flex-direction:column}.main-menu{display:flex;width:13vw;height:100vh;background-color:#616e7f}.main-frame{display:flex;flex-direction:row;width:87vw;height:83.5vh}.container[data-v-47ebfd9d]{height:100%;width:100%;background-color:#2f3b4a;flex-direction:column;align-items:center}.file-selector[data-v-47ebfd9d]{margin-top:3.5vh;width:6.94vw;height:4.3vh;border-radius:20px;font-size:1.25rem;font-family:Itim,serif;background-color:#be8a7d}#file-input[data-v-47ebfd9d]{display:none}.submit-button[data-v-47ebfd9d]{margin-top:3.5vh;width:6.94vw;height:80.3vh;border-radius:30px;background-color:#2c3031;border:3px solid #2C3031;font-size:6rem;text-align:center;font-family:Kalam,serif;line-height:140px}@font-face{font-family:Itim;src:url(/assets/Itim-Regular-C81TTF-z.ttf)}[data-v-0bb96a3f]{padding:0;margin:0}.score[data-v-0bb96a3f]{height:60px;width:60px;border-radius:50px;margin:15px 5px;border:#2A3F45 3px solid;font-size:32px;line-height:56px;color:#c6a8a8;font-weight:700;display:flex;justify-content:center}.score-board-container[data-v-0bb96a3f]{width:161px;height:440px;background-color:#3d3b3580;border-radius:30px;flex-direction:row;border:3px solid #404F52;display:flex;justify-content:space-evenly}.score-text[data-v-0bb96a3f]{width:55px;height:316px;background-color:#beab8f;border-radius:50px;text-align:center;display:flex;flex-direction:column;justify-content:center;color:#251515;font-family:Itim,serif;font-size:64px;line-height:56px;margin:auto 10% auto 11.8%}.buttons-group[data-v-0bb96a3f]{display:flex;flex-direction:column;float:right}.button[data-v-0bb96a3f]{height:44px;width:44px;background-color:#d9d9d9;border:3px solid #000000;border-radius:50%;margin:8px;display:flex}@font-face{font-family:Itim;src:url(/assets/Itim-Regular-C81TTF-z.ttf)}[data-v-b48de046]{padding:0;margin:0}.result-board-container[data-v-b48de046]{width:750px;height:440px;background-color:#b4bec8;border-radius:10px;box-shadow:0 6px 4px #00000040;flex-direction:column;padding-top:1px;position:relative}.special-event[data-v-b48de046]{display:flex;width:331px;height:52px;flex-shrink:0;flex-grow:0;justify-content:center;margin:8.8% auto 0}.special-event-text[data-v-b48de046]{width:331px;height:52px;background-color:#e3f32880;border-radius:30px;color:#000;text-align:center;font-family:Itim,serif;font-size:40px}.sno-number[data-v-b48de046]{display:flex;width:486px;height:144px;flex-direction:column;justify-content:center;text-align:center;font-family:Itim,serif;color:#1d3d5f;font-size:96px;font-style:normal;font-weight:400;margin:0 auto}.s-name[data-v-b48de046]{color:#000;font-size:64px;width:341px;height:51px;margin:0 auto;text-align:center}.container[data-v-05a10a95]{width:20.33%;height:100%;background-color:#718b64;display:flex;flex-direction:column;align-items:center}.title[data-v-05a10a95]{font-size:40px;height:8.3vh;width:13.46vw;background-color:#58767c;margin-top:5.3vh;font-family:Itim,serif;text-align:center;line-height:40px;border-radius:20px}#description[data-v-05a10a95]{font-size:40px;margin-top:5.3vh;text-align:center;font-family:ZCOOL QingKe HuangYou,serif}@font-face{font-family:Itim;src:url(/assets/Itim-Regular-C81TTF-z.ttf)}@font-face{font-family:Inconsolata;src:url(/assets/Inconsolata-C5fWE6Cm.ttf)}[data-v-813c7210]{margin:0;padding:0}.frame-container[data-v-813c7210]{display:grid;grid-template-columns:27.3% 52.37% 20.33%;flex-direction:row;width:100%;background-color:#657a7e}.score-board[data-v-813c7210]{margin:11.39vh 0 0 40.26%}.result-board[data-v-813c7210]{margin:11.39vh 0 0}.start-button[data-v-813c7210]{margin:6.53vh 0 0 10.51vw;width:16.07vw;height:9.5vh;color:#283c50;text-align:center;font-size:64px;background-color:#8ca1b8;filter:drop-shadow(0px 4px 4px rgba(0,0,0,.25));border-radius:20px;font-family:Inconsolata,serif;border:#1D3D5F 3px solid}.event-description[data-v-813c7210]{display:flex;width:100%}

BIN
dist/favicon.ico vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

19
dist/index.html vendored

@ -0,0 +1,19 @@
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Roller-课堂点名</title>
<script type="module" crossorigin src="/assets/index-CCmucb6P.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DXFYL4s5.css">
</head>
<body>
<div class="container">
<div class="main-menu" id="menu-sidebar"></div>
<div class="main-content">
<div class="header">Roller</div>
<div class="main-frame" id="main-frame"></div>
</div>
</div>
</body>
</html>

@ -5,10 +5,11 @@ import sqlalchemy
from sqlalchemy import text from sqlalchemy import text
import pandas as pd import pandas as pd
from pydantic import BaseModel from pydantic import BaseModel
from starlette.staticfiles import StaticFiles
app = FastAPI() app = FastAPI()
origins = ["http://localhost:5173"] origins = ["http://localhost:5173", "http://localhost:8000"]
# noinspection PyTypeChecker # noinspection PyTypeChecker
app.add_middleware( app.add_middleware(
@ -22,9 +23,6 @@ app.add_middleware(
engine = sqlalchemy.create_engine("mariadb+mariadbconnector://root:1212@127.0.0.1:3306/ROLLER_DB") engine = sqlalchemy.create_engine("mariadb+mariadbconnector://root:1212@127.0.0.1:3306/ROLLER_DB")
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.get("/api/get/get_random_stu") @app.get("/api/get/get_random_stu")
@ -78,4 +76,6 @@ class ChangedScore(BaseModel):
async def update_score(changed_score: ChangedScore): async def update_score(changed_score: ChangedScore):
with engine.begin() as c: with engine.begin() as c:
c.execute(text(f"UPDATE stu_info SET score = score + {changed_score.variation} WHERE sno = '{changed_score.sno}'")) c.execute(text(f"UPDATE stu_info SET score = score + {changed_score.variation} WHERE sno = '{changed_score.sno}'"))
return changed_score return changed_score
app.mount("/", StaticFiles(directory="dist", html=True), name="dist")
Loading…
Cancel
Save