@michengai/dsh-archive-manager 1.2.8 → 1.3.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/CHANGELOG.md +14 -0
- package/CHANGELOG.zh-CN.md +14 -0
- package/README.de.md +233 -0
- package/README.en.md +12 -15
- package/README.es.md +233 -0
- package/README.fr.md +233 -0
- package/README.ja.md +239 -0
- package/README.md +12 -15
- package/README.pt.md +233 -0
- package/README.ru.md +27 -9
- package/README.zh-CN.md +12 -15
- package/lib/client.js +5 -9
- package/lib/sidebar-entry.js +1 -91
- package/locale/de.json +7 -0
- package/locale/en.json +2 -1
- package/locale/es.json +7 -0
- package/locale/fr.json +7 -0
- package/locale/ja.json +7 -0
- package/locale/pt.json +7 -0
- package/locale/ru.json +2 -1
- package/locale/zh.json +2 -1
- package/package.json +12 -1
package/lib/sidebar-entry.js
CHANGED
|
@@ -80,28 +80,6 @@ function ArchiveBundleConfigCard(props) {
|
|
|
80
80
|
})
|
|
81
81
|
)
|
|
82
82
|
];
|
|
83
|
-
if (typeof onToggleOnlineUpdate === "function") {
|
|
84
|
-
const updateDesc = onlineUpdateLocked ? `${t("update.entry.desc")} (${t("update.entry.locked")})` : t("update.entry.desc");
|
|
85
|
-
rows.push(
|
|
86
|
-
h(
|
|
87
|
-
"div",
|
|
88
|
-
{ key: "online-update", className: "dsham_bundle_row" },
|
|
89
|
-
h(
|
|
90
|
-
"div",
|
|
91
|
-
{ className: "dsham_bundle_label_box" },
|
|
92
|
-
h("span", { className: "dsham_bundle_title" }, t("update.entry.title")),
|
|
93
|
-
h("span", { className: "dsham_bundle_desc" }, updateDesc)
|
|
94
|
-
),
|
|
95
|
-
h(PrimitiveSwitch, {
|
|
96
|
-
checked: onlineUpdateEnabled,
|
|
97
|
-
onChange: onToggleOnlineUpdate,
|
|
98
|
-
label: t("update.entry.toggle"),
|
|
99
|
-
disabled: onlineUpdateDisabled || onlineUpdateLocked,
|
|
100
|
-
title: onlineUpdateLocked ? t("update.entry.locked") : void 0
|
|
101
|
-
})
|
|
102
|
-
)
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
83
|
if (typeof onToggleSidebarFavoriteStar === "function") {
|
|
106
84
|
rows.push(
|
|
107
85
|
h(
|
|
@@ -126,23 +104,14 @@ function ArchiveBundleConfigCard(props) {
|
|
|
126
104
|
}
|
|
127
105
|
function ArchiveBundleConfigCardWrapper(props) {
|
|
128
106
|
const [location, setLocation] = React.useState(props.getLocation);
|
|
129
|
-
const [onlineUpdateEnabled, setOnlineUpdateEnabled] = React.useState(props.getOnlineUpdateEnabled ? props.getOnlineUpdateEnabled : () => true);
|
|
130
|
-
const [onlineUpdateLocked, setOnlineUpdateLocked] = React.useState(props.getOnlineUpdateLocked ? props.getOnlineUpdateLocked : () => false);
|
|
131
107
|
const [sidebarFavoriteStarEnabled, setSidebarFavoriteStarEnabled] = React.useState(props.getSidebarFavoriteStarEnabled ? props.getSidebarFavoriteStarEnabled : () => true);
|
|
132
108
|
const [saveError, setSaveError] = React.useState(null);
|
|
133
109
|
const [savingLocation, setSavingLocation] = React.useState(false);
|
|
134
|
-
const [savingUpdate, setSavingUpdate] = React.useState(false);
|
|
135
110
|
const [savingFavoriteStar, setSavingFavoriteStar] = React.useState(false);
|
|
136
111
|
React.useEffect(() => {
|
|
137
112
|
const syncState = () => {
|
|
138
113
|
setLocation(props.getLocation());
|
|
139
114
|
setSaveError(null);
|
|
140
|
-
if (props.getOnlineUpdateEnabled) {
|
|
141
|
-
setOnlineUpdateEnabled(props.getOnlineUpdateEnabled());
|
|
142
|
-
}
|
|
143
|
-
if (props.getOnlineUpdateLocked) {
|
|
144
|
-
setOnlineUpdateLocked(props.getOnlineUpdateLocked());
|
|
145
|
-
}
|
|
146
115
|
if (props.getSidebarFavoriteStarEnabled) {
|
|
147
116
|
setSidebarFavoriteStarEnabled(props.getSidebarFavoriteStarEnabled());
|
|
148
117
|
}
|
|
@@ -162,18 +131,6 @@ function ArchiveBundleConfigCardWrapper(props) {
|
|
|
162
131
|
setSavingLocation(false);
|
|
163
132
|
});
|
|
164
133
|
};
|
|
165
|
-
const onToggleOnlineUpdate = props.setOnlineUpdate ? (next) => {
|
|
166
|
-
if (props.getOnlineUpdateLocked?.()) return;
|
|
167
|
-
setSavingUpdate(true);
|
|
168
|
-
setOnlineUpdateEnabled(next);
|
|
169
|
-
props.setOnlineUpdate(next).catch(() => {
|
|
170
|
-
if (props.getOnlineUpdateEnabled) {
|
|
171
|
-
setOnlineUpdateEnabled(props.getOnlineUpdateEnabled());
|
|
172
|
-
}
|
|
173
|
-
}).finally(() => {
|
|
174
|
-
setSavingUpdate(false);
|
|
175
|
-
});
|
|
176
|
-
} : void 0;
|
|
177
134
|
const onToggleSidebarFavoriteStar = props.setSidebarFavoriteStar ? (next) => {
|
|
178
135
|
setSavingFavoriteStar(true);
|
|
179
136
|
setSidebarFavoriteStarEnabled(next);
|
|
@@ -191,10 +148,6 @@ function ArchiveBundleConfigCardWrapper(props) {
|
|
|
191
148
|
errorMessage: saveError,
|
|
192
149
|
disabled: savingLocation,
|
|
193
150
|
onLocationChange,
|
|
194
|
-
onlineUpdateEnabled,
|
|
195
|
-
onlineUpdateDisabled: savingUpdate || onlineUpdateLocked,
|
|
196
|
-
onlineUpdateLocked,
|
|
197
|
-
onToggleOnlineUpdate,
|
|
198
151
|
sidebarFavoriteStarEnabled,
|
|
199
152
|
sidebarFavoriteStarDisabled: savingFavoriteStar,
|
|
200
153
|
onToggleSidebarFavoriteStar
|
|
@@ -343,10 +296,8 @@ function setupSidebarEntry(ctx, options) {
|
|
|
343
296
|
};
|
|
344
297
|
let onlineUpdateEnabled = true;
|
|
345
298
|
let onlineUpdateLocked = false;
|
|
346
|
-
let updateEpoch = 0;
|
|
347
299
|
const setOnlineUpdate = async (next) => {
|
|
348
300
|
if (destroyed || onlineUpdateLocked) return onlineUpdateEnabled;
|
|
349
|
-
const currentEpoch = ++updateEpoch;
|
|
350
301
|
onlineUpdateEnabled = next;
|
|
351
302
|
notify();
|
|
352
303
|
if (typeof options.onOnlineUpdateChange === "function") {
|
|
@@ -355,32 +306,7 @@ function setupSidebarEntry(ctx, options) {
|
|
|
355
306
|
} catch {
|
|
356
307
|
}
|
|
357
308
|
}
|
|
358
|
-
|
|
359
|
-
await callApi("/online-update", {
|
|
360
|
-
method: "POST",
|
|
361
|
-
headers: { "content-type": "application/json" },
|
|
362
|
-
body: JSON.stringify({ enabled: next })
|
|
363
|
-
});
|
|
364
|
-
if (currentEpoch === updateEpoch && typeof options.onOnlineUpdateChange === "function") {
|
|
365
|
-
try {
|
|
366
|
-
options.onOnlineUpdateChange(next);
|
|
367
|
-
} catch {
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
return next;
|
|
371
|
-
} catch (err) {
|
|
372
|
-
if (currentEpoch === updateEpoch) {
|
|
373
|
-
onlineUpdateEnabled = !next;
|
|
374
|
-
notify();
|
|
375
|
-
if (typeof options.onOnlineUpdateChange === "function") {
|
|
376
|
-
try {
|
|
377
|
-
options.onOnlineUpdateChange(!next);
|
|
378
|
-
} catch {
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
throw err;
|
|
383
|
-
}
|
|
309
|
+
return next;
|
|
384
310
|
};
|
|
385
311
|
let sidebarFavoriteStarEnabled = true;
|
|
386
312
|
let favoriteStarEpoch = 0;
|
|
@@ -435,21 +361,6 @@ function setupSidebarEntry(ctx, options) {
|
|
|
435
361
|
}
|
|
436
362
|
}).catch(() => {
|
|
437
363
|
});
|
|
438
|
-
const loadUpdateEpoch = updateEpoch;
|
|
439
|
-
callApi("/online-update").then((res) => {
|
|
440
|
-
if (!destroyed && updateEpoch === loadUpdateEpoch && res && typeof res.enabled === "boolean") {
|
|
441
|
-
onlineUpdateEnabled = res.enabled;
|
|
442
|
-
if (res.locked === true) onlineUpdateLocked = true;
|
|
443
|
-
notify();
|
|
444
|
-
if (typeof options.onOnlineUpdateChange === "function") {
|
|
445
|
-
try {
|
|
446
|
-
options.onOnlineUpdateChange(onlineUpdateEnabled);
|
|
447
|
-
} catch {
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}).catch(() => {
|
|
452
|
-
});
|
|
453
364
|
const loadFavoriteStarEpoch = favoriteStarEpoch;
|
|
454
365
|
callApi("/sidebar-favorite-star").then((res) => {
|
|
455
366
|
if (!destroyed && favoriteStarEpoch === loadFavoriteStarEpoch && res && typeof res.enabled === "boolean") {
|
|
@@ -532,7 +443,6 @@ function setupSidebarEntry(ctx, options) {
|
|
|
532
443
|
if (destroyed) return;
|
|
533
444
|
destroyed = true;
|
|
534
445
|
epoch++;
|
|
535
|
-
updateEpoch++;
|
|
536
446
|
favoriteStarEpoch++;
|
|
537
447
|
layoutService = void 0;
|
|
538
448
|
listeners.clear();
|
package/locale/de.json
ADDED
package/locale/en.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Archive Manager",
|
|
4
|
-
"description": "Archive, restore, favorite, and permanently delete sessions, and diagnose damaged session logs."
|
|
4
|
+
"description": "Archive, restore, favorite, and permanently delete sessions, and diagnose damaged session logs.",
|
|
5
|
+
"detail": "README.en.md"
|
|
5
6
|
}
|
|
6
7
|
}
|
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Archive Manager",
|
|
4
|
-
"description": "Архивируйте, восстанавливайте, добавляйте в избранное и окончательно удаляйте сессии, а также диагностируйте повреждённые журналы сессий."
|
|
4
|
+
"description": "Архивируйте, восстанавливайте, добавляйте в избранное и окончательно удаляйте сессии, а также диагностируйте повреждённые журналы сессий.",
|
|
5
|
+
"detail": "README.ru.md"
|
|
5
6
|
}
|
|
6
7
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-archive-manager",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "归档、恢复、收藏和永久删除会话,并诊断损坏的会话日志。 · Archive, restore, favorite, and permanently delete sessions, and diagnose damaged session logs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"./projcache": "./lib/projcache.js",
|
|
16
16
|
"./host": "./lib/host-install.js",
|
|
17
17
|
"./client": "./lib/client.js",
|
|
18
|
+
"./icon": "./assets/icon.svg",
|
|
18
19
|
"./package.json": "./package.json",
|
|
19
20
|
"./locale/*.json": "./locale/*.json"
|
|
20
21
|
},
|
|
@@ -25,7 +26,12 @@
|
|
|
25
26
|
"cordis.patch.yml",
|
|
26
27
|
"README.md",
|
|
27
28
|
"README.en.md",
|
|
29
|
+
"README.ja.md",
|
|
30
|
+
"README.es.md",
|
|
31
|
+
"README.fr.md",
|
|
32
|
+
"README.de.md",
|
|
28
33
|
"README.ru.md",
|
|
34
|
+
"README.pt.md",
|
|
29
35
|
"README.zh-CN.md",
|
|
30
36
|
"LICENSE",
|
|
31
37
|
"CHANGELOG.md",
|
|
@@ -106,7 +112,9 @@
|
|
|
106
112
|
"zustand": "4.4.7"
|
|
107
113
|
},
|
|
108
114
|
"license": "Apache-2.0",
|
|
115
|
+
"author": "MichengAI",
|
|
109
116
|
"dsh": {
|
|
117
|
+
"manifestVersion": 1,
|
|
110
118
|
"bundle": {
|
|
111
119
|
"patch": "./cordis.patch.yml"
|
|
112
120
|
},
|
|
@@ -136,6 +144,9 @@
|
|
|
136
144
|
"dsh-plugin",
|
|
137
145
|
"archive",
|
|
138
146
|
"session-management",
|
|
147
|
+
"diagnose",
|
|
148
|
+
"favorites",
|
|
149
|
+
"restore",
|
|
139
150
|
"cordis",
|
|
140
151
|
"typert",
|
|
141
152
|
"workspace",
|