From 84ce4b9220d9f4df963447aeff64f9689922c336 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sat, 11 Nov 2023 10:48:33 +0000 Subject: [PATCH 01/19] Fix various typing errors in backend. --- cista/app.py | 84 +++++++++++++++++++++++++++++++-------------------- cista/auth.py | 4 +-- 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/cista/app.py b/cista/app.py index 2b8d80d..5672a17 100644 --- a/cista/app.py +++ b/cista/app.py @@ -4,7 +4,7 @@ import mimetypes from collections import deque from concurrent.futures import ThreadPoolExecutor from importlib.resources import files -from pathlib import Path +from pathlib import Path, PurePath from stat import S_IFDIR, S_IFREG from urllib.parse import unquote from wsgiref.handlers import format_date_time @@ -14,13 +14,13 @@ import sanic.helpers from blake3 import blake3 from natsort import natsorted, ns from sanic import Blueprint, Sanic, empty, raw -from sanic.exceptions import Forbidden, NotFound +from sanic.exceptions import Forbidden, NotFound, ServerError, ServiceUnavailable from sanic.log import logging from stream_zip import ZIP_AUTO, stream_zip from cista import auth, config, session, watching from cista.api import bp -from cista.protocol import DirEntry +from cista.protocol import DirEntry, DirList from cista.util.apphelpers import handle_sanic_exception # Workaround until Sanic PR #2824 is merged @@ -36,7 +36,9 @@ app.exception(Exception)(handle_sanic_exception) async def main_start(app, loop): config.load_config() await watching.start(app, loop) - app.ctx.threadexec = ThreadPoolExecutor(max_workers=8) + app.ctx.threadexec = ThreadPoolExecutor( + max_workers=8, thread_name_prefix="cista-ioworker" + ) @app.after_server_stop @@ -49,8 +51,8 @@ async def main_stop(app, loop): async def use_session(req): req.ctx.session = session.get(req) try: - req.ctx.username = req.ctx.session["username"] - req.ctx.user = config.config.users[req.ctx.session["username"]] # type: ignore + req.ctx.username = req.ctx.session["username"] # type: ignore + req.ctx.user = config.config.users[req.ctx.username] except (AttributeError, KeyError, TypeError): req.ctx.username = None req.ctx.user = None @@ -81,22 +83,16 @@ def http_fileserver(app, _): www = {} -@app.before_server_start -async def load_wwwroot(*_ignored): - global www - www = await asyncio.get_event_loop().run_in_executor(None, _load_wwwroot, www) - - def _load_wwwroot(www): wwwnew = {} - base = files("cista") / "wwwroot" - paths = ["."] + base = Path(__file__).with_name("wwwroot") + paths = [PurePath()] while paths: path = paths.pop(0) current = base / path for p in current.iterdir(): if p.is_dir(): - paths.append(current / p.parts[-1]) + paths.append(p.relative_to(base)) continue name = p.relative_to(base).as_posix() mime = mimetypes.guess_type(name)[0] or "application/octet-stream" @@ -127,15 +123,35 @@ def _load_wwwroot(www): if len(br) >= len(data): br = False wwwnew[name] = data, br, headers + if not wwwnew: + raise ServerError( + "Web frontend missing. Did you forget npm run build?", + extra={"wwwroot": str(base)}, + quiet=True, + ) return wwwnew -@app.add_task +@app.before_server_start +async def start(app): + await load_wwwroot(app) + if app.debug: + app.add_task(refresh_wwwroot()) + + +async def load_wwwroot(app): + global www + www = await asyncio.get_event_loop().run_in_executor( + app.ctx.threadexec, _load_wwwroot, www + ) + + async def refresh_wwwroot(): while True: + await asyncio.sleep(0.5) try: wwwold = www - await load_wwwroot() + await load_wwwroot(app) changes = "" for name in sorted(www): attr = www[name] @@ -151,7 +167,6 @@ async def refresh_wwwroot(): print("Error loading wwwroot", e) if not app.debug: return - await asyncio.sleep(0.5) @app.route("/", methods=["GET", "HEAD"]) @@ -166,21 +181,19 @@ async def wwwroot(req, path=""): return empty(304, headers=headers) # Brotli compressed? if br and "br" in req.headers.accept_encoding.split(", "): - headers = { - **headers, - "content-encoding": "br", - } + headers = {**headers, "content-encoding": "br"} data = br return raw(data, headers=headers) -@app.get("/zip//") -async def zip_download(req, keys, zipfile, ext): - """Download a zip archive of the given keys""" - wanted = set(keys.split("+")) +def get_files(wanted: set) -> list: + if not isinstance(watching.tree[""], DirEntry): + raise ServiceUnavailable(headers={"retry-after": 1}) + root = Path(watching.rootpath) with watching.tree_lock: - q = deque([([], None, watching.tree[""].dir)]) - files = [] + q: deque[tuple[list[str], None | list[str], DirList]] = deque( + [([], None, watching.tree[""].dir)] + ) while q: locpar, relpar, d = q.pop() for name, attr in d.items(): @@ -193,9 +206,16 @@ async def zip_download(req, keys, zipfile, ext): if isdir: q.append((loc, rel, attr.dir)) if rel: - files.append( - ("/".join(rel), Path(watching.rootpath.joinpath(*loc))) - ) + files.append(("/".join(rel), root.joinpath(*loc))) + return natsorted(files, key=lambda f: "/".join(f[0]), alg=ns.IGNORECASE) + + +@app.get("/zip//") +async def zip_download(req, keys, zipfile, ext): + """Download a zip archive of the given keys""" + + wanted = set(keys.split("+")) + files = get_files(wanted) if not files: raise NotFound( @@ -205,8 +225,6 @@ async def zip_download(req, keys, zipfile, ext): if wanted: raise NotFound("Files not found", context={"missing": wanted}) - files = natsorted(files, key=lambda f: f[0], alg=ns.IGNORECASE) - def local_files(files): for rel, p in files: s = p.stat() diff --git a/cista/auth.py b/cista/auth.py index b3d27d4..7efeb8c 100644 --- a/cista/auth.py +++ b/cista/auth.py @@ -68,10 +68,10 @@ def verify(request, *, privileged=False): if request.ctx.user: if request.ctx.user.privileged: return - raise Forbidden("Access Forbidden: Only for privileged users") + raise Forbidden("Access Forbidden: Only for privileged users", quiet=True) elif config.config.public or request.ctx.user: return - raise Unauthorized("Login required", "cookie") + raise Unauthorized("Login required", "cookie", quiet=True) bp = Blueprint("auth") -- 2.45.2 From 5d32396127e506ff2a8e189c4f0ff3dbc601c0b7 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sat, 11 Nov 2023 14:49:46 +0000 Subject: [PATCH 02/19] Modified column needs more space --- cista-front/src/components/FileExplorer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cista-front/src/components/FileExplorer.vue b/cista-front/src/components/FileExplorer.vue index a784ce6..5b7e8f8 100644 --- a/cista-front/src/components/FileExplorer.vue +++ b/cista-front/src/components/FileExplorer.vue @@ -400,7 +400,7 @@ table .selection { text-overflow: clip; } table .modified { - width: 8em; + width: 9em; } table .size { width: 5em; -- 2.45.2 From 82bc449bbc3bae40e78e816cdf7500d2ba5b6d39 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sat, 11 Nov 2023 14:54:30 +0000 Subject: [PATCH 03/19] Rename frontend dir, update README. --- README.md | 6 ++++-- {cista-front => frontend}/.gitignore | 0 {cista-front => frontend}/README.md | 0 {cista-front => frontend}/env.d.ts | 0 {cista-front => frontend}/index.html | 0 {cista-front => frontend}/package.json | 2 +- {cista-front => frontend}/public/robots.txt | 0 {cista-front => frontend}/src/App.vue | 0 {cista-front => frontend}/src/assets/logo.svg | 0 {cista-front => frontend}/src/assets/main.css | 0 {cista-front => frontend}/src/assets/svg/add-file.svg | 0 {cista-front => frontend}/src/assets/svg/add-folder.svg | 0 {cista-front => frontend}/src/assets/svg/arrow.svg | 0 {cista-front => frontend}/src/assets/svg/arrows-h.svg | 0 {cista-front => frontend}/src/assets/svg/arrows-v.svg | 0 {cista-front => frontend}/src/assets/svg/check.svg | 0 {cista-front => frontend}/src/assets/svg/code.svg | 0 {cista-front => frontend}/src/assets/svg/cog.svg | 0 {cista-front => frontend}/src/assets/svg/copy.svg | 0 {cista-front => frontend}/src/assets/svg/create-file.svg | 0 {cista-front => frontend}/src/assets/svg/create-folder.svg | 0 {cista-front => frontend}/src/assets/svg/cross.svg | 0 {cista-front => frontend}/src/assets/svg/disk.svg | 0 {cista-front => frontend}/src/assets/svg/download.svg | 0 {cista-front => frontend}/src/assets/svg/exclamation.svg | 0 {cista-front => frontend}/src/assets/svg/eye.svg | 0 {cista-front => frontend}/src/assets/svg/find.svg | 0 {cista-front => frontend}/src/assets/svg/fullscreen.svg | 0 {cista-front => frontend}/src/assets/svg/github.svg | 0 {cista-front => frontend}/src/assets/svg/home.svg | 0 {cista-front => frontend}/src/assets/svg/info.svg | 0 {cista-front => frontend}/src/assets/svg/link.svg | 0 {cista-front => frontend}/src/assets/svg/logo.svg | 0 {cista-front => frontend}/src/assets/svg/loop.svg | 0 {cista-front => frontend}/src/assets/svg/menu.svg | 0 {cista-front => frontend}/src/assets/svg/next.svg | 0 {cista-front => frontend}/src/assets/svg/open.svg | 0 {cista-front => frontend}/src/assets/svg/paste.svg | 0 {cista-front => frontend}/src/assets/svg/pause.svg | 0 {cista-front => frontend}/src/assets/svg/pencil.svg | 0 {cista-front => frontend}/src/assets/svg/play.svg | 0 {cista-front => frontend}/src/assets/svg/plus.svg | 0 {cista-front => frontend}/src/assets/svg/previous.svg | 0 {cista-front => frontend}/src/assets/svg/reload.svg | 0 {cista-front => frontend}/src/assets/svg/rename.svg | 0 {cista-front => frontend}/src/assets/svg/scissors.svg | 0 {cista-front => frontend}/src/assets/svg/shuffle.svg | 0 {cista-front => frontend}/src/assets/svg/signin.svg | 0 {cista-front => frontend}/src/assets/svg/signout.svg | 0 {cista-front => frontend}/src/assets/svg/skip.svg | 0 {cista-front => frontend}/src/assets/svg/spinner.svg | 0 {cista-front => frontend}/src/assets/svg/stop.svg | 0 {cista-front => frontend}/src/assets/svg/trash.svg | 0 {cista-front => frontend}/src/assets/svg/triangle.svg | 0 {cista-front => frontend}/src/assets/svg/unfullscreen.svg | 0 {cista-front => frontend}/src/assets/svg/up-arrow.svg | 0 {cista-front => frontend}/src/assets/svg/upload-cloud.svg | 0 {cista-front => frontend}/src/assets/svg/user-cog.svg | 0 {cista-front => frontend}/src/assets/svg/user.svg | 0 {cista-front => frontend}/src/assets/svg/volume-high.svg | 0 {cista-front => frontend}/src/assets/svg/volume-low.svg | 0 {cista-front => frontend}/src/assets/svg/volume-medium.svg | 0 {cista-front => frontend}/src/assets/svg/volume-mute.svg | 0 {cista-front => frontend}/src/assets/svg/window-cross.svg | 0 {cista-front => frontend}/src/assets/svg/window.svg | 0 {cista-front => frontend}/src/assets/svg/wordwrap.svg | 0 {cista-front => frontend}/src/assets/svg/zoomin.svg | 0 {cista-front => frontend}/src/assets/svg/zoomout.svg | 0 {cista-front => frontend}/src/components/BreadCrumb.vue | 0 {cista-front => frontend}/src/components/FileExplorer.vue | 0 .../src/components/FileRenameInput.vue | 0 {cista-front => frontend}/src/components/FileViewer.vue | 0 {cista-front => frontend}/src/components/HeaderMain.vue | 0 {cista-front => frontend}/src/components/HeaderSelected.vue | 0 {cista-front => frontend}/src/components/LoginModal.vue | 0 {cista-front => frontend}/src/components/ModalDialog.vue | 0 .../src/components/NotificationLoading.vue | 0 {cista-front => frontend}/src/components/SvgButton.vue | 0 {cista-front => frontend}/src/components/UploadButton.vue | 0 {cista-front => frontend}/src/main.ts | 0 {cista-front => frontend}/src/repositories/Client.ts | 0 {cista-front => frontend}/src/repositories/Document.ts | 0 {cista-front => frontend}/src/repositories/User.ts | 0 {cista-front => frontend}/src/repositories/WS.ts | 0 {cista-front => frontend}/src/router/index.ts | 0 {cista-front => frontend}/src/stores/documents.ts | 0 {cista-front => frontend}/src/utils/index.ts | 0 {cista-front => frontend}/src/views/ExplorerView.vue | 0 {cista-front => frontend}/tsconfig.app.json | 0 {cista-front => frontend}/tsconfig.json | 0 {cista-front => frontend}/tsconfig.node.json | 0 {cista-front => frontend}/tsconfig.vitest.json | 0 {cista-front => frontend}/vite.config.ts | 0 93 files changed, 5 insertions(+), 3 deletions(-) rename {cista-front => frontend}/.gitignore (100%) rename {cista-front => frontend}/README.md (100%) rename {cista-front => frontend}/env.d.ts (100%) rename {cista-front => frontend}/index.html (100%) rename {cista-front => frontend}/package.json (98%) rename {cista-front => frontend}/public/robots.txt (100%) rename {cista-front => frontend}/src/App.vue (100%) rename {cista-front => frontend}/src/assets/logo.svg (100%) rename {cista-front => frontend}/src/assets/main.css (100%) rename {cista-front => frontend}/src/assets/svg/add-file.svg (100%) rename {cista-front => frontend}/src/assets/svg/add-folder.svg (100%) rename {cista-front => frontend}/src/assets/svg/arrow.svg (100%) rename {cista-front => frontend}/src/assets/svg/arrows-h.svg (100%) rename {cista-front => frontend}/src/assets/svg/arrows-v.svg (100%) rename {cista-front => frontend}/src/assets/svg/check.svg (100%) rename {cista-front => frontend}/src/assets/svg/code.svg (100%) rename {cista-front => frontend}/src/assets/svg/cog.svg (100%) rename {cista-front => frontend}/src/assets/svg/copy.svg (100%) rename {cista-front => frontend}/src/assets/svg/create-file.svg (100%) rename {cista-front => frontend}/src/assets/svg/create-folder.svg (100%) rename {cista-front => frontend}/src/assets/svg/cross.svg (100%) rename {cista-front => frontend}/src/assets/svg/disk.svg (100%) rename {cista-front => frontend}/src/assets/svg/download.svg (100%) rename {cista-front => frontend}/src/assets/svg/exclamation.svg (100%) rename {cista-front => frontend}/src/assets/svg/eye.svg (100%) rename {cista-front => frontend}/src/assets/svg/find.svg (100%) rename {cista-front => frontend}/src/assets/svg/fullscreen.svg (100%) rename {cista-front => frontend}/src/assets/svg/github.svg (100%) rename {cista-front => frontend}/src/assets/svg/home.svg (100%) rename {cista-front => frontend}/src/assets/svg/info.svg (100%) rename {cista-front => frontend}/src/assets/svg/link.svg (100%) rename {cista-front => frontend}/src/assets/svg/logo.svg (100%) rename {cista-front => frontend}/src/assets/svg/loop.svg (100%) rename {cista-front => frontend}/src/assets/svg/menu.svg (100%) rename {cista-front => frontend}/src/assets/svg/next.svg (100%) rename {cista-front => frontend}/src/assets/svg/open.svg (100%) rename {cista-front => frontend}/src/assets/svg/paste.svg (100%) rename {cista-front => frontend}/src/assets/svg/pause.svg (100%) rename {cista-front => frontend}/src/assets/svg/pencil.svg (100%) rename {cista-front => frontend}/src/assets/svg/play.svg (100%) rename {cista-front => frontend}/src/assets/svg/plus.svg (100%) rename {cista-front => frontend}/src/assets/svg/previous.svg (100%) rename {cista-front => frontend}/src/assets/svg/reload.svg (100%) rename {cista-front => frontend}/src/assets/svg/rename.svg (100%) rename {cista-front => frontend}/src/assets/svg/scissors.svg (100%) rename {cista-front => frontend}/src/assets/svg/shuffle.svg (100%) rename {cista-front => frontend}/src/assets/svg/signin.svg (100%) rename {cista-front => frontend}/src/assets/svg/signout.svg (100%) rename {cista-front => frontend}/src/assets/svg/skip.svg (100%) rename {cista-front => frontend}/src/assets/svg/spinner.svg (100%) rename {cista-front => frontend}/src/assets/svg/stop.svg (100%) rename {cista-front => frontend}/src/assets/svg/trash.svg (100%) rename {cista-front => frontend}/src/assets/svg/triangle.svg (100%) rename {cista-front => frontend}/src/assets/svg/unfullscreen.svg (100%) rename {cista-front => frontend}/src/assets/svg/up-arrow.svg (100%) rename {cista-front => frontend}/src/assets/svg/upload-cloud.svg (100%) rename {cista-front => frontend}/src/assets/svg/user-cog.svg (100%) rename {cista-front => frontend}/src/assets/svg/user.svg (100%) rename {cista-front => frontend}/src/assets/svg/volume-high.svg (100%) rename {cista-front => frontend}/src/assets/svg/volume-low.svg (100%) rename {cista-front => frontend}/src/assets/svg/volume-medium.svg (100%) rename {cista-front => frontend}/src/assets/svg/volume-mute.svg (100%) rename {cista-front => frontend}/src/assets/svg/window-cross.svg (100%) rename {cista-front => frontend}/src/assets/svg/window.svg (100%) rename {cista-front => frontend}/src/assets/svg/wordwrap.svg (100%) rename {cista-front => frontend}/src/assets/svg/zoomin.svg (100%) rename {cista-front => frontend}/src/assets/svg/zoomout.svg (100%) rename {cista-front => frontend}/src/components/BreadCrumb.vue (100%) rename {cista-front => frontend}/src/components/FileExplorer.vue (100%) rename {cista-front => frontend}/src/components/FileRenameInput.vue (100%) rename {cista-front => frontend}/src/components/FileViewer.vue (100%) rename {cista-front => frontend}/src/components/HeaderMain.vue (100%) rename {cista-front => frontend}/src/components/HeaderSelected.vue (100%) rename {cista-front => frontend}/src/components/LoginModal.vue (100%) rename {cista-front => frontend}/src/components/ModalDialog.vue (100%) rename {cista-front => frontend}/src/components/NotificationLoading.vue (100%) rename {cista-front => frontend}/src/components/SvgButton.vue (100%) rename {cista-front => frontend}/src/components/UploadButton.vue (100%) rename {cista-front => frontend}/src/main.ts (100%) rename {cista-front => frontend}/src/repositories/Client.ts (100%) rename {cista-front => frontend}/src/repositories/Document.ts (100%) rename {cista-front => frontend}/src/repositories/User.ts (100%) rename {cista-front => frontend}/src/repositories/WS.ts (100%) rename {cista-front => frontend}/src/router/index.ts (100%) rename {cista-front => frontend}/src/stores/documents.ts (100%) rename {cista-front => frontend}/src/utils/index.ts (100%) rename {cista-front => frontend}/src/views/ExplorerView.vue (100%) rename {cista-front => frontend}/tsconfig.app.json (100%) rename {cista-front => frontend}/tsconfig.json (100%) rename {cista-front => frontend}/tsconfig.node.json (100%) rename {cista-front => frontend}/tsconfig.vitest.json (100%) rename {cista-front => frontend}/vite.config.ts (100%) diff --git a/README.md b/README.md index b2d5852..09f9e01 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Web File Storage Run directly from repository with Hatch (or use pip install as usual): + ```sh hatch run cista -l :3000 /path/to/files ``` @@ -8,16 +9,17 @@ hatch run cista -l :3000 /path/to/files Settings incl. these arguments are stored to config file on the first startup and later `hatch run cista` is sufficient. If the `cista` script is missing, consider `pip install -e .` (within `hatch shell`) or some other trickery (known issue with installs made prior to adding the startup script). Create your user account: + ```sh hatch run cista --user admin --privileged ``` ## Build frontend -Prebuilt frontend is provided in repository but for any changes it will need to be manually rebuilt: +Frontend needs to be built before using and after any frontend changes: ```sh -cd cista-front +cd frontend npm install npm run build ``` diff --git a/cista-front/.gitignore b/frontend/.gitignore similarity index 100% rename from cista-front/.gitignore rename to frontend/.gitignore diff --git a/cista-front/README.md b/frontend/README.md similarity index 100% rename from cista-front/README.md rename to frontend/README.md diff --git a/cista-front/env.d.ts b/frontend/env.d.ts similarity index 100% rename from cista-front/env.d.ts rename to frontend/env.d.ts diff --git a/cista-front/index.html b/frontend/index.html similarity index 100% rename from cista-front/index.html rename to frontend/index.html diff --git a/cista-front/package.json b/frontend/package.json similarity index 98% rename from cista-front/package.json rename to frontend/package.json index 7d7c3fa..4686e02 100644 --- a/cista-front/package.json +++ b/frontend/package.json @@ -1,5 +1,5 @@ { - "name": "front", + "name": "cista-frontend", "version": "0.0.0", "private": true, "scripts": { diff --git a/cista-front/public/robots.txt b/frontend/public/robots.txt similarity index 100% rename from cista-front/public/robots.txt rename to frontend/public/robots.txt diff --git a/cista-front/src/App.vue b/frontend/src/App.vue similarity index 100% rename from cista-front/src/App.vue rename to frontend/src/App.vue diff --git a/cista-front/src/assets/logo.svg b/frontend/src/assets/logo.svg similarity index 100% rename from cista-front/src/assets/logo.svg rename to frontend/src/assets/logo.svg diff --git a/cista-front/src/assets/main.css b/frontend/src/assets/main.css similarity index 100% rename from cista-front/src/assets/main.css rename to frontend/src/assets/main.css diff --git a/cista-front/src/assets/svg/add-file.svg b/frontend/src/assets/svg/add-file.svg similarity index 100% rename from cista-front/src/assets/svg/add-file.svg rename to frontend/src/assets/svg/add-file.svg diff --git a/cista-front/src/assets/svg/add-folder.svg b/frontend/src/assets/svg/add-folder.svg similarity index 100% rename from cista-front/src/assets/svg/add-folder.svg rename to frontend/src/assets/svg/add-folder.svg diff --git a/cista-front/src/assets/svg/arrow.svg b/frontend/src/assets/svg/arrow.svg similarity index 100% rename from cista-front/src/assets/svg/arrow.svg rename to frontend/src/assets/svg/arrow.svg diff --git a/cista-front/src/assets/svg/arrows-h.svg b/frontend/src/assets/svg/arrows-h.svg similarity index 100% rename from cista-front/src/assets/svg/arrows-h.svg rename to frontend/src/assets/svg/arrows-h.svg diff --git a/cista-front/src/assets/svg/arrows-v.svg b/frontend/src/assets/svg/arrows-v.svg similarity index 100% rename from cista-front/src/assets/svg/arrows-v.svg rename to frontend/src/assets/svg/arrows-v.svg diff --git a/cista-front/src/assets/svg/check.svg b/frontend/src/assets/svg/check.svg similarity index 100% rename from cista-front/src/assets/svg/check.svg rename to frontend/src/assets/svg/check.svg diff --git a/cista-front/src/assets/svg/code.svg b/frontend/src/assets/svg/code.svg similarity index 100% rename from cista-front/src/assets/svg/code.svg rename to frontend/src/assets/svg/code.svg diff --git a/cista-front/src/assets/svg/cog.svg b/frontend/src/assets/svg/cog.svg similarity index 100% rename from cista-front/src/assets/svg/cog.svg rename to frontend/src/assets/svg/cog.svg diff --git a/cista-front/src/assets/svg/copy.svg b/frontend/src/assets/svg/copy.svg similarity index 100% rename from cista-front/src/assets/svg/copy.svg rename to frontend/src/assets/svg/copy.svg diff --git a/cista-front/src/assets/svg/create-file.svg b/frontend/src/assets/svg/create-file.svg similarity index 100% rename from cista-front/src/assets/svg/create-file.svg rename to frontend/src/assets/svg/create-file.svg diff --git a/cista-front/src/assets/svg/create-folder.svg b/frontend/src/assets/svg/create-folder.svg similarity index 100% rename from cista-front/src/assets/svg/create-folder.svg rename to frontend/src/assets/svg/create-folder.svg diff --git a/cista-front/src/assets/svg/cross.svg b/frontend/src/assets/svg/cross.svg similarity index 100% rename from cista-front/src/assets/svg/cross.svg rename to frontend/src/assets/svg/cross.svg diff --git a/cista-front/src/assets/svg/disk.svg b/frontend/src/assets/svg/disk.svg similarity index 100% rename from cista-front/src/assets/svg/disk.svg rename to frontend/src/assets/svg/disk.svg diff --git a/cista-front/src/assets/svg/download.svg b/frontend/src/assets/svg/download.svg similarity index 100% rename from cista-front/src/assets/svg/download.svg rename to frontend/src/assets/svg/download.svg diff --git a/cista-front/src/assets/svg/exclamation.svg b/frontend/src/assets/svg/exclamation.svg similarity index 100% rename from cista-front/src/assets/svg/exclamation.svg rename to frontend/src/assets/svg/exclamation.svg diff --git a/cista-front/src/assets/svg/eye.svg b/frontend/src/assets/svg/eye.svg similarity index 100% rename from cista-front/src/assets/svg/eye.svg rename to frontend/src/assets/svg/eye.svg diff --git a/cista-front/src/assets/svg/find.svg b/frontend/src/assets/svg/find.svg similarity index 100% rename from cista-front/src/assets/svg/find.svg rename to frontend/src/assets/svg/find.svg diff --git a/cista-front/src/assets/svg/fullscreen.svg b/frontend/src/assets/svg/fullscreen.svg similarity index 100% rename from cista-front/src/assets/svg/fullscreen.svg rename to frontend/src/assets/svg/fullscreen.svg diff --git a/cista-front/src/assets/svg/github.svg b/frontend/src/assets/svg/github.svg similarity index 100% rename from cista-front/src/assets/svg/github.svg rename to frontend/src/assets/svg/github.svg diff --git a/cista-front/src/assets/svg/home.svg b/frontend/src/assets/svg/home.svg similarity index 100% rename from cista-front/src/assets/svg/home.svg rename to frontend/src/assets/svg/home.svg diff --git a/cista-front/src/assets/svg/info.svg b/frontend/src/assets/svg/info.svg similarity index 100% rename from cista-front/src/assets/svg/info.svg rename to frontend/src/assets/svg/info.svg diff --git a/cista-front/src/assets/svg/link.svg b/frontend/src/assets/svg/link.svg similarity index 100% rename from cista-front/src/assets/svg/link.svg rename to frontend/src/assets/svg/link.svg diff --git a/cista-front/src/assets/svg/logo.svg b/frontend/src/assets/svg/logo.svg similarity index 100% rename from cista-front/src/assets/svg/logo.svg rename to frontend/src/assets/svg/logo.svg diff --git a/cista-front/src/assets/svg/loop.svg b/frontend/src/assets/svg/loop.svg similarity index 100% rename from cista-front/src/assets/svg/loop.svg rename to frontend/src/assets/svg/loop.svg diff --git a/cista-front/src/assets/svg/menu.svg b/frontend/src/assets/svg/menu.svg similarity index 100% rename from cista-front/src/assets/svg/menu.svg rename to frontend/src/assets/svg/menu.svg diff --git a/cista-front/src/assets/svg/next.svg b/frontend/src/assets/svg/next.svg similarity index 100% rename from cista-front/src/assets/svg/next.svg rename to frontend/src/assets/svg/next.svg diff --git a/cista-front/src/assets/svg/open.svg b/frontend/src/assets/svg/open.svg similarity index 100% rename from cista-front/src/assets/svg/open.svg rename to frontend/src/assets/svg/open.svg diff --git a/cista-front/src/assets/svg/paste.svg b/frontend/src/assets/svg/paste.svg similarity index 100% rename from cista-front/src/assets/svg/paste.svg rename to frontend/src/assets/svg/paste.svg diff --git a/cista-front/src/assets/svg/pause.svg b/frontend/src/assets/svg/pause.svg similarity index 100% rename from cista-front/src/assets/svg/pause.svg rename to frontend/src/assets/svg/pause.svg diff --git a/cista-front/src/assets/svg/pencil.svg b/frontend/src/assets/svg/pencil.svg similarity index 100% rename from cista-front/src/assets/svg/pencil.svg rename to frontend/src/assets/svg/pencil.svg diff --git a/cista-front/src/assets/svg/play.svg b/frontend/src/assets/svg/play.svg similarity index 100% rename from cista-front/src/assets/svg/play.svg rename to frontend/src/assets/svg/play.svg diff --git a/cista-front/src/assets/svg/plus.svg b/frontend/src/assets/svg/plus.svg similarity index 100% rename from cista-front/src/assets/svg/plus.svg rename to frontend/src/assets/svg/plus.svg diff --git a/cista-front/src/assets/svg/previous.svg b/frontend/src/assets/svg/previous.svg similarity index 100% rename from cista-front/src/assets/svg/previous.svg rename to frontend/src/assets/svg/previous.svg diff --git a/cista-front/src/assets/svg/reload.svg b/frontend/src/assets/svg/reload.svg similarity index 100% rename from cista-front/src/assets/svg/reload.svg rename to frontend/src/assets/svg/reload.svg diff --git a/cista-front/src/assets/svg/rename.svg b/frontend/src/assets/svg/rename.svg similarity index 100% rename from cista-front/src/assets/svg/rename.svg rename to frontend/src/assets/svg/rename.svg diff --git a/cista-front/src/assets/svg/scissors.svg b/frontend/src/assets/svg/scissors.svg similarity index 100% rename from cista-front/src/assets/svg/scissors.svg rename to frontend/src/assets/svg/scissors.svg diff --git a/cista-front/src/assets/svg/shuffle.svg b/frontend/src/assets/svg/shuffle.svg similarity index 100% rename from cista-front/src/assets/svg/shuffle.svg rename to frontend/src/assets/svg/shuffle.svg diff --git a/cista-front/src/assets/svg/signin.svg b/frontend/src/assets/svg/signin.svg similarity index 100% rename from cista-front/src/assets/svg/signin.svg rename to frontend/src/assets/svg/signin.svg diff --git a/cista-front/src/assets/svg/signout.svg b/frontend/src/assets/svg/signout.svg similarity index 100% rename from cista-front/src/assets/svg/signout.svg rename to frontend/src/assets/svg/signout.svg diff --git a/cista-front/src/assets/svg/skip.svg b/frontend/src/assets/svg/skip.svg similarity index 100% rename from cista-front/src/assets/svg/skip.svg rename to frontend/src/assets/svg/skip.svg diff --git a/cista-front/src/assets/svg/spinner.svg b/frontend/src/assets/svg/spinner.svg similarity index 100% rename from cista-front/src/assets/svg/spinner.svg rename to frontend/src/assets/svg/spinner.svg diff --git a/cista-front/src/assets/svg/stop.svg b/frontend/src/assets/svg/stop.svg similarity index 100% rename from cista-front/src/assets/svg/stop.svg rename to frontend/src/assets/svg/stop.svg diff --git a/cista-front/src/assets/svg/trash.svg b/frontend/src/assets/svg/trash.svg similarity index 100% rename from cista-front/src/assets/svg/trash.svg rename to frontend/src/assets/svg/trash.svg diff --git a/cista-front/src/assets/svg/triangle.svg b/frontend/src/assets/svg/triangle.svg similarity index 100% rename from cista-front/src/assets/svg/triangle.svg rename to frontend/src/assets/svg/triangle.svg diff --git a/cista-front/src/assets/svg/unfullscreen.svg b/frontend/src/assets/svg/unfullscreen.svg similarity index 100% rename from cista-front/src/assets/svg/unfullscreen.svg rename to frontend/src/assets/svg/unfullscreen.svg diff --git a/cista-front/src/assets/svg/up-arrow.svg b/frontend/src/assets/svg/up-arrow.svg similarity index 100% rename from cista-front/src/assets/svg/up-arrow.svg rename to frontend/src/assets/svg/up-arrow.svg diff --git a/cista-front/src/assets/svg/upload-cloud.svg b/frontend/src/assets/svg/upload-cloud.svg similarity index 100% rename from cista-front/src/assets/svg/upload-cloud.svg rename to frontend/src/assets/svg/upload-cloud.svg diff --git a/cista-front/src/assets/svg/user-cog.svg b/frontend/src/assets/svg/user-cog.svg similarity index 100% rename from cista-front/src/assets/svg/user-cog.svg rename to frontend/src/assets/svg/user-cog.svg diff --git a/cista-front/src/assets/svg/user.svg b/frontend/src/assets/svg/user.svg similarity index 100% rename from cista-front/src/assets/svg/user.svg rename to frontend/src/assets/svg/user.svg diff --git a/cista-front/src/assets/svg/volume-high.svg b/frontend/src/assets/svg/volume-high.svg similarity index 100% rename from cista-front/src/assets/svg/volume-high.svg rename to frontend/src/assets/svg/volume-high.svg diff --git a/cista-front/src/assets/svg/volume-low.svg b/frontend/src/assets/svg/volume-low.svg similarity index 100% rename from cista-front/src/assets/svg/volume-low.svg rename to frontend/src/assets/svg/volume-low.svg diff --git a/cista-front/src/assets/svg/volume-medium.svg b/frontend/src/assets/svg/volume-medium.svg similarity index 100% rename from cista-front/src/assets/svg/volume-medium.svg rename to frontend/src/assets/svg/volume-medium.svg diff --git a/cista-front/src/assets/svg/volume-mute.svg b/frontend/src/assets/svg/volume-mute.svg similarity index 100% rename from cista-front/src/assets/svg/volume-mute.svg rename to frontend/src/assets/svg/volume-mute.svg diff --git a/cista-front/src/assets/svg/window-cross.svg b/frontend/src/assets/svg/window-cross.svg similarity index 100% rename from cista-front/src/assets/svg/window-cross.svg rename to frontend/src/assets/svg/window-cross.svg diff --git a/cista-front/src/assets/svg/window.svg b/frontend/src/assets/svg/window.svg similarity index 100% rename from cista-front/src/assets/svg/window.svg rename to frontend/src/assets/svg/window.svg diff --git a/cista-front/src/assets/svg/wordwrap.svg b/frontend/src/assets/svg/wordwrap.svg similarity index 100% rename from cista-front/src/assets/svg/wordwrap.svg rename to frontend/src/assets/svg/wordwrap.svg diff --git a/cista-front/src/assets/svg/zoomin.svg b/frontend/src/assets/svg/zoomin.svg similarity index 100% rename from cista-front/src/assets/svg/zoomin.svg rename to frontend/src/assets/svg/zoomin.svg diff --git a/cista-front/src/assets/svg/zoomout.svg b/frontend/src/assets/svg/zoomout.svg similarity index 100% rename from cista-front/src/assets/svg/zoomout.svg rename to frontend/src/assets/svg/zoomout.svg diff --git a/cista-front/src/components/BreadCrumb.vue b/frontend/src/components/BreadCrumb.vue similarity index 100% rename from cista-front/src/components/BreadCrumb.vue rename to frontend/src/components/BreadCrumb.vue diff --git a/cista-front/src/components/FileExplorer.vue b/frontend/src/components/FileExplorer.vue similarity index 100% rename from cista-front/src/components/FileExplorer.vue rename to frontend/src/components/FileExplorer.vue diff --git a/cista-front/src/components/FileRenameInput.vue b/frontend/src/components/FileRenameInput.vue similarity index 100% rename from cista-front/src/components/FileRenameInput.vue rename to frontend/src/components/FileRenameInput.vue diff --git a/cista-front/src/components/FileViewer.vue b/frontend/src/components/FileViewer.vue similarity index 100% rename from cista-front/src/components/FileViewer.vue rename to frontend/src/components/FileViewer.vue diff --git a/cista-front/src/components/HeaderMain.vue b/frontend/src/components/HeaderMain.vue similarity index 100% rename from cista-front/src/components/HeaderMain.vue rename to frontend/src/components/HeaderMain.vue diff --git a/cista-front/src/components/HeaderSelected.vue b/frontend/src/components/HeaderSelected.vue similarity index 100% rename from cista-front/src/components/HeaderSelected.vue rename to frontend/src/components/HeaderSelected.vue diff --git a/cista-front/src/components/LoginModal.vue b/frontend/src/components/LoginModal.vue similarity index 100% rename from cista-front/src/components/LoginModal.vue rename to frontend/src/components/LoginModal.vue diff --git a/cista-front/src/components/ModalDialog.vue b/frontend/src/components/ModalDialog.vue similarity index 100% rename from cista-front/src/components/ModalDialog.vue rename to frontend/src/components/ModalDialog.vue diff --git a/cista-front/src/components/NotificationLoading.vue b/frontend/src/components/NotificationLoading.vue similarity index 100% rename from cista-front/src/components/NotificationLoading.vue rename to frontend/src/components/NotificationLoading.vue diff --git a/cista-front/src/components/SvgButton.vue b/frontend/src/components/SvgButton.vue similarity index 100% rename from cista-front/src/components/SvgButton.vue rename to frontend/src/components/SvgButton.vue diff --git a/cista-front/src/components/UploadButton.vue b/frontend/src/components/UploadButton.vue similarity index 100% rename from cista-front/src/components/UploadButton.vue rename to frontend/src/components/UploadButton.vue diff --git a/cista-front/src/main.ts b/frontend/src/main.ts similarity index 100% rename from cista-front/src/main.ts rename to frontend/src/main.ts diff --git a/cista-front/src/repositories/Client.ts b/frontend/src/repositories/Client.ts similarity index 100% rename from cista-front/src/repositories/Client.ts rename to frontend/src/repositories/Client.ts diff --git a/cista-front/src/repositories/Document.ts b/frontend/src/repositories/Document.ts similarity index 100% rename from cista-front/src/repositories/Document.ts rename to frontend/src/repositories/Document.ts diff --git a/cista-front/src/repositories/User.ts b/frontend/src/repositories/User.ts similarity index 100% rename from cista-front/src/repositories/User.ts rename to frontend/src/repositories/User.ts diff --git a/cista-front/src/repositories/WS.ts b/frontend/src/repositories/WS.ts similarity index 100% rename from cista-front/src/repositories/WS.ts rename to frontend/src/repositories/WS.ts diff --git a/cista-front/src/router/index.ts b/frontend/src/router/index.ts similarity index 100% rename from cista-front/src/router/index.ts rename to frontend/src/router/index.ts diff --git a/cista-front/src/stores/documents.ts b/frontend/src/stores/documents.ts similarity index 100% rename from cista-front/src/stores/documents.ts rename to frontend/src/stores/documents.ts diff --git a/cista-front/src/utils/index.ts b/frontend/src/utils/index.ts similarity index 100% rename from cista-front/src/utils/index.ts rename to frontend/src/utils/index.ts diff --git a/cista-front/src/views/ExplorerView.vue b/frontend/src/views/ExplorerView.vue similarity index 100% rename from cista-front/src/views/ExplorerView.vue rename to frontend/src/views/ExplorerView.vue diff --git a/cista-front/tsconfig.app.json b/frontend/tsconfig.app.json similarity index 100% rename from cista-front/tsconfig.app.json rename to frontend/tsconfig.app.json diff --git a/cista-front/tsconfig.json b/frontend/tsconfig.json similarity index 100% rename from cista-front/tsconfig.json rename to frontend/tsconfig.json diff --git a/cista-front/tsconfig.node.json b/frontend/tsconfig.node.json similarity index 100% rename from cista-front/tsconfig.node.json rename to frontend/tsconfig.node.json diff --git a/cista-front/tsconfig.vitest.json b/frontend/tsconfig.vitest.json similarity index 100% rename from cista-front/tsconfig.vitest.json rename to frontend/tsconfig.vitest.json diff --git a/cista-front/vite.config.ts b/frontend/vite.config.ts similarity index 100% rename from cista-front/vite.config.ts rename to frontend/vite.config.ts -- 2.45.2 From 535905780a2d8648cd043fdeaef3a8c9e8a6e343 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sun, 12 Nov 2023 11:55:28 +0000 Subject: [PATCH 04/19] Refactor file modified/size fields components, style different sizes --- frontend/src/components/FileExplorer.vue | 17 +++---------- frontend/src/components/FileModified.vue | 22 ++++++++++++++++ frontend/src/components/FileSize.vue | 32 ++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 frontend/src/components/FileModified.vue create mode 100644 frontend/src/components/FileSize.vue diff --git a/frontend/src/components/FileExplorer.vue b/frontend/src/components/FileExplorer.vue index 5b7e8f8..a12586f 100644 --- a/frontend/src/components/FileExplorer.vue +++ b/frontend/src/components/FileExplorer.vue @@ -48,12 +48,8 @@ " /> - - - - {{ editing.sizedisp }} + + - - - - {{ doc.sizedisp }} + +