dsh-clean-desktop-shell 0.1.10 → 0.1.12

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.
@@ -1,79 +1,79 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'unsafe-inline'; script-src 'unsafe-inline'" />
6
- <title>后端操作</title>
7
- <style>
8
- html, body {
9
- margin: 0;
10
- height: 100%;
11
- background: #10131A;
12
- color: #9aa3b2;
13
- font-family: system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
14
- -webkit-user-select: none;
15
- user-select: none;
16
- overflow: hidden;
17
- }
18
- .wrap {
19
- height: 100%;
20
- box-sizing: border-box;
21
- padding: 18px 22px;
22
- display: flex;
23
- flex-direction: column;
24
- gap: 12px;
25
- }
26
- .title {
27
- font-size: 14px;
28
- font-weight: 600;
29
- color: #e8eaf0;
30
- }
31
- .status {
32
- display: flex;
33
- align-items: center;
34
- gap: 10px;
35
- font-size: 13px;
36
- min-height: 18px;
37
- }
38
- .dot {
39
- width: 14px;
40
- height: 14px;
41
- flex: none;
42
- border-radius: 50%;
43
- border: 2px solid #2c3644;
44
- border-top-color: #7f858f;
45
- animation: spin 0.8s linear infinite;
46
- }
47
- .dot.ok {
48
- border-color: #3d8b6a;
49
- animation: none;
50
- }
51
- .dot.error {
52
- border-color: #c0564d;
53
- animation: none;
54
- }
55
- .msg { line-height: 1.4; }
56
- .msg.error { color: #e09090; }
57
- .msg.ok { color: #8fbfa4; }
58
- @keyframes spin { to { transform: rotate(360deg); } }
59
- </style>
60
- </head>
61
- <body>
62
- <div class="wrap">
63
- <div class="title" id="title">后端操作</div>
64
- <div class="status">
65
- <div class="dot" id="dot"></div>
66
- <div class="msg" id="msg">请稍候…</div>
67
- </div>
68
- </div>
69
- <script>
70
- window.progressAPI.onSet((data) => {
71
- if (data.title) document.getElementById('title').textContent = data.title
72
- const msg = document.getElementById('msg')
73
- msg.textContent = data.message || ''
74
- msg.className = 'msg' + (data.state === 'error' ? ' error' : data.state === 'ok' ? ' ok' : '')
75
- document.getElementById('dot').className = 'dot' + (data.state === 'error' ? ' error' : data.state === 'ok' ? ' ok' : '')
76
- })
77
- </script>
78
- </body>
79
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'unsafe-inline'; script-src 'unsafe-inline'" />
6
+ <title>后端操作</title>
7
+ <style>
8
+ html, body {
9
+ margin: 0;
10
+ height: 100%;
11
+ background: #10131A;
12
+ color: #9aa3b2;
13
+ font-family: system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
14
+ -webkit-user-select: none;
15
+ user-select: none;
16
+ overflow: hidden;
17
+ }
18
+ .wrap {
19
+ height: 100%;
20
+ box-sizing: border-box;
21
+ padding: 18px 22px;
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 12px;
25
+ }
26
+ .title {
27
+ font-size: 14px;
28
+ font-weight: 600;
29
+ color: #e8eaf0;
30
+ }
31
+ .status {
32
+ display: flex;
33
+ align-items: center;
34
+ gap: 10px;
35
+ font-size: 13px;
36
+ min-height: 18px;
37
+ }
38
+ .dot {
39
+ width: 14px;
40
+ height: 14px;
41
+ flex: none;
42
+ border-radius: 50%;
43
+ border: 2px solid #2c3644;
44
+ border-top-color: #7f858f;
45
+ animation: spin 0.8s linear infinite;
46
+ }
47
+ .dot.ok {
48
+ border-color: #3d8b6a;
49
+ animation: none;
50
+ }
51
+ .dot.error {
52
+ border-color: #c0564d;
53
+ animation: none;
54
+ }
55
+ .msg { line-height: 1.4; }
56
+ .msg.error { color: #e09090; }
57
+ .msg.ok { color: #8fbfa4; }
58
+ @keyframes spin { to { transform: rotate(360deg); } }
59
+ </style>
60
+ </head>
61
+ <body>
62
+ <div class="wrap">
63
+ <div class="title" id="title">后端操作</div>
64
+ <div class="status">
65
+ <div class="dot" id="dot"></div>
66
+ <div class="msg" id="msg">请稍候…</div>
67
+ </div>
68
+ </div>
69
+ <script>
70
+ window.progressAPI.onSet((data) => {
71
+ if (data.title) document.getElementById('title').textContent = data.title
72
+ const msg = document.getElementById('msg')
73
+ msg.textContent = data.message || ''
74
+ msg.className = 'msg' + (data.state === 'error' ? ' error' : data.state === 'ok' ? ' ok' : '')
75
+ document.getElementById('dot').className = 'dot' + (data.state === 'error' ? ' error' : data.state === 'ok' ? ' ok' : '')
76
+ })
77
+ </script>
78
+ </body>
79
+ </html>
@@ -1,56 +1,56 @@
1
- /**
2
- * Small always-on-top progress window for backend operations
3
- * (start / restart / stop). Single instance; reused across calls.
4
- *
5
- * States: 'busy' (spinner) | 'ok' | 'error' — the caller decides when to
6
- * close it (auto-close timers live in the caller).
7
- */
8
- import { BrowserWindow } from 'electron'
9
- import { fileURLToPath } from 'node:url'
10
-
11
- const PRELOAD = fileURLToPath(new URL('./progress-preload.js', import.meta.url))
12
- const PAGE = fileURLToPath(new URL('./progress.html', import.meta.url))
13
-
14
- let win = null
15
-
16
- /** Show (or update) the progress window. */
17
- export function showProgress({ title, message, state = 'busy' }) {
18
- if (!win || win.isDestroyed()) {
19
- win = new BrowserWindow({
20
- width: 420,
21
- height: 128,
22
- frame: false,
23
- resizable: false,
24
- movable: true,
25
- alwaysOnTop: true,
26
- skipTaskbar: true,
27
- show: false,
28
- backgroundColor: '#10131A',
29
- webPreferences: {
30
- preload: PRELOAD,
31
- contextIsolation: true,
32
- nodeIntegration: false,
33
- sandbox: true,
34
- },
35
- })
36
- win.loadFile(PAGE)
37
- win.once('ready-to-show', () => win.show())
38
- win.on('closed', () => {
39
- win = null
40
- })
41
- }
42
- setProgress({ title, message, state })
43
- return win
44
- }
45
-
46
- /** Update the currently visible progress window (no-op if hidden). */
47
- export function setProgress({ title, message, state }) {
48
- if (win && !win.isDestroyed()) {
49
- win.webContents.send('progress:set', { title, message, state })
50
- }
51
- }
52
-
53
- /** Close the progress window if open. */
54
- export function closeProgress() {
55
- if (win && !win.isDestroyed()) win.close()
56
- }
1
+ /**
2
+ * Small always-on-top progress window for backend operations
3
+ * (start / restart / stop). Single instance; reused across calls.
4
+ *
5
+ * States: 'busy' (spinner) | 'ok' | 'error' — the caller decides when to
6
+ * close it (auto-close timers live in the caller).
7
+ */
8
+ import { BrowserWindow } from 'electron'
9
+ import { fileURLToPath } from 'node:url'
10
+
11
+ const PRELOAD = fileURLToPath(new URL('./progress-preload.js', import.meta.url))
12
+ const PAGE = fileURLToPath(new URL('./progress.html', import.meta.url))
13
+
14
+ let win = null
15
+
16
+ /** Show (or update) the progress window. */
17
+ export function showProgress({ title, message, state = 'busy' }) {
18
+ if (!win || win.isDestroyed()) {
19
+ win = new BrowserWindow({
20
+ width: 420,
21
+ height: 128,
22
+ frame: false,
23
+ resizable: false,
24
+ movable: true,
25
+ alwaysOnTop: true,
26
+ skipTaskbar: true,
27
+ show: false,
28
+ backgroundColor: '#10131A',
29
+ webPreferences: {
30
+ preload: PRELOAD,
31
+ contextIsolation: true,
32
+ nodeIntegration: false,
33
+ sandbox: true,
34
+ },
35
+ })
36
+ win.loadFile(PAGE)
37
+ win.once('ready-to-show', () => win.show())
38
+ win.on('closed', () => {
39
+ win = null
40
+ })
41
+ }
42
+ setProgress({ title, message, state })
43
+ return win
44
+ }
45
+
46
+ /** Update the currently visible progress window (no-op if hidden). */
47
+ export function setProgress({ title, message, state }) {
48
+ if (win && !win.isDestroyed()) {
49
+ win.webContents.send('progress:set', { title, message, state })
50
+ }
51
+ }
52
+
53
+ /** Close the progress window if open. */
54
+ export function closeProgress() {
55
+ if (win && !win.isDestroyed()) win.close()
56
+ }