From 3a4826c798b913c6301c11ee520643ffa04c9806 Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Mon, 10 Aug 2026 23:00:19 -0400 Subject: [PATCH] Add: import links and folders from another dashboard Reads gethomepage services.yaml and bookmarks.yaml and Dashy conf.yml, converting groups to folders and services to app tiles. A widget in the source becomes a plain link, never a Stackyard widget. Parsing is an indentation-only YAML subset with no dependency. It refuses anchors, flow collections, block scalars, tabs and multi-document files with the offending line, rather than guessing at a construct it cannot represent faithfully. An import appends and never merges: it is previewed first, listing what will be added, what changed on the way in, and everything skipped with a reason. The save reads the stored config immediately before writing, so a change made elsewhere while the preview was open survives. --- CHANGELOG.md | 5 + README.md | 2 +- tsconfig.frontend.json | 18 + ui/admin/index.html | 6 +- ui/css/admin.css | 22 +- ui/i18n/de.json | 52 ++- ui/i18n/en.json | 52 ++- ui/i18n/es.json | 52 ++- ui/i18n/fa.json | 52 ++- ui/i18n/fr.json | 52 ++- ui/i18n/zh-Hans.json | 52 ++- ui/js/admin.js | 303 +++++++++++----- ui/js/import-foreign.js | 423 +++++++++++++++++++++++ ui/js/modal.js | 147 ++++++++ ui/js/yaml-lite.js | 196 +++++++++++ ui/test/fixtures/dashy-conf.yml | 102 ++++++ ui/test/fixtures/homepage-bookmarks.yaml | 25 ++ ui/test/fixtures/homepage-services.yaml | 76 ++++ ui/test/import-fixtures.test.mjs | 142 ++++++++ ui/test/import-foreign.test.mjs | 362 +++++++++++++++++++ ui/test/yaml-lite.test.mjs | 139 ++++++++ 21 files changed, 2163 insertions(+), 117 deletions(-) create mode 100644 ui/js/import-foreign.js create mode 100644 ui/js/modal.js create mode 100644 ui/js/yaml-lite.js create mode 100644 ui/test/fixtures/dashy-conf.yml create mode 100644 ui/test/fixtures/homepage-bookmarks.yaml create mode 100644 ui/test/fixtures/homepage-services.yaml create mode 100644 ui/test/import-fixtures.test.mjs create mode 100644 ui/test/import-foreign.test.mjs create mode 100644 ui/test/yaml-lite.test.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index ea400e32..cd75a9c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Import links and folders from a gethomepage or Dashy YAML config. + - The Docker Hub repository description is published from `README.md` on each stable release. @@ -17,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Confirming an import and naming a new folder use in-page dialogs instead of + the browser's own. + - The container prints six lines when it starts, instead of twenty-three. - Nginx request errors now appear in `docker logs`, and Nginx no longer writes diff --git a/README.md b/README.md index 56b69f18..d0f31a7d 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Then run `stackyard:local` the same way as above. For working on the code withou Everything is configured in the admin UI (`/admin`), split into a few sections: -- **General**: title, description, and your server's **Host IP** (used to allow your own server in badge URLs and SSRF checks). Also **Monitoring** (logging level, Docker container health checks, and the socket URL used to reach Docker), optional **password protection**, and config **import / export**. +- **General**: title, description, and your server's **Host IP** (used to allow your own server in badge URLs and SSRF checks). Also **Monitoring** (logging level, Docker container health checks, and the socket URL used to reach Docker), optional **password protection**, and config **import / export**. Backup also imports a gethomepage or Dashy YAML config: links and folders are added to the dashboard, existing items are left alone, and anything that cannot be carried across is listed before you confirm. - **Appearance**: wallpaper and the overall look. - **Dashboard**: add and arrange your apps, folders, and widgets, and configure each one (including live activity badges). - **About**: version and links. diff --git a/tsconfig.frontend.json b/tsconfig.frontend.json index 01e09fad..db9c26cf 100644 --- a/tsconfig.frontend.json +++ b/tsconfig.frontend.json @@ -136,6 +136,12 @@ "/js/html.js?v=*": [ "./ui/js/html.js" ], + "/js/import-foreign.js": [ + "./ui/js/import-foreign.js" + ], + "/js/import-foreign.js?v=*": [ + "./ui/js/import-foreign.js" + ], "/js/i18n-markup.js": [ "./ui/js/i18n-markup.js" ], @@ -160,6 +166,12 @@ "/js/link-url.js?v=*": [ "./ui/js/link-url.js" ], + "/js/modal.js": [ + "./ui/js/modal.js" + ], + "/js/modal.js?v=*": [ + "./ui/js/modal.js" + ], "/js/mobile-metrics.js": [ "./ui/js/mobile-metrics.js" ], @@ -190,6 +202,12 @@ "/js/utils.js?v=*": [ "./ui/js/utils.js" ], + "/js/yaml-lite.js": [ + "./ui/js/yaml-lite.js" + ], + "/js/yaml-lite.js?v=*": [ + "./ui/js/yaml-lite.js" + ], "/js/widget-config-form.js": [ "./ui/js/widget-config-form.js" ], diff --git a/ui/admin/index.html b/ui/admin/index.html index b6e8535c..262bdf8b 100644 --- a/ui/admin/index.html +++ b/ui/admin/index.html @@ -8,7 +8,7 @@
Reads gethomepage and Dashy YAML files. Links and folders are added to your dashboard; widgets from the other dashboard become plain links.
@@ -283,6 +285,6 @@