Skip to content

Commit d8287b1

Browse files
committed
fix: fix some issue
1 parent 56145ac commit d8287b1

14 files changed

Lines changed: 437 additions & 114 deletions

File tree

i18n/locales/en.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"General": "General",
2727
"ChooseColor": "Choose color",
2828
"OpenWith": "Open with",
29+
"OperationFailed": "Operation failed",
2930
"EmptyDescription": "No authorized assets are available for the current type",
3031
"SelectFromMenu": "Select an item on the left"
3132
},
@@ -61,7 +62,6 @@
6162
"Resource": "Resource",
6263
"Database": "Database",
6364
"Web": "Web",
64-
"Tool": "Tools",
6565
"Transcode": "Replay Transcode",
6666
"OfflinePlayer": "Offline Player",
6767
"Favorite": "Favorite"
@@ -77,6 +77,7 @@
7777
"CompletedCount": "Completed {completed}/{total}",
7878
"InProgress": "Processing {processing}/{total}",
7979
"NotStarted": "Not started",
80+
"Elapsed": "Elapsed {duration}",
8081
"ArchivesTitle": "Replay archives",
8182
"ArchivesHint": "Single and multiple selection are both supported, and you can append more archives later.",
8283
"SelectArchives": "Add archives",
@@ -148,6 +149,32 @@
148149
"PowerMedium": "Medium (1/2 CPU)",
149150
"PowerLow": "Low (1/4 CPU)"
150151
},
152+
"VideoPlayer": {
153+
"ImportingFiles": "Importing {count} file(s)…",
154+
"NoPlayableFilesTitle": "No playable files found",
155+
"NoPlayableFilesDescription": "Import mp4, cast.gz, replay.gz, part.gz, or a tar archive containing these files.",
156+
"DuplicatesSkippedTitle": "Some files were skipped",
157+
"DuplicatesSkippedDescription": "{count} item(s) with the same name already exist and were not imported again.",
158+
"ImportFailed": "Import failed",
159+
"SwitchToLight": "Switch to light mode",
160+
"SwitchToDark": "Switch to dark mode",
161+
"ImportRecording": "Import recording files",
162+
"DropToImport": "Drop files to import recordings",
163+
"DropzoneHint": "Drag or select `.mp4`, `.gz`, or `.tar` files.",
164+
"SelectFiles": "Select files",
165+
"Playlist": "Playlist",
166+
"EmptyPlaylist": "No playable segments",
167+
"EmptyPlaylistDescription": "Imported recording segments will appear here.",
168+
"AddRecording": "Add recording",
169+
"Account": "Account",
170+
"User": "User",
171+
"Protocol": "Protocol",
172+
"StartTime": "Start time",
173+
"TotalDuration": "Total duration",
174+
"Segment": "Segment",
175+
"SegmentProgress": "Segment {index} / {total}",
176+
"ParsingRecording": "Parsing recording…"
177+
},
151178
"AssetCard": {
152179
"Activated": "Activated",
153180
"Deactivated": "Deactivated",
@@ -181,6 +208,18 @@
181208
"ConnectMethod": "Connect Method",
182209
"OptionalAccount": "Account"
183210
},
211+
"ConnectMethod": {
212+
"ssh_client": "SSH Client",
213+
"sftp_client": "SFTP Client",
214+
"rdp_client": "RDP Client",
215+
"vnc_client": "VNC Client",
216+
"db_client": "Database Client",
217+
"builtin_client": "Built-in Terminal",
218+
"chrome": "Chrome"
219+
},
220+
"SettingModal": {
221+
"Description": "Connection settings configure the default application used for subsequent connections"
222+
},
184223
"Layout": {
185224
"Grid": "Grid View",
186225
"Table": "Table View"

i18n/locales/zh.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"General": "通用",
2727
"ChooseColor": "选择颜色",
2828
"OpenWith": "应用配置",
29+
"OperationFailed": "操作失败",
2930
"EmptyDescription": "当前类型下暂无可用的授权资产",
3031
"SelectFromMenu": "请从左侧选择一个配置项"
3132
},
@@ -61,7 +62,6 @@
6162
"Other": "其他",
6263
"Tool": "工具",
6364
"Favorite": "收藏",
64-
"Tool": "工具",
6565
"Transcode": "录像转码",
6666
"OfflinePlayer": "离线播放器",
6767
"Player": "播放器"
@@ -77,6 +77,7 @@
7777
"CompletedCount": "已完成 {completed}/{total}",
7878
"InProgress": "处理中 {processing}/{total}",
7979
"NotStarted": "尚未开始",
80+
"Elapsed": "耗时 {duration}",
8081
"ArchivesTitle": "录像转码任务",
8182
"ArchivesHint": "支持单选或多选,可继续追加录像文件。",
8283
"SelectArchives": "添加文件",
@@ -148,6 +149,32 @@
148149
"PowerMedium": "中等(1/2 CPU)",
149150
"PowerLow": "低速(1/4 CPU)"
150151
},
152+
"VideoPlayer": {
153+
"ImportingFiles": "正在导入 {count} 个文件…",
154+
"NoPlayableFilesTitle": "未识别到可播放文件",
155+
"NoPlayableFilesDescription": "请导入 mp4、cast.gz、replay.gz、part.gz 或包含这些文件的 tar 包。",
156+
"DuplicatesSkippedTitle": "部分文件已跳过",
157+
"DuplicatesSkippedDescription": "有 {count} 个同名条目已存在,未重复导入。",
158+
"ImportFailed": "导入失败",
159+
"SwitchToLight": "切换浅色模式",
160+
"SwitchToDark": "切换暗色模式",
161+
"ImportRecording": "导入录像文件",
162+
"DropToImport": "松开即可导入录像文件",
163+
"DropzoneHint": "支持拖入或选择 `.mp4`、`.gz`、`.tar` 文件。",
164+
"SelectFiles": "选择文件",
165+
"Playlist": "播放列表",
166+
"EmptyPlaylist": "暂无播放片段",
167+
"EmptyPlaylistDescription": "导入录像后,这里会显示可切换的片段列表。",
168+
"AddRecording": "添加录像",
169+
"Account": "账号",
170+
"User": "用户",
171+
"Protocol": "协议",
172+
"StartTime": "开始时间",
173+
"TotalDuration": "总时长",
174+
"Segment": "片段",
175+
"SegmentProgress": "片段 {index} / {total}",
176+
"ParsingRecording": "正在解析录像…"
177+
},
151178
"AssetCard": {
152179
"Activated": "已激活",
153180
"Deactivated": "未激活",
@@ -181,6 +208,15 @@
181208
"ConnectMethod": "连接方法",
182209
"OptionalAccount": "账号"
183210
},
211+
"ConnectMethod": {
212+
"ssh_client": "SSH 客户端",
213+
"sftp_client": "SFTP 客户端",
214+
"rdp_client": "RDP 客户端",
215+
"vnc_client": "VNC 客户端",
216+
"db_client": "数据库客户端",
217+
"builtin_client": "内置终端",
218+
"chrome": "Chrome"
219+
},
184220
"SettingModal": {
185221
"Description": "连接设置用于配置后续连接中默认启动的应用程序"
186222
},

