feat(servers/settings): magic string invites, Navidrome admin share, and add-user validation (#258)

* feat(servers): magic string invites and duplicate-aware labels

Add psysonic1- share payloads (URL, Subsonic credentials, optional server
name). Login and add-server forms decode on input and keep magic field
below standard fields. Navidrome User Management generates strings after
PUT password updates where required. Resolve duplicate display names as
username@host in chrome, settings, and login.

* feat(servers): tighten magic-string import and admin share flow

After a decoded magic string, username is read-only and the password field
shows a fixed-length mask so length is not inferred. Password reveal stays
disabled until saved-server quick connect (login) or reopening the add-
server form. Navidrome admin share UI persists the password via API before
copy and adds a plaintext-handling disclaimer. Locales updated.

* feat(settings): save new Navidrome user and copy magic string

Add a non-admin "Save and get magic string" flow: create the user, assign
libraries when needed, then encode credentials to the clipboard. Reuse
the plaintext-handling disclaimer without the password-update hint meant
for edits. Strings added for all locales.

* fix(settings): tighten Navidrome add-user validation and submit feedback

Require username, display name, and a non-empty password (trimmed) for new
users; gate Save and “save and get magic string” on explicit checks with
toast feedback. Show red borders only after a failed submit, and clear
them when the user fills the fields. When editing, keep an empty password
as “unchanged” and validate identity fields with a dedicated message.
Strings: userMgmtValidationMissingIdentity across locales.
This commit is contained in:
cucadmuh
2026-04-22 01:45:28 +03:00
committed by GitHub
parent b61c168430
commit f6f76723d8
16 changed files with 910 additions and 51 deletions
+16
View File
@@ -350,6 +350,9 @@ export const zhTranslation = {
urlRequired: '请输入服务器地址。',
savedServers: '已保存的服务器',
addNew: '或添加新服务器',
orMagicString: '或使用魔法字符串',
magicStringPlaceholder: '粘贴分享字符串(psysonic1-…)',
magicStringInvalid: '魔法字符串无效或无法解析。',
},
connection: {
connected: '已连接',
@@ -494,6 +497,19 @@ export const zhTranslation = {
userMgmtUpdated: '用户已更新。',
userMgmtDeleted: '用户已删除。',
userMgmtValidationMissing: '用户名、显示名称和密码均为必填项。',
userMgmtValidationMissingIdentity: '用户名和显示名称为必填项。',
userMgmtMagicStringGenerate: '生成魔法字符串',
userMgmtSaveAndMagicString: '保存并获取魔法字符串',
userMgmtMagicStringPasswordNavHint:
'Navidrome 会保存此密码。若与当前密码不同,服务器上的登录密码将被更新。',
userMgmtMagicStringPlaintextWarning:
'请谨慎分享魔法字符串:其中包含未加密的密码(编码不等于加密)。掌握完整字符串的人可以以该用户身份登录。',
userMgmtMagicStringCopied: '魔法字符串已复制到剪贴板。',
userMgmtMagicStringCopyFailed: '无法复制到剪贴板。',
userMgmtMagicStringLoginFailed: '密码验证失败,无法确认凭据。',
userMgmtMagicStringModalTitle: '生成魔法字符串',
userMgmtMagicStringModalDesc: '请输入用户「{{username}}」的 Subsonic 密码,它会包含在复制的魔法字符串中。',
userMgmtMagicStringModalConfirm: '复制字符串',
audiomuseTitle: 'AudioMuse-AINavidrome',
audiomuseDesc:
'若此服务器已配置 <pluginLink>AudioMuse-AI Navidrome 插件</pluginLink>请开启。可从曲目启动即时混音,并在艺人页使用服务器返回的相似艺人,而非 Last.fm。',