diff --git a/cista-front/index.html b/cista-front/index.html index 34a5c8d..7459f57 100644 --- a/cista-front/index.html +++ b/cista-front/index.html @@ -1,9 +1,9 @@ -Cista +Cista Storage - + diff --git a/cista-front/public/favicon.ico b/cista-front/public/favicon.ico deleted file mode 100644 index df36fcf..0000000 Binary files a/cista-front/public/favicon.ico and /dev/null differ diff --git a/cista-front/public/old-index.html b/cista-front/public/old-index.html deleted file mode 100755 index db336cb..0000000 --- a/cista-front/public/old-index.html +++ /dev/null @@ -1,241 +0,0 @@ - -Storage - -
-

Quick file upload

-

Uses parallel WebSocket connections for increased bandwidth /api/upload

- - -
- -
-

Files

- -
- - diff --git a/cista-front/public/robots.txt b/cista-front/public/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/cista-front/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/cista-front/src/App.vue b/cista-front/src/App.vue index dbb7e16..d7a91d5 100644 --- a/cista-front/src/App.vue +++ b/cista-front/src/App.vue @@ -15,7 +15,7 @@ import { RouterView } from 'vue-router' import type { ComputedRef } from 'vue' import type HeaderMain from '@/components/HeaderMain.vue' -import { onMounted, onUnmounted, ref } from 'vue' +import { onMounted, onUnmounted, ref, watchEffect } from 'vue' import { watchConnect, watchDisconnect } from '@/repositories/WS' import { useDocumentStore } from '@/stores/documents' @@ -35,6 +35,9 @@ const path: ComputedRef = computed(() => { pathList } }) +watchEffect(() => { + document.title = path.value.path.replace(/\/$/, '').split('/').pop() || documentStore.server.name || 'Cista Storage' +}) onMounted(watchConnect) onUnmounted(watchDisconnect) // Update human-readable x seconds ago messages from mtimes diff --git a/cista-front/src/assets/logo.svg b/cista-front/src/assets/logo.svg new file mode 100644 index 0000000..cf8f699 --- /dev/null +++ b/cista-front/src/assets/logo.svg @@ -0,0 +1 @@ + diff --git a/cista-front/src/repositories/WS.ts b/cista-front/src/repositories/WS.ts index b760e17..d5ebf8a 100644 --- a/cista-front/src/repositories/WS.ts +++ b/cista-front/src/repositories/WS.ts @@ -42,6 +42,7 @@ export const watchConnect = () => { } if ("server" in msg) { console.log('Connected to backend', msg) + store.server = msg.server store.connected = true reconnectDuration = 500 store.error = '' diff --git a/cista-front/src/stores/documents.ts b/cista-front/src/stores/documents.ts index 59662d0..97c6ca6 100644 --- a/cista-front/src/stores/documents.ts +++ b/cista-front/src/stores/documents.ts @@ -33,6 +33,7 @@ export const useDocumentStore = defineStore({ fileExplorer: null, error: '' as string, connected: false, + server: {} as Record, user: { username: '', privileged: false, diff --git a/cista/api.py b/cista/api.py index 38b16d1..d08705f 100644 --- a/cista/api.py +++ b/cista/api.py @@ -89,7 +89,7 @@ async def watch(req, ws): msgspec.json.encode( { "server": { - "name": "Cista", # Should be configurable + "name": config.config.name or config.config.path.name, "version": __version__, "public": config.config.public, }, diff --git a/cista/config.py b/cista/config.py index 56aa708..de5310c 100644 --- a/cista/config.py +++ b/cista/config.py @@ -14,6 +14,7 @@ class Config(msgspec.Struct): listen: str secret: str = secrets.token_hex(12) public: bool = False + name: str = "" users: dict[str, User] = {} links: dict[str, Link] = {}