src-tauri/tauri.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"height": 600,
6868
"minWidth": 800,
6969
"minHeight": 480,
70+
"dragDropEnabled": false,
7071
"resizable": true,
7172
"fullscreen": false,
7273
"transparent": false,

src-tauri/windows/hooks.nsh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,24 @@
2828
; 通知 Windows shell 协议关联已经变化,避免卸载后继续使用旧缓存。
2929
System::Call 'shell32::SHChangeNotify(i, i, p, p) (0x08000000, 0x1000, 0, 0)'
3030
!macroend
31+
32+
!macro NSIS_HOOK_POSTUNINSTALL
33+
; Tauri 的更新器会以 /UPDATE 调用旧版卸载器,此时同样会执行本 hook。
34+
; 只在用户真正卸载时删除数据,避免升级过程丢失配置、日志和插件。
35+
${If} $UpdateMode <> 1
36+
; installMode="both" 可能会将 shell 上下文切到 all,用户数据始终属于当前用户。
37+
SetShellVarContext current
38+
39+
; Tauri 自身的 app data/store/video 目录。
40+
RMDir /r "$APPDATA\${BUNDLEID}"
41+
RMDir /r "$LOCALAPPDATA\${BUNDLEID}"
42+
43+
; JumpServer 配置、日志和用户插件使用的自定义目录。
44+
RMDir /r "$APPDATA\jumpserver-client"
45+
RMDir /r "$LOCALAPPDATA\jumpserver-client"
46+
47+
; 兼容旧版本使用产品名创建的用户数据目录。
48+
RMDir /r "$APPDATA\JumpServerClient"
49+
RMDir /r "$LOCALAPPDATA\JumpServerClient"
50+
${EndIf}
51+
!macroend

