refactor: optimize setting view

This commit is contained in:
2026-06-12 11:05:04 +08:00
parent 4576653b4e
commit 3cd92945ac
4 changed files with 81 additions and 48 deletions
+2 -2
View File
@@ -46,8 +46,8 @@ const activeTab = ref<SettingsTab>('general')
// a one-line change. The label values match the user-facing tab names.
const sidebarItems: Array<{ id: SettingsTab; label: string }> = [
{ id: 'general', label: 'General' },
{ id: 's3', label: 'S3-Conf' },
{ id: 'ssh', label: 'SSH-Conf' },
{ id: 's3', label: 'S3' },
{ id: 'ssh', label: 'SSH' },
]
interface OverlayPayload {
+14 -8
View File
@@ -78,7 +78,7 @@ function defaultConfig(): AppConfig {
host: '',
port: 22,
user: '',
authMethod: 'builtin',
authMethod: 'password',
password: '',
pathPrefix: 'snapgo/',
strictHostKey: false,
@@ -286,7 +286,8 @@ onMounted(load)
<label class="field">
<span>Auth method</span>
<select v-model="config.ssh.authMethod">
<option value="builtin">Password / Key</option>
<option value="password">Password</option>
<option value="key">SSH-Key</option>
<option value="kerberos">Kerberos</option>
</select>
</label>
@@ -295,10 +296,10 @@ onMounted(load)
<input v-model="config.ssh.user" placeholder="ubuntu" />
</label>
<label
v-if="config.ssh.authMethod !== 'kerberos'"
v-if="config.ssh.authMethod === 'password'"
class="field"
>
<span>Password (optional)</span>
<span>Password</span>
<input v-model="config.ssh.password" type="password" />
</label>
</div>
@@ -340,16 +341,21 @@ onMounted(load)
</div>
<p v-if="config.ssh.authMethod === 'kerberos'" class="hint">
Kerberos mode delegates to the system <code>ssh</code>/<code>scp</code>.
Run <code>kinit {{ config.ssh.user || 'user' }}@BYTEDANCE.COM</code> in a terminal first; tickets
Run <code>kinit your.name@BYTEDANCE.COM</code> in a terminal first; tickets
expire (typically every 1024h), so re-run <code>kinit</code> if uploads
start failing. Verify with <code>klist</code>.
</p>
<p v-else-if="config.ssh.authMethod === 'key'" class="hint">
SSH-Key mode uses your <code>ssh-agent</code> and <code>~/.ssh/id_*</code>
keys. Make sure password-less login already works (e.g. via
<code>ssh-copy-id</code>).
</p>
<p
v-else-if="!config.ssh.password"
v-else-if="config.ssh.authMethod === 'password' && !config.ssh.password"
class="hint warn"
>
Password is empty please make sure password-less SSH is configured on
this machine (e.g. via <code>ssh-copy-id</code> or your <code>ssh-agent</code>).
Password is empty enter the remote login password, or switch the auth
method to SSH-Key.
</p>
<div class="actions">