@gkd-kit/inspect 0.0.1701404525886 → 0.0.1701678184497
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/dist/404.html +7 -7
- package/dist/assets/ActionCard.vue_vue_type_script_setup_true_lang-bda27d9e.js +1388 -0
- package/dist/assets/DevicePage-fee3235d.js +457 -0
- package/dist/assets/HomePage-5632f622.js +400 -0
- package/dist/assets/ImportPage-21674b0a.js +87 -0
- package/dist/assets/SnapshotPage-3157f92e.js +3629 -0
- package/dist/assets/SnapshotPage-3c2cecee.css +8 -0
- package/dist/assets/_404Page-09910a83.js +32 -0
- package/dist/assets/_404Page-1bb368b2.css +9 -0
- package/dist/assets/import-1c0da893.js +288 -0
- package/dist/assets/index-235f5a3e.js +21365 -0
- package/dist/assets/index-2bb4cdf2.js +9780 -0
- package/dist/assets/index-50ce64aa.css +360 -0
- package/dist/assets/jszip.min-9f22f6d7.js +2651 -0
- package/dist/assets/node-c1756ecf.js +7817 -0
- package/dist/assets/polyfills-bdd638aa.js +11381 -0
- package/dist/assets/storage-00dd3e29.js +4479 -0
- package/dist/assets/table-ad72f278.js +8763 -0
- package/dist/index.html +7 -7
- package/package.json +25 -26
- package/dist/assets/ActionCard.vue_vue_type_script_setup_true_lang-b803bcbc.js +0 -10
- package/dist/assets/ActionCard.vue_vue_type_script_setup_true_lang-b803bcbc.js.map +0 -1
- package/dist/assets/DevicePage-2982dba9.js +0 -4
- package/dist/assets/DevicePage-2982dba9.js.map +0 -1
- package/dist/assets/HomePage-d2b7a174.js +0 -10
- package/dist/assets/HomePage-d2b7a174.js.map +0 -1
- package/dist/assets/ImportPage-42983845.js +0 -2
- package/dist/assets/ImportPage-42983845.js.map +0 -1
- package/dist/assets/SnapshotPage-37def4f3.js +0 -241
- package/dist/assets/SnapshotPage-37def4f3.js.map +0 -1
- package/dist/assets/SnapshotPage-49b5182f.css +0 -1
- package/dist/assets/_404Page-2ece9679.css +0 -1
- package/dist/assets/_404Page-d7737f5c.js +0 -2
- package/dist/assets/_404Page-d7737f5c.js.map +0 -1
- package/dist/assets/_plugin-vue_export-helper-c27b6911.js +0 -2
- package/dist/assets/_plugin-vue_export-helper-c27b6911.js.map +0 -1
- package/dist/assets/check-44032eaf.js +0 -2
- package/dist/assets/check-44032eaf.js.map +0 -1
- package/dist/assets/import-a5cc70a1.js +0 -2
- package/dist/assets/import-a5cc70a1.js.map +0 -1
- package/dist/assets/index-4b0effd3.js +0 -558
- package/dist/assets/index-4b0effd3.js.map +0 -1
- package/dist/assets/index-5093d345.css +0 -1
- package/dist/assets/index-f152e873.js +0 -17
- package/dist/assets/index-f152e873.js.map +0 -1
- package/dist/assets/jszip.min-f013cbb4.js +0 -13
- package/dist/assets/jszip.min-f013cbb4.js.map +0 -1
- package/dist/assets/node-781d54ba.js +0 -731
- package/dist/assets/node-781d54ba.js.map +0 -1
- package/dist/assets/polyfills-f223ca2c.js +0 -1
- package/dist/assets/storage-31afdb2c.js +0 -330
- package/dist/assets/storage-31afdb2c.js.map +0 -1
- package/dist/assets/table-0978d0a2.js +0 -958
- package/dist/assets/table-0978d0a2.js.map +0 -1
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { d as defineComponent, s as shallowRef, a as shallowReactive, c as computed, w as watchEffect, r as reactive, b as createVNode, e as watch, f as createElementBlock, g as withCtx, u as unref, h as createBaseVNode, F as Fragment, t as toValidURL, o as openBlock, N as NModal, i as withKeys, j as NButton, k as createTextVNode, l as toDisplayString, m as createCommentVNode, R as RouterLink } from "./index-235f5a3e.js";
|
|
2
|
+
import { _ as _sfc_main$1, b as batchJpgDownloadZip, a as batchZipDownloadZip, c as batchCreateJpgUrl, s as showTextDLg, d as batchCreateZipUrl } from "./ActionCard.vue_vue_type_script_setup_true_lang-bda27d9e.js";
|
|
3
|
+
import { s as shallowSnapshotStorage, d as dialog, a as snapshotStorage, g as githubUrlToSelfUrl } from "./storage-00dd3e29.js";
|
|
4
|
+
import { i as importFromLocal, a as importFromNetwork } from "./import-1c0da893.js";
|
|
5
|
+
import { u as useSnapshotColumns, N as NDataTable, r as renderDveice } from "./table-ad72f278.js";
|
|
6
|
+
import { u as useTask, N as NInput, a as NInputGroup, b as NPopover, c as NSpace, d as NIcon } from "./node-c1756ecf.js";
|
|
7
|
+
import "./jszip.min-9f22f6d7.js";
|
|
8
|
+
const _hoisted_1 = {
|
|
9
|
+
flex: "",
|
|
10
|
+
"flex-col": "",
|
|
11
|
+
"p-10px": "",
|
|
12
|
+
"gap-10px": "",
|
|
13
|
+
"h-full": ""
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_2 = {
|
|
16
|
+
flex: ""
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_3 = {
|
|
19
|
+
"h-full": "",
|
|
20
|
+
flex: "",
|
|
21
|
+
"flex-items-center": ""
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_4 = /* @__PURE__ */ createBaseVNode("div", {
|
|
24
|
+
"flex-1": ""
|
|
25
|
+
}, null, -1);
|
|
26
|
+
const _hoisted_5 = {
|
|
27
|
+
href: "https://github.com/gkd-kit/inspect",
|
|
28
|
+
target: "_blank",
|
|
29
|
+
rel: "noopener noreferrer"
|
|
30
|
+
};
|
|
31
|
+
const _hoisted_6 = /* @__PURE__ */ createBaseVNode("svg", {
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
34
|
+
viewBox: "0 0 496 512"
|
|
35
|
+
}, [/* @__PURE__ */ createBaseVNode("path", {
|
|
36
|
+
d: "M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9c1.6 2.3 4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2z",
|
|
37
|
+
fill: "currentColor"
|
|
38
|
+
})], -1);
|
|
39
|
+
const _hoisted_7 = /* @__PURE__ */ createBaseVNode("svg", {
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
42
|
+
viewBox: "0 0 512 512"
|
|
43
|
+
}, [/* @__PURE__ */ createBaseVNode("path", {
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
"stroke-linecap": "round",
|
|
47
|
+
"stroke-linejoin": "round",
|
|
48
|
+
"stroke-width": "32",
|
|
49
|
+
d: "M256 112v288"
|
|
50
|
+
}), /* @__PURE__ */ createBaseVNode("path", {
|
|
51
|
+
fill: "none",
|
|
52
|
+
stroke: "currentColor",
|
|
53
|
+
"stroke-linecap": "round",
|
|
54
|
+
"stroke-linejoin": "round",
|
|
55
|
+
"stroke-width": "32",
|
|
56
|
+
d: "M400 256H112"
|
|
57
|
+
})], -1);
|
|
58
|
+
const _hoisted_8 = /* @__PURE__ */ createBaseVNode("svg", {
|
|
59
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
60
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
61
|
+
viewBox: "0 0 1024 1024"
|
|
62
|
+
}, [/* @__PURE__ */ createBaseVNode("path", {
|
|
63
|
+
d: "M270.1 741.7c0 23.4 19.1 42.5 42.6 42.5h48.7v120.4c0 30.5 24.5 55.4 54.6 55.4c30.2 0 54.6-24.8 54.6-55.4V784.1h85v120.4c0 30.5 24.5 55.4 54.6 55.4c30.2 0 54.6-24.8 54.6-55.4V784.1h48.7c23.5 0 42.6-19.1 42.6-42.5V346.4h-486v395.3zm357.1-600.1l44.9-65c2.6-3.8 2-8.9-1.5-11.4c-3.5-2.4-8.5-1.2-11.1 2.6l-46.6 67.6c-30.7-12.1-64.9-18.8-100.8-18.8c-35.9 0-70.1 6.7-100.8 18.8l-46.6-67.5c-2.6-3.8-7.6-5.1-11.1-2.6c-3.5 2.4-4.1 7.4-1.5 11.4l44.9 65c-71.4 33.2-121.4 96.1-127.8 169.6h486c-6.6-73.6-56.7-136.5-128-169.7zM409.5 244.1a26.9 26.9 0 1 1 26.9-26.9a26.97 26.97 0 0 1-26.9 26.9zm208.4 0a26.9 26.9 0 1 1 26.9-26.9a26.97 26.97 0 0 1-26.9 26.9zm223.4 100.7c-30.2 0-54.6 24.8-54.6 55.4v216.4c0 30.5 24.5 55.4 54.6 55.4c30.2 0 54.6-24.8 54.6-55.4V400.1c.1-30.6-24.3-55.3-54.6-55.3zm-658.6 0c-30.2 0-54.6 24.8-54.6 55.4v216.4c0 30.5 24.5 55.4 54.6 55.4c30.2 0 54.6-24.8 54.6-55.4V400.1c0-30.6-24.5-55.3-54.6-55.3z",
|
|
64
|
+
fill: "currentColor"
|
|
65
|
+
})], -1);
|
|
66
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
67
|
+
__name: "HomePage",
|
|
68
|
+
setup(__props) {
|
|
69
|
+
const snapshots = shallowRef([]);
|
|
70
|
+
const updateSnapshots = async () => {
|
|
71
|
+
snapshots.value = (await shallowSnapshotStorage.getAllItems()).reverse();
|
|
72
|
+
checkedRowKeys.value = [];
|
|
73
|
+
};
|
|
74
|
+
updateSnapshots();
|
|
75
|
+
const filterOption = shallowReactive({
|
|
76
|
+
query: ``,
|
|
77
|
+
actualQuery: ``,
|
|
78
|
+
updateQuery: () => {
|
|
79
|
+
filterOption.actualQuery = filterOption.query.trim();
|
|
80
|
+
checkedRowKeys.value = [];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const filterSnapshots = computed(() => {
|
|
84
|
+
const actualQuery = filterOption.actualQuery;
|
|
85
|
+
if (!actualQuery)
|
|
86
|
+
return snapshots.value;
|
|
87
|
+
return snapshots.value.filter((s) => {
|
|
88
|
+
return (s.appName || ``).includes(actualQuery) || (s.appId || ``).includes(actualQuery) || (s.activityId || ``).includes(actualQuery);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
const importLoacl = useTask(async () => {
|
|
92
|
+
await importFromLocal();
|
|
93
|
+
await updateSnapshots();
|
|
94
|
+
});
|
|
95
|
+
const {
|
|
96
|
+
activityIdCol,
|
|
97
|
+
appIdCol,
|
|
98
|
+
appNameCol,
|
|
99
|
+
ctimeCol,
|
|
100
|
+
deviceCol,
|
|
101
|
+
appVersionCodeCol,
|
|
102
|
+
appVersionNameCol,
|
|
103
|
+
reseColWidth
|
|
104
|
+
} = useSnapshotColumns();
|
|
105
|
+
watchEffect(() => {
|
|
106
|
+
const set = filterSnapshots.value.reduce((p, c) => (p.add(renderDveice(c)), p), /* @__PURE__ */ new Set());
|
|
107
|
+
if (set.size <= 1) {
|
|
108
|
+
deviceCol.filterOptions = void 0;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
deviceCol.filterOptions = [...set.values()].map((s) => ({
|
|
112
|
+
value: s,
|
|
113
|
+
label: s
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
116
|
+
watchEffect(() => {
|
|
117
|
+
const set = filterSnapshots.value.reduce((p, c) => (p.add(c.appName), p), /* @__PURE__ */ new Set());
|
|
118
|
+
if (set.size <= 1) {
|
|
119
|
+
appNameCol.filterOptions = void 0;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
appNameCol.filterOptions = [...set.values()].map((s) => ({
|
|
123
|
+
value: s,
|
|
124
|
+
label: s
|
|
125
|
+
}));
|
|
126
|
+
});
|
|
127
|
+
watchEffect(() => {
|
|
128
|
+
const set = filterSnapshots.value.reduce((p, c) => (p.add(c.activityId), p), /* @__PURE__ */ new Set());
|
|
129
|
+
if (set.size <= 1) {
|
|
130
|
+
activityIdCol.filterOptions = void 0;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
activityIdCol.filterOptions = [...set.values()].map((s) => ({
|
|
134
|
+
value: s,
|
|
135
|
+
label: s
|
|
136
|
+
}));
|
|
137
|
+
});
|
|
138
|
+
const columns = reactive([{
|
|
139
|
+
type: "selection"
|
|
140
|
+
}, ctimeCol, deviceCol, appNameCol, appIdCol, appVersionCodeCol, appVersionNameCol, activityIdCol, {
|
|
141
|
+
key: `actions`,
|
|
142
|
+
title: `操作`,
|
|
143
|
+
fixed: "right",
|
|
144
|
+
width: `255px`,
|
|
145
|
+
render(row) {
|
|
146
|
+
return createVNode(_sfc_main$1, {
|
|
147
|
+
"snapshot": row,
|
|
148
|
+
"onDelete": updateSnapshots
|
|
149
|
+
}, null);
|
|
150
|
+
}
|
|
151
|
+
}]);
|
|
152
|
+
const pagination = shallowReactive({
|
|
153
|
+
page: 1,
|
|
154
|
+
pageSize: 50,
|
|
155
|
+
showSizePicker: true,
|
|
156
|
+
pageSizes: [50, 100],
|
|
157
|
+
onChange: (page) => {
|
|
158
|
+
pagination.page = page;
|
|
159
|
+
},
|
|
160
|
+
onUpdatePageSize: (pageSize) => {
|
|
161
|
+
pagination.pageSize = pageSize;
|
|
162
|
+
pagination.page = 1;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
watch(pagination, reseColWidth);
|
|
166
|
+
const handleSorterChange = (sorter) => {
|
|
167
|
+
if (sorter.columnKey == ctimeCol.key) {
|
|
168
|
+
ctimeCol.sortOrder = sorter.order;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const showModal = shallowRef(false);
|
|
172
|
+
const text = shallowRef(``);
|
|
173
|
+
const importNetwork = useTask(async () => {
|
|
174
|
+
const urls = text.value.trim().split(`
|
|
175
|
+
`).map((u) => u.trim()).filter((u) => toValidURL(u));
|
|
176
|
+
if (urls.length == 0)
|
|
177
|
+
return;
|
|
178
|
+
await importFromNetwork(urls);
|
|
179
|
+
await updateSnapshots();
|
|
180
|
+
text.value = ``;
|
|
181
|
+
});
|
|
182
|
+
const checkedRowKeys = shallowRef([]);
|
|
183
|
+
const checkedSnapshots = () => {
|
|
184
|
+
return Promise.all(checkedRowKeys.value.map((id) => snapshotStorage.getItem(id)));
|
|
185
|
+
};
|
|
186
|
+
const batchDelete = useTask(async () => {
|
|
187
|
+
await new Promise((res, rej) => {
|
|
188
|
+
dialog.warning({
|
|
189
|
+
title: `删除`,
|
|
190
|
+
content: `是否批量删除 ${checkedRowKeys.value.length} 个快照`,
|
|
191
|
+
negativeText: `取消`,
|
|
192
|
+
positiveText: `确认`,
|
|
193
|
+
onClose: rej,
|
|
194
|
+
onEsc: rej,
|
|
195
|
+
onMaskClick: rej,
|
|
196
|
+
onNegativeClick: rej,
|
|
197
|
+
onPositiveClick: res
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
await Promise.all(checkedRowKeys.value.map((k) => snapshotStorage.removeItem(k)));
|
|
201
|
+
await updateSnapshots();
|
|
202
|
+
});
|
|
203
|
+
const batchDownloadJpg = useTask(async () => {
|
|
204
|
+
await batchJpgDownloadZip(await checkedSnapshots());
|
|
205
|
+
});
|
|
206
|
+
const batchDownloadZip = useTask(async () => {
|
|
207
|
+
await batchZipDownloadZip(await checkedSnapshots());
|
|
208
|
+
});
|
|
209
|
+
const batchShareJpgUrl = useTask(async () => {
|
|
210
|
+
const pngUrls = await batchCreateJpgUrl(await checkedSnapshots());
|
|
211
|
+
showTextDLg({
|
|
212
|
+
content: pngUrls.map((s) => githubUrlToSelfUrl(s)).join(`
|
|
213
|
+
`) + `
|
|
214
|
+
`
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
const batchShareZipUrl = useTask(async () => {
|
|
218
|
+
const zipUrls = await batchCreateZipUrl(await checkedSnapshots());
|
|
219
|
+
showTextDLg({
|
|
220
|
+
content: zipUrls.map((s) => githubUrlToSelfUrl(s)).join(`
|
|
221
|
+
`) + `
|
|
222
|
+
`
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
return (_ctx, _cache) => {
|
|
226
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(NModal), {
|
|
227
|
+
show: showModal.value,
|
|
228
|
+
"onUpdate:show": _cache[1] || (_cache[1] = ($event) => showModal.value = $event),
|
|
229
|
+
preset: "dialog",
|
|
230
|
+
title: "导入网络文件",
|
|
231
|
+
showIcon: false,
|
|
232
|
+
positiveText: "确认",
|
|
233
|
+
negativeText: "取消",
|
|
234
|
+
style: {
|
|
235
|
+
"width": "800px"
|
|
236
|
+
},
|
|
237
|
+
onPositiveClick: unref(importNetwork).invoke,
|
|
238
|
+
loading: unref(importNetwork).loading
|
|
239
|
+
}, {
|
|
240
|
+
default: withCtx(() => [createVNode(unref(NInput), {
|
|
241
|
+
value: text.value,
|
|
242
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => {
|
|
243
|
+
if (!unref(importNetwork).loading) {
|
|
244
|
+
text.value = $event;
|
|
245
|
+
}
|
|
246
|
+
}),
|
|
247
|
+
type: "textarea",
|
|
248
|
+
placeholder: `仅支持ZIP文件链接
|
|
249
|
+
每行一个
|
|
250
|
+
空白行自动忽略
|
|
251
|
+
非法链接行自动忽略`,
|
|
252
|
+
autosize: {
|
|
253
|
+
minRows: 8,
|
|
254
|
+
maxRows: 16
|
|
255
|
+
},
|
|
256
|
+
inputProps: {
|
|
257
|
+
style: `white-space: nowrap;`
|
|
258
|
+
}
|
|
259
|
+
}, null, 8, ["value"])]),
|
|
260
|
+
_: 1
|
|
261
|
+
}, 8, ["show", "onPositiveClick", "loading"]), createBaseVNode("div", _hoisted_1, [createBaseVNode("div", _hoisted_2, [createVNode(unref(NSpace), null, {
|
|
262
|
+
default: withCtx(() => [createVNode(unref(NInputGroup), null, {
|
|
263
|
+
default: withCtx(() => [createVNode(unref(NInput), {
|
|
264
|
+
placeholder: "请输入关键字搜索",
|
|
265
|
+
clearable: "",
|
|
266
|
+
value: unref(filterOption).query,
|
|
267
|
+
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => unref(filterOption).query = $event),
|
|
268
|
+
onKeyup: withKeys(unref(filterOption).updateQuery, ["enter"]),
|
|
269
|
+
onChange: unref(filterOption).updateQuery
|
|
270
|
+
}, null, 8, ["value", "onKeyup", "onChange"]), createVNode(unref(NButton), {
|
|
271
|
+
onClick: unref(filterOption).updateQuery
|
|
272
|
+
}, {
|
|
273
|
+
default: withCtx(() => [createTextVNode(" 搜索 ")]),
|
|
274
|
+
_: 1
|
|
275
|
+
}, 8, ["onClick"])]),
|
|
276
|
+
_: 1
|
|
277
|
+
}), checkedRowKeys.value.length ? (openBlock(), createElementBlock(Fragment, {
|
|
278
|
+
key: 0
|
|
279
|
+
}, [createVNode(unref(NPopover), null, {
|
|
280
|
+
trigger: withCtx(() => [createVNode(unref(NButton), null, {
|
|
281
|
+
default: withCtx(() => [createTextVNode(" 批量下载 ")]),
|
|
282
|
+
_: 1
|
|
283
|
+
})]),
|
|
284
|
+
default: withCtx(() => [createVNode(unref(NSpace), {
|
|
285
|
+
vertical: ""
|
|
286
|
+
}, {
|
|
287
|
+
default: withCtx(() => [createVNode(unref(NButton), {
|
|
288
|
+
onClick: unref(batchDownloadZip).invoke,
|
|
289
|
+
loading: unref(batchDownloadZip).loading
|
|
290
|
+
}, {
|
|
291
|
+
default: withCtx(() => [createTextVNode(" 批量下载-快照 ")]),
|
|
292
|
+
_: 1
|
|
293
|
+
}, 8, ["onClick", "loading"]), createVNode(unref(NButton), {
|
|
294
|
+
onClick: unref(batchDownloadJpg).invoke,
|
|
295
|
+
loading: unref(batchDownloadJpg).loading
|
|
296
|
+
}, {
|
|
297
|
+
default: withCtx(() => [createTextVNode(" 批量下载-图片 ")]),
|
|
298
|
+
_: 1
|
|
299
|
+
}, 8, ["onClick", "loading"])]),
|
|
300
|
+
_: 1
|
|
301
|
+
})]),
|
|
302
|
+
_: 1
|
|
303
|
+
}), createVNode(unref(NPopover), null, {
|
|
304
|
+
trigger: withCtx(() => [createVNode(unref(NButton), null, {
|
|
305
|
+
default: withCtx(() => [createTextVNode(" 批量分享 ")]),
|
|
306
|
+
_: 1
|
|
307
|
+
})]),
|
|
308
|
+
default: withCtx(() => [createVNode(unref(NSpace), {
|
|
309
|
+
vertical: ""
|
|
310
|
+
}, {
|
|
311
|
+
default: withCtx(() => [createVNode(unref(NButton), {
|
|
312
|
+
onClick: unref(batchShareZipUrl).invoke,
|
|
313
|
+
loading: unref(batchShareZipUrl).loading
|
|
314
|
+
}, {
|
|
315
|
+
default: withCtx(() => [createTextVNode(" 批量生成链接-快照 ")]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["onClick", "loading"]), createVNode(unref(NButton), {
|
|
318
|
+
onClick: unref(batchShareJpgUrl).invoke,
|
|
319
|
+
loading: unref(batchShareJpgUrl).loading
|
|
320
|
+
}, {
|
|
321
|
+
default: withCtx(() => [createTextVNode(" 批量生成链接-图片 ")]),
|
|
322
|
+
_: 1
|
|
323
|
+
}, 8, ["onClick", "loading"])]),
|
|
324
|
+
_: 1
|
|
325
|
+
})]),
|
|
326
|
+
_: 1
|
|
327
|
+
}), createVNode(unref(NButton), {
|
|
328
|
+
onClick: unref(batchDelete).invoke
|
|
329
|
+
}, {
|
|
330
|
+
default: withCtx(() => [createTextVNode(" 批量删除 ")]),
|
|
331
|
+
_: 1
|
|
332
|
+
}, 8, ["onClick"]), createBaseVNode("div", _hoisted_3, toDisplayString(`已选中 ${checkedRowKeys.value.length} 个快照`), 1)], 64)) : createCommentVNode("", true)]),
|
|
333
|
+
_: 1
|
|
334
|
+
}), _hoisted_4, createVNode(unref(NSpace), null, {
|
|
335
|
+
default: withCtx(() => [createBaseVNode("a", _hoisted_5, [createVNode(unref(NButton), null, {
|
|
336
|
+
icon: withCtx(() => [createVNode(unref(NIcon), null, {
|
|
337
|
+
default: withCtx(() => [_hoisted_6]),
|
|
338
|
+
_: 1
|
|
339
|
+
})]),
|
|
340
|
+
_: 1
|
|
341
|
+
})]), createVNode(unref(NPopover), null, {
|
|
342
|
+
trigger: withCtx(() => [createVNode(unref(NButton), null, {
|
|
343
|
+
icon: withCtx(() => [createVNode(unref(NIcon), null, {
|
|
344
|
+
default: withCtx(() => [_hoisted_7]),
|
|
345
|
+
_: 1
|
|
346
|
+
})]),
|
|
347
|
+
_: 1
|
|
348
|
+
})]),
|
|
349
|
+
default: withCtx(() => [createVNode(unref(NSpace), {
|
|
350
|
+
vertical: ""
|
|
351
|
+
}, {
|
|
352
|
+
default: withCtx(() => [createVNode(unref(NButton), {
|
|
353
|
+
onClick: unref(importLoacl).invoke,
|
|
354
|
+
loading: unref(importLoacl).loading
|
|
355
|
+
}, {
|
|
356
|
+
default: withCtx(() => [createTextVNode(" 导入本地文件 ")]),
|
|
357
|
+
_: 1
|
|
358
|
+
}, 8, ["onClick", "loading"]), createVNode(unref(NButton), {
|
|
359
|
+
onClick: _cache[3] || (_cache[3] = ($event) => showModal.value = true),
|
|
360
|
+
loading: unref(importNetwork).loading
|
|
361
|
+
}, {
|
|
362
|
+
default: withCtx(() => [createTextVNode(" 导入网络文件 ")]),
|
|
363
|
+
_: 1
|
|
364
|
+
}, 8, ["loading"])]),
|
|
365
|
+
_: 1
|
|
366
|
+
})]),
|
|
367
|
+
_: 1
|
|
368
|
+
}), createVNode(unref(RouterLink), {
|
|
369
|
+
to: "/device"
|
|
370
|
+
}, {
|
|
371
|
+
default: withCtx(() => [createVNode(unref(NButton), null, {
|
|
372
|
+
icon: withCtx(() => [createVNode(unref(NIcon), null, {
|
|
373
|
+
default: withCtx(() => [_hoisted_8]),
|
|
374
|
+
_: 1
|
|
375
|
+
})]),
|
|
376
|
+
_: 1
|
|
377
|
+
})]),
|
|
378
|
+
_: 1
|
|
379
|
+
})]),
|
|
380
|
+
_: 1
|
|
381
|
+
})]), createVNode(unref(NDataTable), {
|
|
382
|
+
striped: "",
|
|
383
|
+
data: filterSnapshots.value,
|
|
384
|
+
columns,
|
|
385
|
+
scrollX: 1800,
|
|
386
|
+
pagination: unref(pagination),
|
|
387
|
+
checkedRowKeys: checkedRowKeys.value,
|
|
388
|
+
"onUpdate:checkedRowKeys": _cache[4] || (_cache[4] = ($event) => checkedRowKeys.value = $event),
|
|
389
|
+
rowKey: (r) => r.id,
|
|
390
|
+
"onUpdate:sorter": handleSorterChange,
|
|
391
|
+
size: "small",
|
|
392
|
+
class: "flex-1",
|
|
393
|
+
flexHeight: ""
|
|
394
|
+
}, null, 8, ["data", "columns", "pagination", "checkedRowKeys", "rowKey"])])], 64);
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
export {
|
|
399
|
+
_sfc_main as default
|
|
400
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { d as defineComponent, an as useRoute, ao as useRouter, s as shallowRef, a6 as onMounted, t as toValidURL, f as createElementBlock, K as withDirectives, L as vShow, h as createBaseVNode, l as toDisplayString, o as openBlock } from "./index-235f5a3e.js";
|
|
2
|
+
import { m as message, j as delay, u as urlStorage, a as snapshotStorage, n as loadingBar, q as githubZipUrlReg, e as githubZipStorage, r as githubImageUrlReg, b as githubJpgStorage } from "./storage-00dd3e29.js";
|
|
3
|
+
import { a as importFromNetwork } from "./import-1c0da893.js";
|
|
4
|
+
import "./jszip.min-9f22f6d7.js";
|
|
5
|
+
const _hoisted_1 = {
|
|
6
|
+
class: "h-[calc(100%-10px)]",
|
|
7
|
+
flex: "",
|
|
8
|
+
"gap-5px": "",
|
|
9
|
+
"p-5px": "",
|
|
10
|
+
"flex-col": "",
|
|
11
|
+
"flex-items-center": ""
|
|
12
|
+
};
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "ImportPage",
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const route = useRoute();
|
|
17
|
+
const router = useRouter();
|
|
18
|
+
const importUrl = String(route.query.url || ``);
|
|
19
|
+
const loading = shallowRef(true);
|
|
20
|
+
const tip = shallowRef(`加载中...`);
|
|
21
|
+
onMounted(async () => {
|
|
22
|
+
if (!toValidURL(importUrl)) {
|
|
23
|
+
message.error(`非法URL参数`);
|
|
24
|
+
await delay(1e3);
|
|
25
|
+
router.replace({
|
|
26
|
+
path: `/`
|
|
27
|
+
});
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await delay(1e3);
|
|
31
|
+
const snapshotId = urlStorage[importUrl];
|
|
32
|
+
if (snapshotId) {
|
|
33
|
+
const snapshot = await snapshotStorage.getItem(snapshotId);
|
|
34
|
+
if (snapshot) {
|
|
35
|
+
router.replace({
|
|
36
|
+
name: "snapshot",
|
|
37
|
+
params: {
|
|
38
|
+
snapshotId
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
} else {
|
|
43
|
+
delete urlStorage[importUrl];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
loadingBar.start();
|
|
47
|
+
try {
|
|
48
|
+
const [result] = await importFromNetwork(importUrl) ?? [];
|
|
49
|
+
if (result.status == "fulfilled") {
|
|
50
|
+
loadingBar.finish();
|
|
51
|
+
const snapshot = result.value;
|
|
52
|
+
if (snapshot == null ? void 0 : snapshot.id) {
|
|
53
|
+
urlStorage[importUrl] = snapshot.id;
|
|
54
|
+
if (importUrl.match(githubZipUrlReg)) {
|
|
55
|
+
githubZipStorage[snapshot.id] = importUrl;
|
|
56
|
+
} else if (importUrl.match(githubImageUrlReg)) {
|
|
57
|
+
githubJpgStorage[snapshot.id] = importUrl;
|
|
58
|
+
}
|
|
59
|
+
loading.value = false;
|
|
60
|
+
await delay(500);
|
|
61
|
+
router.replace({
|
|
62
|
+
name: "snapshot",
|
|
63
|
+
params: {
|
|
64
|
+
snapshotId: snapshot.id
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
tip.value = `获取资源失败`;
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
throw result.reason;
|
|
72
|
+
}
|
|
73
|
+
} catch {
|
|
74
|
+
loadingBar.error();
|
|
75
|
+
tip.value = `加载资源失败`;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return (_ctx, _cache) => {
|
|
79
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [withDirectives(createBaseVNode("div", {
|
|
80
|
+
"mt-40px": ""
|
|
81
|
+
}, toDisplayString(tip.value), 513), [[vShow, loading.value]])]);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
_sfc_main as default
|
|
87
|
+
};
|