dsh-config-manager 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/adapters/mcp.js +42 -13
- package/lib/adapters/messages.d.ts +1 -0
- package/lib/adapters/messages.js +2 -0
- package/lib/adapters/patch-key-guard.d.ts +23 -0
- package/lib/adapters/patch-key-guard.js +13 -0
- package/lib/adapters/plugin-data.d.ts +19 -5
- package/lib/adapters/plugin-data.js +76 -22
- package/lib/adapters/plugins.d.ts +14 -1
- package/lib/adapters/plugins.js +147 -4
- package/lib/cli/actions.d.ts +7 -105
- package/lib/cli/actions.js +16 -172
- package/lib/cli/control-state.d.ts +54 -0
- package/lib/cli/control-state.js +107 -0
- package/lib/cli/index.js +14 -0
- package/lib/cli/write-gates.d.ts +61 -0
- package/lib/cli/write-gates.js +110 -0
- package/lib/client.d.ts +122 -50
- package/lib/client.js +12676 -12091
- package/lib/core/backup.d.ts +0 -4
- package/lib/core/backup.js +21 -4
- package/lib/core/boot-rescue.d.ts +1 -1
- package/lib/core/boot-rescue.js +12 -1
- package/lib/core/boot-safety.js +37 -2
- package/lib/core/conflict-decisions.js +2 -1
- package/lib/core/exporter.js +22 -1
- package/lib/core/journal.d.ts +54 -4
- package/lib/core/journal.js +158 -35
- package/lib/core/local-plugin-host.d.ts +29 -0
- package/lib/core/local-plugin-host.js +55 -48
- package/lib/core/messages.d.ts +7 -0
- package/lib/core/messages.js +14 -0
- package/lib/core/migration-history.js +16 -9
- package/lib/core/model-tools.d.ts +2 -2
- package/lib/core/model-tools.js +14 -2
- package/lib/core/patch-secret-guard.d.ts +49 -0
- package/lib/core/patch-secret-guard.js +164 -0
- package/lib/core/reconcile.d.ts +8 -0
- package/lib/core/reconcile.js +18 -3
- package/lib/core/reinstall.d.ts +2 -0
- package/lib/core/reinstall.js +6 -2
- package/lib/core/restore.js +31 -6
- package/lib/core/section-sanitize.d.ts +32 -0
- package/lib/core/section-sanitize.js +13 -0
- package/lib/core/snapshot-diff.d.ts +30 -0
- package/lib/core/snapshot-diff.js +56 -20
- package/lib/core/startup-barrier.js +8 -2
- package/lib/core/types.d.ts +22 -0
- package/lib/core/update-check.js +51 -2
- package/lib/foreign/kernel.js +9 -2
- package/lib/foreign/read-claude-plugins.js +29 -11
- package/lib/foreign/read-dsh.js +31 -2
- package/lib/foreign/read-trae.d.ts +11 -0
- package/lib/foreign/read-trae.js +124 -4
- package/lib/foreign/session-ir.js +50 -9
- package/lib/foreign/session-read.d.ts +8 -0
- package/lib/foreign/session-read.js +26 -0
- package/lib/foreign/session-source.d.ts +12 -4
- package/lib/foreign/session-source.js +5 -3
- package/lib/foreign/trae-sqlcipher.d.ts +127 -0
- package/lib/foreign/trae-sqlcipher.js +519 -0
- package/lib/foreign/trae.js +3 -1
- package/lib/foreign/truth-table.js +3 -2
- package/lib/foreign/types.d.ts +9 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/profiles/dsh-profile-io.d.ts +20 -0
- package/lib/profiles/dsh-profile-io.js +27 -0
- package/lib/profiles/dsh-profile-manager.d.ts +27 -0
- package/lib/profiles/dsh-profile-manager.js +45 -4
- package/lib/profiles/dsh-profile-runtime.d.ts +5 -1
- package/lib/profiles/dsh-profile-runtime.js +16 -3
- package/lib/profiles/process-control.d.ts +18 -1
- package/lib/profiles/process-control.js +25 -1
- package/lib/routes/profiles.js +2 -1
- package/lib/routes/sync.js +13 -1
- package/lib/schema/types.d.ts +11 -0
- package/lib/security/redaction.js +22 -6
- package/lib/sync/autosync-repeat.d.ts +27 -0
- package/lib/sync/autosync-repeat.js +23 -0
- package/lib/sync/autosync-scheduler.d.ts +34 -1
- package/lib/sync/autosync-scheduler.js +151 -43
- package/lib/sync/baseline-heal.js +7 -0
- package/lib/sync/baseline-record.d.ts +67 -0
- package/lib/sync/baseline-record.js +74 -0
- package/lib/sync/blob-store.js +13 -0
- package/lib/sync/content-diff.d.ts +39 -0
- package/lib/sync/content-diff.js +46 -0
- package/lib/sync/git/git-transport.d.ts +32 -1
- package/lib/sync/git/git-transport.js +146 -26
- package/lib/sync/github-auth.d.ts +17 -1
- package/lib/sync/github-auth.js +37 -1
- package/lib/sync/merge-apply-plan.d.ts +38 -0
- package/lib/sync/merge-apply-plan.js +76 -0
- package/lib/sync/messages.d.ts +1 -0
- package/lib/sync/messages.js +2 -0
- package/lib/sync/pending-merge.d.ts +34 -0
- package/lib/sync/pending-merge.js +53 -0
- package/lib/sync/s3/s3-transport.d.ts +14 -2
- package/lib/sync/s3/s3-transport.js +72 -48
- package/lib/sync/sync-engine.d.ts +23 -40
- package/lib/sync/sync-engine.js +115 -132
- package/lib/sync/sync-history.d.ts +7 -0
- package/lib/sync/sync-state.d.ts +28 -0
- package/lib/sync/sync-state.js +20 -0
- package/lib/sync/transport.d.ts +12 -3
- package/lib/sync/transport.js +13 -4
- package/lib/sync/webdav/webdav-transport.d.ts +19 -2
- package/lib/sync/webdav/webdav-transport.js +81 -40
- package/lib/ui/commands.js +5 -11
- package/lib/ui/dsh-profiles-view.d.ts +8 -3
- package/lib/ui/dsh-profiles-view.js +9 -5
- package/lib/ui/foreign-view.d.ts +19 -0
- package/lib/ui/foreign-view.js +24 -0
- package/lib/ui/i18n.d.ts +7 -1
- package/lib/ui/i18n.js +17 -2
- package/lib/ui/menu-placement.js +1 -1
- package/lib/ui/migration-consult-view.d.ts +11 -0
- package/lib/ui/migration-consult-view.js +15 -0
- package/lib/ui/overview-view.d.ts +7 -0
- package/lib/ui/overview-view.js +3 -0
- package/lib/ui/report.d.ts +9 -0
- package/lib/ui/report.js +17 -4
- package/lib/ui/selection-model.d.ts +8 -0
- package/lib/ui/selection-model.js +16 -0
- package/lib/utils/patch-yaml.d.ts +39 -1
- package/lib/utils/patch-yaml.js +82 -2
- package/lib/utils/paths.d.ts +13 -0
- package/lib/utils/paths.js +35 -0
- package/lib/utils/workdir-lock.js +18 -3
- package/package.json +2 -1
- package/src/adapters/mcp.test.ts +29 -0
- package/src/adapters/mcp.ts +43 -12
- package/src/adapters/messages.ts +2 -0
- package/src/adapters/patch-key-guard.ts +29 -0
- package/src/adapters/plugin-data.test.ts +126 -0
- package/src/adapters/plugin-data.ts +97 -26
- package/src/adapters/plugins.test.ts +288 -0
- package/src/adapters/plugins.ts +141 -4
- package/src/cli/actions.test.ts +74 -1
- package/src/cli/actions.ts +27 -246
- package/src/cli/control-state.ts +143 -0
- package/src/cli/index.ts +18 -0
- package/src/cli/web/web.test.ts +27 -0
- package/src/cli/write-gates.ts +149 -0
- package/src/client/about/AboutPanel.tsx +7 -6
- package/src/client/about/release-notes-view.test.ts +17 -0
- package/src/client/about/release-notes-view.ts +49 -24
- package/src/client/chat/ChatEntryView.tsx +2 -2
- package/src/client/chat/rollback-entry-view.ts +6 -1
- package/src/client/common/CommandPalette.tsx +6 -3
- package/src/client/common/ConfirmDialog.tsx +29 -12
- package/src/client/common/ContentPicker.tsx +13 -12
- package/src/client/common/Modal.tsx +12 -5
- package/src/client/common/MoreMenu.tsx +4 -1
- package/src/client/common/RunsCenter.tsx +103 -32
- package/src/client/common/Select.tsx +2 -2
- package/src/client/common/floating-bounds.ts +1 -1
- package/src/client/common/floating-units.test.ts +1 -2
- package/src/client/common/plan-text-redaction.test.ts +188 -3
- package/src/client/common/runs-center-guard.test.ts +60 -0
- package/src/client/common/runs-center-view.test.ts +128 -0
- package/src/client/common/runs-center-view.ts +96 -0
- package/src/client/common/section-title-action.test.ts +66 -0
- package/src/client/common/ui.tsx +93 -30
- package/src/client/config-manager.module.css +1507 -272
- package/src/client/consult/ConsultCard.tsx +7 -6
- package/src/client/environment/EnvironmentPanel.tsx +20 -21
- package/src/client/environment/maintenance/DiskUsageCard.tsx +65 -91
- package/src/client/environment/profiles-incomplete-ui.test.ts +8 -8
- package/src/client/export/ExportView.tsx +7 -16
- package/src/client/history/HistoryPanel.tsx +88 -28
- package/src/client/history/history-locales.ts +3 -3
- package/src/client/home/BackupScheduleCard.tsx +35 -30
- package/src/client/home/HomePanel.tsx +45 -10
- package/src/client/import/ConflictList.tsx +13 -13
- package/src/client/import/ForeignImportView.tsx +32 -13
- package/src/client/import/ImportWizardView.tsx +2 -3
- package/src/client/import/PathMappingForm.tsx +4 -4
- package/src/client/import/PathPickerDialog.tsx +2 -1
- package/src/client/import/foreign-import-view-guard.test.ts +1 -1
- package/src/client/import/import-wizard-steps.tsx +51 -39
- package/src/client/import/use-import-wizard-controller.test.ts +129 -0
- package/src/client/import/use-import-wizard-controller.ts +116 -22
- package/src/client/library/ArtifactRow.tsx +2 -2
- package/src/client/library/BackupInspectView.tsx +19 -15
- package/src/client/library/LibraryActions.tsx +56 -16
- package/src/client/library/LibraryPanel.tsx +7 -7
- package/src/client/library/RestorePlanView.tsx +13 -8
- package/src/client/locales/about.ts +0 -2
- package/src/client/locales/backup.ts +10 -12
- package/src/client/locales/common.ts +2 -0
- package/src/client/locales/export.ts +5 -12
- package/src/client/locales/foreign.ts +11 -2
- package/src/client/locales/import.ts +3 -2
- package/src/client/locales/overview.ts +4 -0
- package/src/client/locales/profiles.ts +32 -4
- package/src/client/locales/restore.ts +0 -2
- package/src/client/locales/sessions.ts +0 -2
- package/src/client/locales/shell.ts +2 -2
- package/src/client/market/MarketPanel.tsx +38 -20
- package/src/client/market/MyConfigsList.tsx +34 -32
- package/src/client/market/MyConfigsLoginCard.tsx +12 -15
- package/src/client/market/MyConfigsView.tsx +5 -5
- package/src/client/market/MyConfigsWizard.tsx +7 -12
- package/src/client/market/market-locales.ts +0 -6
- package/src/client/market/my-configs-split.test.ts +2 -1
- package/src/client/nav-menu-clip-guard.test.ts +52 -0
- package/src/client/recovery/IncompleteCopiesSection.tsx +1 -3
- package/src/client/recovery/RecoveryPanel.tsx +31 -16
- package/src/client/recovery/RollbackCard.tsx +58 -16
- package/src/client/recovery/RollbackFileChanges.tsx +40 -27
- package/src/client/recovery/SessionHealthCard.tsx +2 -2
- package/src/client/recovery/SessionHealthDialog.tsx +5 -7
- package/src/client/recovery/SessionLayoutSection.tsx +3 -5
- package/src/client/recovery/recovery-locales.ts +12 -8
- package/src/client/run-store.test.ts +30 -0
- package/src/client/run-store.ts +21 -1
- package/src/client/sync/AddChannelCard.tsx +65 -0
- package/src/client/sync/AutosyncCard.tsx +182 -108
- package/src/client/sync/ChannelClearConfirmDialog.tsx +5 -1
- package/src/client/sync/ChannelConfigDialog.tsx +27 -48
- package/src/client/sync/MergePreviewView.tsx +3 -5
- package/src/client/sync/PushReportSections.tsx +35 -0
- package/src/client/sync/SyncChannelEntryCard.tsx +33 -24
- package/src/client/sync/SyncConfirmView.tsx +3 -3
- package/src/client/sync/SyncLogList.tsx +16 -5
- package/src/client/sync/SyncPanel.tsx +153 -159
- package/src/client/sync/SyncProbeRow.tsx +5 -7
- package/src/client/sync/SyncRepositoryPicker.tsx +17 -4
- package/src/client/sync/SyncSecuritySection.tsx +157 -0
- package/src/client/sync/SyncSettingsDialog.tsx +304 -0
- package/src/client/sync/SyncSettingsView.test.ts +26 -8
- package/src/client/sync/WorkDirCard.tsx +2 -4
- package/src/client/sync/config-clear-guard.test.ts +94 -0
- package/src/client/sync/config-clear-guard.ts +98 -0
- package/src/client/sync/config-dirty.test.ts +91 -0
- package/src/client/sync/config-dirty.ts +88 -0
- package/src/client/sync/history-model.test.ts +2 -0
- package/src/client/sync/history-model.ts +3 -0
- package/src/client/sync/merge-request.ts +20 -0
- package/src/client/sync/sync-api.ts +12 -0
- package/src/client/sync/sync-locales.ts +87 -47
- package/src/client/sync/sync-panel-clear.test.ts +44 -0
- package/src/client/sync/sync-view.test.ts +20 -0
- package/src/client/sync/sync-view.ts +42 -4
- package/src/core/backup.test.ts +61 -1
- package/src/core/backup.ts +21 -4
- package/src/core/boot-rescue.test.ts +35 -0
- package/src/core/boot-rescue.ts +13 -2
- package/src/core/boot-safety.test.ts +25 -0
- package/src/core/boot-safety.ts +37 -2
- package/src/core/conflict-decisions.ts +2 -1
- package/src/core/exporter.ts +21 -1
- package/src/core/journal.test.ts +183 -0
- package/src/core/journal.ts +163 -25
- package/src/core/local-plugin-host.test.ts +68 -2
- package/src/core/local-plugin-host.ts +31 -4
- package/src/core/messages.ts +14 -0
- package/src/core/migration-history.test.ts +27 -0
- package/src/core/migration-history.ts +12 -4
- package/src/core/model-tools.test.ts +67 -0
- package/src/core/model-tools.ts +16 -4
- package/src/core/patch-secret-guard.test.ts +110 -0
- package/src/core/patch-secret-guard.ts +176 -0
- package/src/core/reconcile.ts +32 -4
- package/src/core/reinstall.ts +8 -2
- package/src/core/restore.ts +32 -7
- package/src/core/section-sanitize.ts +37 -0
- package/src/core/snapshot-diff.test.ts +73 -1
- package/src/core/snapshot-diff.ts +66 -21
- package/src/core/startup-barrier.test.ts +64 -0
- package/src/core/startup-barrier.ts +8 -2
- package/src/core/types.ts +27 -1
- package/src/core/update-check.test.ts +40 -0
- package/src/core/update-check.ts +53 -2
- package/src/foreign/claude-code.test.ts +5 -0
- package/src/foreign/claude-plugins.test.ts +57 -0
- package/src/foreign/claude-sessions-bytes.test.ts +7 -1
- package/src/foreign/dsh.test.ts +23 -0
- package/src/foreign/file-budget.test.ts +7 -1
- package/src/foreign/kernel.ts +9 -2
- package/src/foreign/read-claude-plugins.ts +32 -11
- package/src/foreign/read-dsh.ts +33 -2
- package/src/foreign/read-trae.ts +117 -5
- package/src/foreign/session-ir.test.ts +67 -0
- package/src/foreign/session-ir.ts +54 -14
- package/src/foreign/session-read.ts +23 -0
- package/src/foreign/session-source.ts +15 -5
- package/src/foreign/trae-sqlcipher.test.ts +360 -0
- package/src/foreign/trae-sqlcipher.ts +564 -0
- package/src/foreign/trae.test.ts +188 -0
- package/src/foreign/trae.ts +3 -1
- package/src/foreign/truth-table.ts +4 -2
- package/src/foreign/types.ts +10 -1
- package/src/index.ts +1 -1
- package/src/profiles/dsh-profile-copy-rollback.test.ts +58 -4
- package/src/profiles/dsh-profile-io.ts +29 -0
- package/src/profiles/dsh-profile-manager.test.ts +30 -0
- package/src/profiles/dsh-profile-manager.ts +53 -5
- package/src/profiles/dsh-profile-runtime.test.ts +29 -7
- package/src/profiles/dsh-profile-runtime.ts +17 -3
- package/src/profiles/process-control.test.ts +97 -0
- package/src/profiles/process-control.ts +28 -1
- package/src/routes/profiles.ts +2 -1
- package/src/routes/sync.ts +13 -1
- package/src/schema/types.ts +16 -1
- package/src/security/redaction.test.ts +31 -0
- package/src/security/redaction.ts +23 -6
- package/src/sync/autosync-repeat.test.ts +58 -0
- package/src/sync/autosync-repeat.ts +55 -0
- package/src/sync/autosync-scheduler.test.ts +417 -0
- package/src/sync/autosync-scheduler.ts +154 -41
- package/src/sync/baseline-heal.ts +6 -0
- package/src/sync/baseline-record.ts +135 -0
- package/src/sync/blob-store.test.ts +16 -0
- package/src/sync/blob-store.ts +13 -0
- package/src/sync/content-diff.test.ts +95 -0
- package/src/sync/content-diff.ts +79 -0
- package/src/sync/git/git-transport.test.ts +151 -4
- package/src/sync/git/git-transport.ts +143 -27
- package/src/sync/github-auth.test.ts +26 -1
- package/src/sync/github-auth.ts +37 -1
- package/src/sync/merge-apply-plan.ts +117 -0
- package/src/sync/messages.ts +2 -0
- package/src/sync/pending-merge.ts +77 -0
- package/src/sync/s3/s3-delete-and-blob-index.test.ts +249 -0
- package/src/sync/s3/s3-transport.ts +76 -42
- package/src/sync/sync-config.test.ts +39 -12
- package/src/sync/sync-device-identity.test.ts +3 -0
- package/src/sync/sync-engine.test.ts +465 -12
- package/src/sync/sync-engine.ts +130 -135
- package/src/sync/sync-history.ts +7 -0
- package/src/sync/sync-state.ts +48 -0
- package/src/sync/transport.test.ts +13 -1
- package/src/sync/transport.ts +12 -4
- package/src/sync/webdav/webdav-delete-and-blob-index.test.ts +249 -0
- package/src/sync/webdav/webdav-transport.ts +86 -34
- package/src/ui/commands.test.ts +11 -0
- package/src/ui/commands.ts +5 -14
- package/src/ui/dsh-profiles-view.test.ts +16 -0
- package/src/ui/dsh-profiles-view.ts +11 -5
- package/src/ui/foreign-view.test.ts +36 -0
- package/src/ui/foreign-view.ts +46 -0
- package/src/ui/i18n.ts +17 -2
- package/src/ui/menu-placement.ts +1 -1
- package/src/ui/migration-consult-view.test.ts +20 -1
- package/src/ui/migration-consult-view.ts +17 -0
- package/src/ui/overview-view.ts +10 -0
- package/src/ui/report.test.ts +25 -1
- package/src/ui/report.ts +15 -4
- package/src/ui/selection-model.test.ts +15 -1
- package/src/ui/selection-model.ts +18 -0
- package/src/utils/js-yaml4.d.ts +35 -0
- package/src/utils/patch-yaml.test.ts +207 -1
- package/src/utils/patch-yaml.ts +98 -2
- package/src/utils/paths.test.ts +14 -1
- package/src/utils/paths.ts +35 -0
- package/src/utils/workdir-lock.test.ts +69 -0
- package/src/utils/workdir-lock.ts +17 -3
- package/lib/ui/path-mapping.d.ts +0 -38
- package/lib/ui/path-mapping.js +0 -75
- package/src/client/common/InfoHint.tsx +0 -289
- package/src/client/common/info-hint-guard.test.ts +0 -1119
- package/src/client/sync/DecryptPasswordCard.tsx +0 -48
- package/src/client/sync/SecurityOptionsCard.tsx +0 -97
- package/src/client/sync/SyncSectionPickerDialog.tsx +0 -213
- package/src/ui/path-mapping.test.ts +0 -67
- package/src/ui/path-mapping.ts +0 -103
|
@@ -9,7 +9,6 @@ import type { ChangeEvent } from 'react'
|
|
|
9
9
|
import type { TranslateNS } from '../client-types.ts'
|
|
10
10
|
import type { UiT } from '../../ui/i18n.ts'
|
|
11
11
|
import { Badge, Banner, Button, Checkbox } from '../common/ui.tsx'
|
|
12
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
13
12
|
import { Modal } from '../common/Modal.tsx'
|
|
14
13
|
import { Select } from '../common/Select.tsx'
|
|
15
14
|
import { SYNC_CREDENTIAL_REF, SYNC_WEBDAV_CREDENTIAL_REF } from './sync-api.ts'
|
|
@@ -59,7 +58,7 @@ export type ChannelFormPatch = {
|
|
|
59
58
|
* 拆出的职责单元只接收「渲染所需数据 + 回调」:`onFormChange` 由父组件实现为
|
|
60
59
|
* 「patch 表单 + 防抖自动保存」—— 防抖定时器与卸载 flush 仍归父组件(单一状态源)。
|
|
61
60
|
*/
|
|
62
|
-
export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIssues, busy, savingConfig,
|
|
61
|
+
export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIssues, busy, savingConfig, statusInfo, githubSignedIn, saveTick, githubView, onFormChange, onGithubStart, onGithubCancel }: {
|
|
63
62
|
open: boolean
|
|
64
63
|
onClose: () => void
|
|
65
64
|
api: SyncApi
|
|
@@ -75,7 +74,6 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
75
74
|
cloudIssues: readonly CloudFormIssue[]
|
|
76
75
|
busy: boolean
|
|
77
76
|
savingConfig: boolean
|
|
78
|
-
remoteReady: boolean
|
|
79
77
|
statusInfo: SyncStatusResponse | null
|
|
80
78
|
githubSignedIn: boolean | null
|
|
81
79
|
/**
|
|
@@ -88,7 +86,6 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
88
86
|
onFormChange: (patch: ChannelFormPatch) => void
|
|
89
87
|
onGithubStart: () => void
|
|
90
88
|
onGithubCancel: () => void
|
|
91
|
-
onSave: () => void
|
|
92
89
|
}) {
|
|
93
90
|
const channel = form.channel
|
|
94
91
|
const {
|
|
@@ -128,7 +125,12 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
128
125
|
closeDisabled={savingConfig}
|
|
129
126
|
// 通道身份徽章 + 弹窗级说明:贴在标题右边,不单独成行
|
|
130
127
|
// (子 tab 已移除,弹窗只配置**打开它的那条通道** —— 通道切换在页面的两张通道卡上做)
|
|
131
|
-
trailing={
|
|
128
|
+
trailing={<>
|
|
129
|
+
<Badge kind="info">{t(SYNC_CHANNEL_LABEL_KEY[channel])}</Badge>
|
|
130
|
+
{/* 自动保存的可见回执:改动即存此前完全静默;徽章只闪 2.4s,不占正文行
|
|
131
|
+
(原「立即保存」按钮与它的 ⓘ 已删:表单本来就自动保存,重复的凭据说明已在各密钥字段旁) */}
|
|
132
|
+
{savedVisible && <span className={css.savedTick}><Badge kind="ok">{t('config.savedTick')}</Badge></span>}
|
|
133
|
+
</>}
|
|
132
134
|
/>
|
|
133
135
|
<Modal.Body scroll>
|
|
134
136
|
|
|
@@ -151,7 +153,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
151
153
|
onPick={(cloneUrl) => { onFormChange({ repoUrl: cloneUrl }) }}
|
|
152
154
|
/>
|
|
153
155
|
<div className={css.field}>
|
|
154
|
-
<span className={css.fieldLabel}
|
|
156
|
+
<span className={css.fieldLabel} title={t('config.repoUrlHint')}>{t('config.repoUrl')}</span>
|
|
155
157
|
<input aria-label={t('config.repoUrl')}
|
|
156
158
|
type="text"
|
|
157
159
|
className={css.input}
|
|
@@ -164,7 +166,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
164
166
|
/>
|
|
165
167
|
</div>
|
|
166
168
|
<div className={css.field}>
|
|
167
|
-
<span className={css.fieldLabel}
|
|
169
|
+
<span className={css.fieldLabel} title={t('config.gitSubdirHint')}>{t('config.gitSubdir')}</span>
|
|
168
170
|
<input aria-label={t('config.gitSubdir')}
|
|
169
171
|
type="text"
|
|
170
172
|
className={css.input}
|
|
@@ -177,11 +179,10 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
177
179
|
/>
|
|
178
180
|
</div>
|
|
179
181
|
<div className={css.field}>
|
|
180
|
-
<span className={css.fieldLabel}>
|
|
182
|
+
<span className={css.fieldLabel} title={t('config.tokenHint', { ref: SYNC_CREDENTIAL_REF })}>
|
|
181
183
|
{t('config.token')}
|
|
182
184
|
{' '}
|
|
183
185
|
{statusInfo?.credentialConfigured === true && <Badge kind="ok">{t('config.tokenSaved')}</Badge>}
|
|
184
|
-
<InfoHint text={t('config.tokenHint', { ref: SYNC_CREDENTIAL_REF })} label={t('common.infoHint')} />
|
|
185
186
|
</span>
|
|
186
187
|
<input aria-label={t('config.token')}
|
|
187
188
|
type="password"
|
|
@@ -202,7 +203,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
202
203
|
{statusInfo?.credentialConfigured === true && (
|
|
203
204
|
<Banner kind="warn">{t('github.tokenInvalid')}</Banner>
|
|
204
205
|
)}
|
|
205
|
-
<span className={css.groupLabel}
|
|
206
|
+
<span className={css.groupLabel} title={t('github.description')}>{t('github.title')}</span>
|
|
206
207
|
{githubView.showCode && (
|
|
207
208
|
<div className={css.statRow}>
|
|
208
209
|
<Badge kind="info">{t('github.userCode')}{t('common.labelSeparator')}<strong>{githubView.userCode}</strong></Badge>
|
|
@@ -246,22 +247,21 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
246
247
|
<>
|
|
247
248
|
<span className={css.groupLabel}>{t('webdav.title')}</span>
|
|
248
249
|
{/* 常见 WebDAV 服务器预设:选择后填充 url 模板(含占位符待替换)。
|
|
249
|
-
ⓘ
|
|
250
|
+
原来跟一颗解释「点了会填地址」的 ⓘ —— 那是把按钮名换句话,2026-11-14 删除。 */}
|
|
250
251
|
<div className={css.controlRow}>
|
|
251
252
|
<Select
|
|
252
253
|
value={presetIdForUrl(webdavUrl)}
|
|
253
254
|
disabled={busy}
|
|
254
|
-
ariaLabel={t('webdav.
|
|
255
|
+
ariaLabel={t('webdav.title')}
|
|
255
256
|
onChange={(next) => {
|
|
256
257
|
const preset = presetById(next)
|
|
257
258
|
onFormChange({ webdavUrl: preset.url })
|
|
258
259
|
}}
|
|
259
260
|
options={WEBDAV_PRESETS.map((preset) => ({ value: preset.id, label: t(preset.labelKey) }))}
|
|
260
261
|
/>
|
|
261
|
-
<InfoHint text={t('webdav.presetHint')} label={t('common.infoHint')} />
|
|
262
262
|
</div>
|
|
263
263
|
<div className={css.field}>
|
|
264
|
-
<span className={css.fieldLabel}
|
|
264
|
+
<span className={css.fieldLabel} title={t('webdav.urlHint')}>{t('webdav.url')}</span>
|
|
265
265
|
<input aria-label={t('webdav.url')}
|
|
266
266
|
type="text"
|
|
267
267
|
className={css.input}
|
|
@@ -278,8 +278,6 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
278
278
|
{t('webdav.username')}
|
|
279
279
|
{' '}
|
|
280
280
|
{statusInfo?.webdav?.usernameConfigured === true && <Badge kind="ok">{t('config.tokenSaved')}</Badge>}
|
|
281
|
-
{' '}
|
|
282
|
-
<InfoHint text={t('webdav.usernameHint')} label={t('common.infoHint')} />
|
|
283
281
|
</span>
|
|
284
282
|
<input aria-label={t('webdav.username')}
|
|
285
283
|
type="text"
|
|
@@ -294,11 +292,10 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
294
292
|
/>
|
|
295
293
|
</div>
|
|
296
294
|
<div className={css.field}>
|
|
297
|
-
<span className={css.fieldLabel}>
|
|
295
|
+
<span className={css.fieldLabel} title={t('webdav.passwordHint', { ref: SYNC_WEBDAV_CREDENTIAL_REF })}>
|
|
298
296
|
{t('webdav.password')}
|
|
299
297
|
{' '}
|
|
300
298
|
{statusInfo?.webdav?.passwordConfigured === true && <Badge kind="ok">{t('webdav.passwordSaved')}</Badge>}
|
|
301
|
-
<InfoHint text={t('webdav.passwordHint', { ref: SYNC_WEBDAV_CREDENTIAL_REF })} label={t('common.infoHint')} />
|
|
302
299
|
</span>
|
|
303
300
|
<input aria-label={t('webdav.password')}
|
|
304
301
|
type="password"
|
|
@@ -328,10 +325,9 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
328
325
|
onChange={(next) => { onFormChange({ s3Provider: next }) }}
|
|
329
326
|
options={S3_PROVIDERS.map((p) => ({ value: p, label: t(S3_PROVIDER_LABEL_KEY[p]) }))}
|
|
330
327
|
/>
|
|
331
|
-
<InfoHint text={t('cloud.providerHint')} label={t('common.infoHint')} />
|
|
332
328
|
</div>
|
|
333
329
|
<div className={css.field}>
|
|
334
|
-
<span className={css.fieldLabel}
|
|
330
|
+
<span className={css.fieldLabel} title={t('cloud.endpointHint')}>{t('cloud.endpoint')}</span>
|
|
335
331
|
<input aria-label={t('cloud.endpoint')}
|
|
336
332
|
type="text"
|
|
337
333
|
className={css.input}
|
|
@@ -342,7 +338,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
342
338
|
/>
|
|
343
339
|
</div>
|
|
344
340
|
<div className={css.field}>
|
|
345
|
-
<span className={css.fieldLabel}
|
|
341
|
+
<span className={css.fieldLabel} title={t('cloud.regionHint')}>{t('cloud.region')}</span>
|
|
346
342
|
<input aria-label={t('cloud.region')}
|
|
347
343
|
type="text"
|
|
348
344
|
className={css.input}
|
|
@@ -353,7 +349,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
353
349
|
/>
|
|
354
350
|
</div>
|
|
355
351
|
<div className={css.field}>
|
|
356
|
-
<span className={css.fieldLabel}
|
|
352
|
+
<span className={css.fieldLabel} title={t('cloud.bucketHint')}>{t('cloud.bucket')}</span>
|
|
357
353
|
<input aria-label={t('cloud.bucket')}
|
|
358
354
|
type="text"
|
|
359
355
|
className={css.input}
|
|
@@ -364,7 +360,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
364
360
|
/>
|
|
365
361
|
</div>
|
|
366
362
|
<div className={css.field}>
|
|
367
|
-
<span className={css.fieldLabel}
|
|
363
|
+
<span className={css.fieldLabel} title={t('cloud.prefixHint')}>{t('cloud.prefix')}</span>
|
|
368
364
|
<input aria-label={t('cloud.prefix')}
|
|
369
365
|
type="text"
|
|
370
366
|
className={css.input}
|
|
@@ -375,7 +371,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
375
371
|
/>
|
|
376
372
|
</div>
|
|
377
373
|
<div className={css.field}>
|
|
378
|
-
<span className={css.fieldLabel}
|
|
374
|
+
<span className={css.fieldLabel} title={t('cloud.accessKeyIdHint')}>{t('cloud.accessKeyId')}</span>
|
|
379
375
|
<input aria-label={t('cloud.accessKeyId')}
|
|
380
376
|
type="text"
|
|
381
377
|
className={css.input}
|
|
@@ -386,21 +382,19 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
386
382
|
onChange={(e: ChangeEvent<HTMLInputElement>) => { onFormChange({ s3AccessKeyId: e.target.value }) }}
|
|
387
383
|
/>
|
|
388
384
|
</div>
|
|
389
|
-
<div className={css.controlRow}>
|
|
385
|
+
<div className={css.controlRow} title={t('cloud.pathStyleHint')}>
|
|
390
386
|
<Checkbox
|
|
391
387
|
checked={s3PathStyle}
|
|
392
388
|
disabled={busy}
|
|
393
389
|
label={t('cloud.pathStyle')}
|
|
394
390
|
onChange={(next) => { onFormChange({ s3PathStyle: next }) }}
|
|
395
391
|
/>
|
|
396
|
-
<InfoHint text={t('cloud.pathStyleHint')} label={t('common.infoHint')} />
|
|
397
392
|
</div>
|
|
398
393
|
<div className={css.field}>
|
|
399
|
-
<span className={css.fieldLabel}>
|
|
394
|
+
<span className={css.fieldLabel} title={t('cloud.secretHint', { ref: cloudSecretRef })}>
|
|
400
395
|
{t('cloud.secret')}
|
|
401
396
|
{' '}
|
|
402
397
|
{statusInfo?.s3?.secretStored === true && <Badge kind="ok">{t('cloud.secretSaved')}</Badge>}
|
|
403
|
-
<InfoHint text={t('cloud.secretHint', { ref: cloudSecretRef })} label={t('common.infoHint')} />
|
|
404
398
|
</span>
|
|
405
399
|
<input aria-label={t('cloud.secret')}
|
|
406
400
|
type="password"
|
|
@@ -420,9 +414,9 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
420
414
|
<>
|
|
421
415
|
{/* G-34:gist 刻意不外置 blob(一次 GET 全量 / 单文件超限截断 / 文件数上限)⇒ 大分区不适合走 gist;
|
|
422
416
|
该说明属机制类,收进标题 ⓘ(2026-10-12 用户要求) */}
|
|
423
|
-
<span className={css.groupLabel}
|
|
417
|
+
<span className={css.groupLabel} title={t(GIST_LARGE_SECTION_HINT_KEY)}>{t('cloud.gistTitle')}</span>
|
|
424
418
|
<div className={css.field}>
|
|
425
|
-
<span className={css.fieldLabel}
|
|
419
|
+
<span className={css.fieldLabel} title={t('cloud.gistIdHint')}>{t('cloud.gistId')}</span>
|
|
426
420
|
<input aria-label={t('cloud.gistId')}
|
|
427
421
|
type="text"
|
|
428
422
|
className={css.input}
|
|
@@ -434,7 +428,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
434
428
|
/>
|
|
435
429
|
</div>
|
|
436
430
|
<div className={css.field}>
|
|
437
|
-
<span className={css.fieldLabel}
|
|
431
|
+
<span className={css.fieldLabel} title={t('cloud.apiBaseUrlHint')}>{t('cloud.apiBaseUrl')}</span>
|
|
438
432
|
<input aria-label={t('cloud.apiBaseUrl')}
|
|
439
433
|
type="text"
|
|
440
434
|
className={css.input}
|
|
@@ -445,7 +439,7 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
445
439
|
/>
|
|
446
440
|
</div>
|
|
447
441
|
<div className={css.field}>
|
|
448
|
-
<span className={css.fieldLabel}
|
|
442
|
+
<span className={css.fieldLabel} title={t('cloud.filePrefixHint')}>{t('cloud.filePrefix')}</span>
|
|
449
443
|
<input aria-label={t('cloud.filePrefix')}
|
|
450
444
|
type="text"
|
|
451
445
|
className={css.input}
|
|
@@ -456,11 +450,10 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
456
450
|
/>
|
|
457
451
|
</div>
|
|
458
452
|
<div className={css.field}>
|
|
459
|
-
<span className={css.fieldLabel}>
|
|
453
|
+
<span className={css.fieldLabel} title={t('cloud.tokenHint', { ref: cloudSecretRef })}>
|
|
460
454
|
{t('cloud.token')}
|
|
461
455
|
{' '}
|
|
462
456
|
{statusInfo?.gist?.secretStored === true && <Badge kind="ok">{t('cloud.tokenSaved')}</Badge>}
|
|
463
|
-
<InfoHint text={t('cloud.tokenHint', { ref: cloudSecretRef })} label={t('common.infoHint')} />
|
|
464
457
|
</span>
|
|
465
458
|
<input aria-label={t('cloud.token')}
|
|
466
459
|
type="password"
|
|
@@ -483,20 +476,6 @@ export function ChannelConfigDialog({ open, onClose, api, t, uiT, form, cloudIss
|
|
|
483
476
|
</Banner>
|
|
484
477
|
)}
|
|
485
478
|
|
|
486
|
-
{/* 配置保存:改动自动保存(防抖,静默);按钮立即保存并给出 Toast 回执(announce=true) */}
|
|
487
|
-
<div className={css.actionRow}>
|
|
488
|
-
<Button
|
|
489
|
-
variant="primary"
|
|
490
|
-
loading={savingConfig}
|
|
491
|
-
disabled={busy || !remoteReady}
|
|
492
|
-
onClick={() => { onSave() }}
|
|
493
|
-
>
|
|
494
|
-
{t('config.save')}
|
|
495
|
-
</Button>
|
|
496
|
-
{/* 自动保存的可见回执:改动即存这件事此前完全静默,用户改完字段没有任何反馈 */}
|
|
497
|
-
{savedVisible && <span className={css.savedTick}><Badge kind="ok">{t('config.savedTick')}</Badge></span>}
|
|
498
|
-
<InfoHint text={t('config.saveHint')} label={t('common.infoHint')} />
|
|
499
|
-
</div>
|
|
500
479
|
</Modal.Body>
|
|
501
480
|
</Modal>
|
|
502
481
|
)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* 交互契约(Lead 2026-10-18 冻结):**裁决粒度 = 分区**。
|
|
8
8
|
* 分区卡承载动作按钮(采用本地 / 采用远端 / 采用自动合并),冲突明细只做展示;
|
|
9
|
-
* 因此界面常驻写明「冲突按分区整体裁决(本版不做逐条裁决)」——
|
|
9
|
+
* 因此界面常驻写明「冲突按分区整体裁决(本版不做逐条裁决)」—— 同时挂成工具栏的 `title`,不占正文。
|
|
10
10
|
*
|
|
11
11
|
* 两个按钮口径(2026-10-21 用户裁决后):
|
|
12
12
|
* - **「采用自动合并」只在真有自动合并结果时才出现**(decision === 'merge');
|
|
@@ -25,7 +25,6 @@ import { Badge, Banner, Button, SectionTitle } from '../common/ui.tsx'
|
|
|
25
25
|
import { CheckIcon, RefreshIcon } from '../common/Icon.tsx'
|
|
26
26
|
import { Skeleton } from '../common/Skeleton.tsx'
|
|
27
27
|
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
28
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
29
28
|
import { redact } from '../../security/redaction.ts'
|
|
30
29
|
import type { MergeApplyResponse, MergePreviewResponse, SyncApi } from './sync-api.ts'
|
|
31
30
|
import {
|
|
@@ -88,7 +87,7 @@ export function MergePreviewView({
|
|
|
88
87
|
{showTitle && (
|
|
89
88
|
<SectionTitle
|
|
90
89
|
title={t('merge.title')}
|
|
91
|
-
|
|
90
|
+
tooltip={t('merge.subtitle')}
|
|
92
91
|
/>
|
|
93
92
|
)}
|
|
94
93
|
|
|
@@ -107,7 +106,7 @@ export function MergePreviewView({
|
|
|
107
106
|
{/* 工具栏:批量裁决(一次改全部分区的草稿)+ 重新预览(只读)。
|
|
108
107
|
「全部采用自动合并」「留到下次」只在有意义时出现(见 MERGE_BULK_BUTTONS 的 filter)。 */}
|
|
109
108
|
<div className={css.mergeToolbar}>
|
|
110
|
-
<span className={css.mergeToolbarLabel}>{t('merge.bulk.title')}</span>
|
|
109
|
+
<span className={css.mergeToolbarLabel} title={t('merge.scopeNotice') + ' ' + t('merge.bulk.hint')}>{t('merge.bulk.title')}</span>
|
|
111
110
|
{MERGE_BULK_BUTTONS.filter((btn) => (
|
|
112
111
|
(btn.action !== 'useMerged' || anyMerged) && (btn.action !== 'leavePending' || counts.needsDecision > 0)
|
|
113
112
|
)).map((btn) => (
|
|
@@ -121,7 +120,6 @@ export function MergePreviewView({
|
|
|
121
120
|
</Button>
|
|
122
121
|
))}
|
|
123
122
|
<span className={css.statusSpacer} />
|
|
124
|
-
<InfoHint text={t('merge.scopeNotice') + ' ' + t('merge.bulk.hint')} label={t('common.infoHint')} />
|
|
125
123
|
<Button size="sm" disabled={busy || loading} onClick={onReload}>
|
|
126
124
|
<span className={css.mergeIconLabel}>
|
|
127
125
|
<RefreshIcon size={12} />
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 推送结果弹窗的「分区」段(设计稿 D-12):稿上是「分区名 · 条数」。
|
|
3
|
+
*
|
|
4
|
+
* 宿主 `/sync/push` 只回分区名,条数只能取自**这次推送前**的只读预览(见 SyncPanel 的 runPush):
|
|
5
|
+
* 预览缺失时只显示名称,绝不猜数字。
|
|
6
|
+
*
|
|
7
|
+
* 单独成文件是 t42 物理拆分的延续:SyncPanel 已贴体量棘轮上限
|
|
8
|
+
* (tests/file-size-ratchet.test.ts),新增渲染段一律新开文件。
|
|
9
|
+
*/
|
|
10
|
+
import css from '../config-manager.module.css'
|
|
11
|
+
|
|
12
|
+
export interface PushReportSectionsProps {
|
|
13
|
+
/** 分区 id 列表(顺序即宿主返回顺序)。 */
|
|
14
|
+
sections: readonly string[]
|
|
15
|
+
/** 分区 id → 条数;缺该键时只渲染分区名。 */
|
|
16
|
+
counts: Readonly<Record<string, number>>
|
|
17
|
+
/** 分区 id → 显示名(统一走 common/section-labels.ts)。 */
|
|
18
|
+
sectionName: (id: string) => string
|
|
19
|
+
/** 段标题(字典键由调用方给)。 */
|
|
20
|
+
label: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function PushReportSections({ sections, counts, sectionName, label }: PushReportSectionsProps) {
|
|
24
|
+
return (
|
|
25
|
+
<div>
|
|
26
|
+
<span className={css.fieldLabel}>{label}</span>
|
|
27
|
+
<ul className={css.reportList}>
|
|
28
|
+
{sections.map((id) => {
|
|
29
|
+
const count = counts[id]
|
|
30
|
+
return <li key={id}>{count === undefined ? sectionName(id) : `${sectionName(id)} · ${count}`}</li>
|
|
31
|
+
})}
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
import type { TranslateNS } from '../client-types.ts'
|
|
8
8
|
import { Badge, Button, Card } from '../common/ui.tsx'
|
|
9
9
|
import { ExpandChevron } from '../common/Icon.tsx'
|
|
10
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
11
10
|
import type { SyncStatusResponse } from './sync-api.ts'
|
|
12
11
|
import type { SyncChannel } from './sync-view.ts'
|
|
13
12
|
import { formatSyncStatusTimestamp, formatSyncUrlPreview, workdirStateKey, workdirStateBadgeKind } from '../../ui/sync-settings-view.ts'
|
|
14
13
|
import { needsGitToken, SYNC_CHANNEL_LABEL_KEY } from './sync-view.ts'
|
|
15
14
|
import css from '../config-manager.module.css'
|
|
16
15
|
|
|
17
|
-
/**
|
|
16
|
+
/** 同步通道入口卡:通道名(标题)+ 配置状态 + 状态事实行 + 打开配置弹窗 + 断开该通道配置。 */
|
|
18
17
|
export function SyncChannelEntryCard({ t, channel, statusInfo, remoteReady, repoUrl, webdavUrl, s3Endpoint, gistId, onOpen, onClear, expanded, contentId, onToggleExpanded }: {
|
|
19
18
|
t: TranslateNS<'config-manager-sync'>
|
|
20
19
|
channel: SyncChannel
|
|
@@ -51,10 +50,27 @@ export function SyncChannelEntryCard({ t, channel, statusInfo, remoteReady, repo
|
|
|
51
50
|
: channel === 'gist'
|
|
52
51
|
? gistId
|
|
53
52
|
: repoUrl
|
|
53
|
+
// 未配置 = 矮态单行(UI v2 §2.2-3):通道名 + 未配置徽章 + 配置入口。
|
|
54
|
+
// 三行(标题 / 徽章行 / 按钮行)在四张卡里叠出约 100px 的空骨架,而未配置卡没有任何
|
|
55
|
+
// 可读事实可放 —— 收成一行 ≈56px,四张卡才读得出「哪条没配」。断开与折叠体只属于已配置态。
|
|
56
|
+
if (!remoteReady) {
|
|
57
|
+
return (
|
|
58
|
+
<Card>
|
|
59
|
+
<div className={`${css.cardTitleRow} ${css.channelCompactRow ?? ''}`}>
|
|
60
|
+
<span className={css.groupLabel}>{t(SYNC_CHANNEL_LABEL_KEY[channel])}</span>
|
|
61
|
+
<Badge kind="warn">{t('channel.notConfigured')}</Badge>
|
|
62
|
+
<span className={css.statusSpacer} />
|
|
63
|
+
<Button variant="ghost" size="sm" onClick={onOpen}>
|
|
64
|
+
{t('channel.open')}
|
|
65
|
+
</Button>
|
|
66
|
+
</div>
|
|
67
|
+
</Card>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
54
70
|
return (
|
|
55
71
|
<Card>
|
|
56
72
|
<div className={css.cardTitleRow}>
|
|
57
|
-
<span className={css.groupLabel}>{t(
|
|
73
|
+
<span className={css.groupLabel}>{t(SYNC_CHANNEL_LABEL_KEY[channel])}</span>
|
|
58
74
|
{/* 上次同步是单条事实,贴标题行右端(见 .cardTitleRow 注释) */}
|
|
59
75
|
<span className={css.statusSpacer} />
|
|
60
76
|
<span className={css.factInline}>
|
|
@@ -63,10 +79,7 @@ export function SyncChannelEntryCard({ t, channel, statusInfo, remoteReady, repo
|
|
|
63
79
|
</span>
|
|
64
80
|
</div>
|
|
65
81
|
<div className={css.statRow}>
|
|
66
|
-
<Badge kind="
|
|
67
|
-
<Badge kind={remoteReady ? 'ok' : 'warn'}>
|
|
68
|
-
{remoteReady ? t('channel.configured') : t('channel.notConfigured')}
|
|
69
|
-
</Badge>
|
|
82
|
+
<Badge kind="ok">{t('channel.configured')}</Badge>
|
|
70
83
|
{channel === 'git' && statusInfo?.credentialConfigured === true && (
|
|
71
84
|
<Badge kind="ok">{t('config.tokenSaved')}</Badge>
|
|
72
85
|
)}
|
|
@@ -91,21 +104,19 @@ export function SyncChannelEntryCard({ t, channel, statusInfo, remoteReady, repo
|
|
|
91
104
|
<Badge kind={workdirKind}>{t(workdirKey)}</Badge>
|
|
92
105
|
)}
|
|
93
106
|
</div>
|
|
94
|
-
{/* 远端地址(Workbench
|
|
107
|
+
{/* 远端地址(Workbench:给硬事实)。
|
|
95
108
|
配置状态只由上面那排徽章表达:同一张卡里用「徽章 + 事实行」两处说同一件事,
|
|
96
109
|
用户得比对两遍才知道是不是同一状态。 */}
|
|
97
|
-
{
|
|
98
|
-
<div className={css.
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
<span className={css.
|
|
102
|
-
|
|
103
|
-
{formatSyncUrlPreview(previewRemote)}
|
|
104
|
-
</span>
|
|
110
|
+
<div className={css.factGrid} style={{ marginTop: 8 }}>
|
|
111
|
+
<div className={css.factCell}>
|
|
112
|
+
<span className={css.factLabel}>{t('channel.currentUrl')}</span>
|
|
113
|
+
<span className={css.factValue}>
|
|
114
|
+
<span className={css.mono}>
|
|
115
|
+
{formatSyncUrlPreview(previewRemote)}
|
|
105
116
|
</span>
|
|
106
|
-
</
|
|
117
|
+
</span>
|
|
107
118
|
</div>
|
|
108
|
-
|
|
119
|
+
</div>
|
|
109
120
|
<div className={css.actionRowTop}>
|
|
110
121
|
{/* ghost 而不是 primary(2026-11-01):本页唯一的主行动是「把本地改动推上去 /
|
|
111
122
|
把远端拉下来」,而那是下方 pickSyncPrimary 决定的那颗按钮。
|
|
@@ -113,13 +124,11 @@ export function SyncChannelEntryCard({ t, channel, statusInfo, remoteReady, repo
|
|
|
113
124
|
<Button variant="ghost" onClick={onOpen}>
|
|
114
125
|
{t('channel.open')}
|
|
115
126
|
</Button>
|
|
116
|
-
{/*
|
|
127
|
+
{/* 断开出口:走到这里的通道都已配置(未配置在上方早退),所以恒有可断开的东西。
|
|
117
128
|
危险操作用 danger 变体 + ConfirmDialog 二次确认(DESIGN.md §8.11)。 */}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
</Button>
|
|
122
|
-
)}
|
|
129
|
+
<Button variant="danger" onClick={onClear}>
|
|
130
|
+
{t('channel.clear')}
|
|
131
|
+
</Button>
|
|
123
132
|
{onToggleExpanded !== undefined && (
|
|
124
133
|
<>
|
|
125
134
|
<span className={css.statusSpacer} />
|
|
@@ -184,7 +184,7 @@ export function SyncConfirmView(props: SyncConfirmViewProps): ReactNode {
|
|
|
184
184
|
}
|
|
185
185
|
} catch (err) {
|
|
186
186
|
setPhase('failed');
|
|
187
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
187
|
+
setError(redact(err instanceof Error ? err.message : String(err)));
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
|
|
@@ -220,7 +220,7 @@ export function SyncConfirmView(props: SyncConfirmViewProps): ReactNode {
|
|
|
220
220
|
}
|
|
221
221
|
} catch (err) {
|
|
222
222
|
setPhase('failed');
|
|
223
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
223
|
+
setError(redact(err instanceof Error ? err.message : String(err)));
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
|
|
@@ -490,7 +490,7 @@ function ApplyResultCard({ result, busy, t, onRollback }: ApplyResultCardProps):
|
|
|
490
490
|
<div>
|
|
491
491
|
<span className={css.fieldLabel}>{t('syncflow.importWarnings')}</span>
|
|
492
492
|
<ul className={css.warnList}>
|
|
493
|
-
{result.warnings.map((w, i) => <li key={i}>{w}</li>)}
|
|
493
|
+
{result.warnings.map((w, i) => <li key={i}>{redact(w)}</li>)}
|
|
494
494
|
</ul>
|
|
495
495
|
</div>
|
|
496
496
|
)}
|
|
@@ -20,7 +20,8 @@ import {
|
|
|
20
20
|
projectSyncHistoryEntries, summarizeSyncHistory,
|
|
21
21
|
} from './history-model.ts'
|
|
22
22
|
import type { TranslateNS } from '../client-types.ts'
|
|
23
|
-
import { Badge, Card, SectionTitle } from '../common/ui.tsx'
|
|
23
|
+
import { Badge, Button, Card, SectionTitle } from '../common/ui.tsx'
|
|
24
|
+
import { RefreshIcon } from '../common/Icon.tsx'
|
|
24
25
|
import { SkeletonTable } from '../common/Skeleton.tsx'
|
|
25
26
|
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
26
27
|
import css from '../config-manager.module.css'
|
|
@@ -34,7 +35,7 @@ export function SyncLogList({ api, t }: SyncLogListProps): ReactNode {
|
|
|
34
35
|
const [loading, setLoading] = useState(true)
|
|
35
36
|
const [error, setError] = useState<string | null>(null)
|
|
36
37
|
const [entries, setEntries] = useState<SyncHistoryEntry[]>([])
|
|
37
|
-
/**
|
|
38
|
+
/** 重载计数(错误态「重试」与卡头「刷新」都递增 → 重新拉一次 /sync/history) */
|
|
38
39
|
const [reloadKey, setReloadKey] = useState(0)
|
|
39
40
|
|
|
40
41
|
useEffect(() => {
|
|
@@ -61,7 +62,8 @@ export function SyncLogList({ api, t }: SyncLogListProps): ReactNode {
|
|
|
61
62
|
const rows = useMemo(() => projectSyncHistoryEntries(entries), [entries])
|
|
62
63
|
const stats = useMemo(() => summarizeSyncHistory(rows), [rows])
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
// 骨架只在「还没有任何行」时占位:手动刷新不该把整张卡换成骨架(用户会以为列表没了)
|
|
66
|
+
if (loading && entries.length === 0) return <SkeletonTable label={t('common.loading')} />
|
|
65
67
|
if (error !== null) {
|
|
66
68
|
return (
|
|
67
69
|
<ErrorBanner
|
|
@@ -85,7 +87,14 @@ export function SyncLogList({ api, t }: SyncLogListProps): ReactNode {
|
|
|
85
87
|
<Card>
|
|
86
88
|
{/* 条数只在下面那排统计徽章里给一次:标题里的 (12) 与「共 12 条」是同一个数,
|
|
87
89
|
两处并列时用户要先比对才敢确定它们说的是同一件事 */}
|
|
88
|
-
|
|
90
|
+
{/* 刷新走 SectionTitle 的 action 槽:它渲在标题同一行的右侧(内部自带推右的 spacer),
|
|
91
|
+
垂直居中跟标题一致。 */}
|
|
92
|
+
<SectionTitle
|
|
93
|
+
title={t('history.title')}
|
|
94
|
+
action={<Button size="sm" loading={loading} onClick={() => { setReloadKey((k) => k + 1) }}>
|
|
95
|
+
<RefreshIcon size={12} />{' '}{t('history.refresh')}
|
|
96
|
+
</Button>}
|
|
97
|
+
/>
|
|
89
98
|
{/* 头部统计摘要(先扫结论);失败/跳过仅在存在时出现,并给语义色 */}
|
|
90
99
|
<div className={css.statRow} aria-label={t('history.stats.summary')}>
|
|
91
100
|
<Badge kind="info">{t('history.stats.total', { count: String(stats.total) })}</Badge>
|
|
@@ -197,9 +206,11 @@ function AutosyncRow({ entry, t }: { entry: AutosyncHistoryEntry; t: TranslateNS
|
|
|
197
206
|
)
|
|
198
207
|
}
|
|
199
208
|
|
|
200
|
-
/** 通道徽章:git → GitHub,webdav → WebDAV;未知/缺失不渲染(不猜)。 */
|
|
209
|
+
/** 通道徽章:git → GitHub,webdav → WebDAV,s3 → S3,gist → Gist;未知/缺失不渲染(不猜)。 */
|
|
201
210
|
function ChannelBadge({ transport, t }: { transport?: string; t: TranslateNS<'config-manager-sync'> }): ReactNode {
|
|
202
211
|
if (transport === 'git') return <Badge kind="info">{t('history.channelGit')}</Badge>
|
|
203
212
|
if (transport === 'webdav') return <Badge kind="info">{t('history.channelWebdav')}</Badge>
|
|
213
|
+
if (transport === 's3') return <Badge kind="info">{t('history.channelS3')}</Badge>
|
|
214
|
+
if (transport === 'gist') return <Badge kind="info">{t('history.channelGist')}</Badge>
|
|
204
215
|
return null
|
|
205
216
|
}
|