ui/components/EditForm/editForm.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const emits = defineEmits<{
2626
(e: "update:connectMethod", v: string): void
2727
}>();
2828
29-
const { t } = useI18n();
29+
const { t, te } = useI18n();
3030
const { getMethodsForProtocol, getDefaultMethodForProtocol } = useConnectMethods();
3131
// prettier-ignore
3232
const trailingIcon = "group-data-[state=open]:rotate-180 transition-transform duration-200";
@@ -36,11 +36,16 @@ const showDynamicUserArea = ref(false);
3636
const availableConnectMethods = ref<any[]>([]);
3737
const connectMethodItems = computed<SelectMenuItem[]>(() => {
3838
return availableConnectMethods.value.map((method) => ({
39-
label: method.label || method.value,
39+
label: getConnectMethodLabel(method),
4040
value: method.value
4141
}));
4242
});
4343
44+
function getConnectMethodLabel(method: { label?: string, value: string }) {
45+
const key = `ConnectMethod.${method.value}`;
46+
return te(key) ? t(key) : method.label || method.value;
47+
}
48+
4449
const localManualUsername = computed<string>({
4550
get: () => props.manualUsername || "",
4651
set: (v: string) => emits("update:manualUsername", v ?? "")

ui/components/SideBar/profile.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,12 @@ const selectedAppearance = computed<ThemeType>({
157157
set: (id: ThemeType) => {
158158
if (id === "withSystem") {
159159
void enableFollowSystem().then(() => {
160-
useTauriEventEmit("theme-changed", { mode: "withSystem" });
161160
nextTick().then(() => applyCurrentThemeColor(true));
162161
});
163162
return;
164163
}
165164
166165
manualSetTheme(id as any);
167-
useTauriEventEmit("theme-changed", { mode: id });
168166
nextTick().then(() => applyCurrentThemeColor(true));
169167
}
170168
});
@@ -320,6 +318,8 @@ async function openToolWindow(
320318
minHeight,
321319
hiddenTitle: true,
322320
titleBarStyle: "overlay",
321+
// Tauri's native handler must be disabled so UFileUpload receives HTML5 drag/drop events.
322+
dragDropEnabled: false,
323323
trafficLightPosition: new LogicalPosition(10, 22),
324324
decorations: useNativeWindowFrame,
325325
shadow: useNativeWindowFrame
@@ -728,7 +728,7 @@ onMounted(async () => {
728728
let description = message || t("Login.LoginFailedErrorPage");
729729
730730
if (reason === "invalid-site") {
731-
description = t(" ");
731+
description = t("Login.InvalidSiteError");
732732
}
733733
734734
toast.add({

0 commit comments

Comments
 (0)