Compare commits

..

No commits in common. "b734dee575a2b55ab4de838b541dec8bb170ed4b" and "b4ab4809c6c93e77542cab3f8bfe06d1416aeea0" have entirely different histories.

12 changed files with 1530 additions and 1753 deletions

View file

@ -95,8 +95,7 @@ class WebDAV:
cls._webdav_client.upload_to(buffer, path) cls._webdav_client.upload_to(buffer, path)
# invalidate cache entry # invalidate cache entry
# explicit slice as there is no "cls" argument cls._cache.pop(davkey("read_bytes")(path))
del cls._cache[davkey("read_bytes", slice(0, None))(path)]
@classmethod @classmethod
async def write_str(cls, path: str, content: str, encoding="utf-8") -> None: async def write_str(cls, path: str, content: str, encoding="utf-8") -> None:

1071
api/poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -9,24 +9,24 @@ name = "advent22_api"
version = "0.1.0" version = "0.1.0"
[tool.poetry.dependencies] [tool.poetry.dependencies]
Pillow = "^10.1.0" Pillow = "^10.0.1"
asyncify = "^0.9.2" asyncify = "^0.9.2"
cachetools = "^5.3.2" cachetools = "^5.3.2"
cachetoolsutils = "^8.3" cachetoolsutils = "^8.2"
fastapi = "^0.103.1" fastapi = "^0.103.1"
markdown = "^3.5.1" numpy = "^1.26.0"
numpy = "^1.26.2" pydantic-settings = "^2.0.3"
pydantic-settings = "^2.1.0"
python = ">=3.11,<3.13" python = ">=3.11,<3.13"
redis = {extras = ["hiredis"], version = "^5.0.1"} redis = {extras = ["hiredis"], version = "^5.0.1"}
tomli-w = "^1.0.0" tomli-w = "^1.0.0"
uvicorn = {extras = ["standard"], version = "^0.23.2"} uvicorn = {extras = ["standard"], version = "^0.23.2"}
webdavclient3 = "^3.14.6" webdavclient3 = "^3.14.6"
markdown = "^3.5.1"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
black = "^23.11.0" black = "^23.10.1"
flake8 = "^6.1.0" flake8 = "^6.1.0"
pytest = "^7.4.3" pytest = "^7.4.2"
[build-system] [build-system]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"

View file

@ -1,15 +0,0 @@
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Chrome mit Advent22 UI starten",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}

12
ui/.vscode/tasks.json vendored
View file

@ -1,12 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "serve",
"problemMatcher": [],
"label": "UI starten",
"detail": "vue-cli-service serve"
}
]
}

View file

@ -13,35 +13,35 @@
"@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1",
"@fortawesome/vue-fontawesome": "^3.0.5", "@fortawesome/vue-fontawesome": "^3.0.2",
"@types/chai": "^4.3.11", "@types/chai": "^4.3.6",
"@types/luxon": "^3.3.5", "@types/luxon": "^3.3.2",
"@types/mocha": "^10.0.5", "@types/mocha": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^6.12.0", "@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.12.0", "@typescript-eslint/parser": "^6.7.2",
"@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0", "@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-unit-mocha": "~5.0.0", "@vue/cli-plugin-unit-mocha": "~5.0.0",
"@vue/cli-service": "~5.0.0", "@vue/cli-service": "~5.0.0",
"@vue/eslint-config-typescript": "^12.0.0", "@vue/eslint-config-typescript": "^12.0.0",
"@vue/test-utils": "^2.4.2", "@vue/test-utils": "^2.4.1",
"@vueuse/core": "^10.6.1", "@vueuse/core": "^10.5.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^1.6.2", "axios": "^1.5.0",
"bulma": "^0.9.4", "bulma": "^0.9.4",
"bulma-prefers-dark": "^0.1.0-beta.1", "bulma-prefers-dark": "^0.1.0-beta.1",
"bulma-toast": "^2.4.3", "bulma-toast": "^2.4.3",
"chai": "^4.3.10", "chai": "^4.2.0",
"core-js": "^3.33.3", "core-js": "^3.32.2",
"eslint": "^8.54.0", "eslint": "^8.49.0",
"eslint-plugin-vue": "^9.18.1", "eslint-plugin-vue": "^9.17.0",
"luxon": "^3.4.4", "luxon": "^3.4.3",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "^1.69.5", "sass": "^1.67.0",
"sass-loader": "^13.3.2", "sass-loader": "^13.3.2",
"typescript": "~5.3.2", "typescript": "~5.2.2",
"vue": "^3.3.8", "vue": "^3.3.4",
"vue-class-component": "^8.0.0-0" "vue-class-component": "^8.0.0-0"
} }
} }

View file

@ -38,7 +38,6 @@
:visible="store.is_touch_device" :visible="store.is_touch_device"
:title="$advent22.name_door(door.day)" :title="$advent22.name_door(door.day)"
@click="door_click(door.day)" @click="door_click(door.day)"
style="cursor: pointer"
/> />
</ThouCanvas> </ThouCanvas>
</div> </div>

View file

@ -65,6 +65,10 @@ export default class extends Vue {
public username = ""; public username = "";
public password = ""; public password = "";
declare $refs: {
username_input: HTMLInputElement | unknown;
};
private on_keydown(e: KeyboardEvent) { private on_keydown(e: KeyboardEvent) {
if (e.key == "Enter") this.submit(); if (e.key == "Enter") this.submit();
else if (e.key == "Escape") this.cancel(); else if (e.key == "Escape") this.cancel();
@ -74,8 +78,9 @@ export default class extends Vue {
window.addEventListener("keydown", this.on_keydown); window.addEventListener("keydown", this.on_keydown);
this.$nextTick(() => { this.$nextTick(() => {
if (!(this.$refs.username_input instanceof HTMLElement)) return; if (this.$refs.username_input instanceof HTMLInputElement) {
this.$refs.username_input.focus(); this.$refs.username_input.focus();
}
}); });
} }

View file

@ -1,5 +1,6 @@
<template> <template>
<SVGRect <SVGRect
style="cursor: pointer"
variant="primary" variant="primary"
:visible="store.is_touch_device || force_visible" :visible="store.is_touch_device || force_visible"
:rectangle="door.position" :rectangle="door.position"

View file

@ -12,6 +12,7 @@
v-for="(door, index) in doors" v-for="(door, index) in doors"
:key="`door-${index}`" :key="`door-${index}`"
:door="door" :door="door"
style="cursor: inherit"
force_visible force_visible
/> />
<SVGRect <SVGRect

View file

@ -43,6 +43,10 @@ export default class extends Vue {
public day_str = ""; public day_str = "";
public editing = false; public editing = false;
declare $refs: {
day_input: HTMLInputElement | unknown;
};
private toggle_editing() { private toggle_editing() {
this.day_str = String(this.door.day); this.day_str = String(this.door.day);
this.editing = !this.editing; this.editing = !this.editing;

File diff suppressed because it is too large Load diff