dsh-delete-session 0.1.9 → 0.1.10
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/package.json +1 -1
- package/src/client.js +2 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-delete-session",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Delete sessions from the DSH Web sidebar: adds a Delete action to the session row menu with a risk-consent dialog, then removes the session log, workspace accounting and live session state.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
package/src/client.js
CHANGED
|
@@ -29,7 +29,6 @@ window.__ModuleLoader__.load({
|
|
|
29
29
|
cancel: '取消',
|
|
30
30
|
confirm: '删除',
|
|
31
31
|
deleting: '删除中…',
|
|
32
|
-
ack: '我已了解,永久删除',
|
|
33
32
|
dontAsk: '不再询问,以后直接删除',
|
|
34
33
|
done: '已删除会话',
|
|
35
34
|
failed: '删除失败:',
|
|
@@ -58,7 +57,6 @@ window.__ModuleLoader__.load({
|
|
|
58
57
|
cancel: 'Cancel',
|
|
59
58
|
confirm: 'Delete',
|
|
60
59
|
deleting: 'Deleting...',
|
|
61
|
-
ack: 'I understand - delete permanently',
|
|
62
60
|
dontAsk: "Don't ask again",
|
|
63
61
|
done: 'Session deleted',
|
|
64
62
|
failed: 'Delete failed: ',
|
|
@@ -326,15 +324,6 @@ window.__ModuleLoader__.load({
|
|
|
326
324
|
text.className = 'dsdel-text'
|
|
327
325
|
text.textContent = t('desc')
|
|
328
326
|
|
|
329
|
-
const ack = document.createElement('label')
|
|
330
|
-
ack.className = 'dsdel-ack'
|
|
331
|
-
const checkbox = document.createElement('input')
|
|
332
|
-
checkbox.type = 'checkbox'
|
|
333
|
-
const ackText = document.createElement('span')
|
|
334
|
-
ackText.textContent = t('ack')
|
|
335
|
-
ack.appendChild(checkbox)
|
|
336
|
-
ack.appendChild(ackText)
|
|
337
|
-
|
|
338
327
|
const skip = document.createElement('label')
|
|
339
328
|
skip.className = 'dsdel-ack'
|
|
340
329
|
const skipBox = document.createElement('input')
|
|
@@ -358,14 +347,12 @@ window.__ModuleLoader__.load({
|
|
|
358
347
|
confirm.type = 'button'
|
|
359
348
|
confirm.className = 'dsdel-btn dsdel-danger'
|
|
360
349
|
confirm.textContent = t('confirm')
|
|
361
|
-
confirm.disabled = true
|
|
362
350
|
actions.appendChild(cancel)
|
|
363
351
|
actions.appendChild(confirm)
|
|
364
352
|
|
|
365
353
|
dialog.appendChild(title)
|
|
366
354
|
dialog.appendChild(meta)
|
|
367
355
|
dialog.appendChild(text)
|
|
368
|
-
dialog.appendChild(ack)
|
|
369
356
|
dialog.appendChild(skip)
|
|
370
357
|
dialog.appendChild(error)
|
|
371
358
|
dialog.appendChild(actions)
|
|
@@ -377,13 +364,12 @@ window.__ModuleLoader__.load({
|
|
|
377
364
|
if (busy) return
|
|
378
365
|
backdrop.remove()
|
|
379
366
|
}
|
|
380
|
-
checkbox.addEventListener('change', () => { confirm.disabled = !checkbox.checked })
|
|
381
367
|
cancel.addEventListener('click', close)
|
|
382
368
|
backdrop.addEventListener('click', (e) => { if (e.target === backdrop) close() })
|
|
383
369
|
backdrop.addEventListener('keydown', (e) => { if (e.key === 'Escape') close() })
|
|
384
370
|
|
|
385
371
|
confirm.addEventListener('click', () => {
|
|
386
|
-
if (busy
|
|
372
|
+
if (busy) return
|
|
387
373
|
busy = true
|
|
388
374
|
confirm.disabled = true
|
|
389
375
|
cancel.disabled = true
|
|
@@ -404,7 +390,7 @@ window.__ModuleLoader__.load({
|
|
|
404
390
|
busy = false
|
|
405
391
|
pendingRemoval.delete(info.id)
|
|
406
392
|
scheduleDecorate()
|
|
407
|
-
confirm.disabled =
|
|
393
|
+
confirm.disabled = false
|
|
408
394
|
cancel.disabled = false
|
|
409
395
|
confirm.textContent = t('confirm')
|
|
410
396
|
error.textContent = t('failed') + String((reason && reason.message) || reason)
|