Repository navigation
Add: import links and folders from another dashboard - #31
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ui/js/yaml-lite.js, an indentation-only YAML subset parser with no dependency, which throws with the offending line number on tabs, anchors and aliases, merge keys, flow collections, block scalars and multi-document files rather than mis-parsing them.ui/js/import-foreign.js, pure conversion from gethomepageservices.yamlandbookmarks.yamland Dashyconf.ymlinto app and folder items, reusingbuildAppItem,newItemIdandisSafeLinkUrlrather than restating the item shape or the link rule.siteMonitor, and DashystatusCheck/statusCheckUrl/statusCheckAllowInsecure, ontomonitoring.healthcheckandskipTlsVerify; import a Homepagecontaineronly when noserverkey names another daemon.{{HOMEPAGE_VAR_}},${}) or has no scheme, so a save cannot be refused wholesale by one bad link, and report every skip with a machine-readable reason.img-srcpolicy refuses.ui/js/modal.js, one focus-trapped dialog used by the import preview, the folder picker and the new-folder prompt, replacingconfirm()andprompt()and removing the duplicate focus trap inadmin.js; rename the.fp-*styles to.dlg-*.save()so a failed write is no longer reported as success..yml/.yamlfiles, previewing apps, folders, per-item changes and skips before anything is written, and abort the whole batch if any file fails to parse.Testing
All green: 1086 backend, 606 frontend, 94.81% line coverage, lint, format, both typechecks,
paths:check, cache-busting and the Docker build. Added 41 tests across the parser, the converter and a fixture suite that runs three configs exported from gethomepage 1.x and Dashy 4.5.7 containers, whose parse output was checked byte-for-byte against js-yaml.Checklist