@xiangyixie/dsh-superagent 0.11.0 → 0.12.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 +85 -10
- package/README.md +322 -28
- package/bin/doctor.js +1 -1
- package/bin/sync.js +187 -0
- package/bin/workbench.js +98 -0
- package/docs/policy.example.json +38 -0
- package/lib/audit.js +555 -0
- package/lib/doctor.js +2 -0
- package/lib/guard.js +841 -0
- package/lib/index.js +493 -9
- package/lib/inject.js +138 -0
- package/lib/orchestrator.js +543 -4
- package/lib/policy.js +739 -0
- package/lib/sync.js +456 -0
- package/lib/workbench.js +1119 -0
- package/package.json +92 -80
- package/public/workbench.html +836 -0
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>dsh-superagent · Workbench</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #0d1015;
|
|
10
|
+
--panel: #12161d;
|
|
11
|
+
--panel-2: #161b24;
|
|
12
|
+
--line: #222a36;
|
|
13
|
+
--line-soft: #1b2230;
|
|
14
|
+
--text: #c9d2de;
|
|
15
|
+
--muted: #7b8798;
|
|
16
|
+
--faint: #556173;
|
|
17
|
+
--accent: #5aa2ff;
|
|
18
|
+
--accent-soft: rgba(90, 162, 255, 0.12);
|
|
19
|
+
--green: #4cc38a;
|
|
20
|
+
--green-soft: rgba(76, 195, 138, 0.12);
|
|
21
|
+
--red: #f2727d;
|
|
22
|
+
--red-soft: rgba(242, 114, 125, 0.12);
|
|
23
|
+
--amber: #e3b341;
|
|
24
|
+
--mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
|
|
25
|
+
--sans: "Segoe UI", Inter, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
26
|
+
}
|
|
27
|
+
* { box-sizing: border-box; }
|
|
28
|
+
html, body { height: 100%; margin: 0; }
|
|
29
|
+
body {
|
|
30
|
+
background: var(--bg);
|
|
31
|
+
color: var(--text);
|
|
32
|
+
font: 13px/1.5 var(--sans);
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
button {
|
|
36
|
+
font: inherit;
|
|
37
|
+
color: var(--text);
|
|
38
|
+
background: var(--panel-2);
|
|
39
|
+
border: 1px solid var(--line);
|
|
40
|
+
border-radius: 6px;
|
|
41
|
+
padding: 5px 11px;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
transition: border-color .15s, background .15s, color .15s;
|
|
44
|
+
}
|
|
45
|
+
button:hover { border-color: #334054; background: #1b2130; }
|
|
46
|
+
button:disabled { opacity: .4; cursor: default; }
|
|
47
|
+
button.primary { background: #1f6feb; border-color: #2b7fff; color: #fff; }
|
|
48
|
+
button.primary:hover:not(:disabled) { background: #2a7bf5; }
|
|
49
|
+
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 3px 7px; }
|
|
50
|
+
button.ghost:hover { color: var(--text); background: var(--accent-soft); border-color: transparent; }
|
|
51
|
+
|
|
52
|
+
.topbar {
|
|
53
|
+
height: 48px;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 16px;
|
|
57
|
+
padding: 0 16px;
|
|
58
|
+
background: var(--panel);
|
|
59
|
+
border-bottom: 1px solid var(--line);
|
|
60
|
+
}
|
|
61
|
+
.brand { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .2px; white-space: nowrap; }
|
|
62
|
+
.brand .mark {
|
|
63
|
+
display: inline-grid; place-items: center;
|
|
64
|
+
width: 24px; height: 24px; border-radius: 6px;
|
|
65
|
+
background: linear-gradient(135deg, #2b7fff, #7c5cff);
|
|
66
|
+
color: #fff; font: 700 11px/1 var(--mono); letter-spacing: -.5px;
|
|
67
|
+
}
|
|
68
|
+
.brand strong { color: #e6edf7; font-weight: 600; }
|
|
69
|
+
.brand .sep { color: var(--faint); }
|
|
70
|
+
.brand .muted { color: var(--muted); }
|
|
71
|
+
.root {
|
|
72
|
+
flex: 1; min-width: 0;
|
|
73
|
+
font: 12px var(--mono);
|
|
74
|
+
color: var(--muted);
|
|
75
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
76
|
+
}
|
|
77
|
+
.status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
|
|
78
|
+
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
|
|
79
|
+
.status.offline .dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
|
|
80
|
+
|
|
81
|
+
.layout {
|
|
82
|
+
display: grid;
|
|
83
|
+
grid-template-columns: 248px minmax(0, 1fr) 320px;
|
|
84
|
+
height: calc(100% - 48px);
|
|
85
|
+
}
|
|
86
|
+
.sidebar, .editor-pane, .side-pane { min-height: 0; min-width: 0; }
|
|
87
|
+
.sidebar {
|
|
88
|
+
display: flex; flex-direction: column;
|
|
89
|
+
background: var(--panel);
|
|
90
|
+
border-right: 1px solid var(--line);
|
|
91
|
+
}
|
|
92
|
+
.pane-head {
|
|
93
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
94
|
+
padding: 10px 12px 8px;
|
|
95
|
+
font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
|
|
96
|
+
color: var(--muted);
|
|
97
|
+
}
|
|
98
|
+
.pane-head.small { border-top: 1px solid var(--line-soft); padding-top: 10px; }
|
|
99
|
+
.tree, .runs { overflow: auto; }
|
|
100
|
+
.tree { flex: 1; padding: 2px 6px 12px; font-size: 12.5px; }
|
|
101
|
+
.runs { max-height: 38%; padding: 0 8px 10px; }
|
|
102
|
+
.tree ul { list-style: none; margin: 0; padding: 0; }
|
|
103
|
+
.tree li { padding: 0; }
|
|
104
|
+
.row {
|
|
105
|
+
display: flex; align-items: center; gap: 6px;
|
|
106
|
+
width: 100%; text-align: left;
|
|
107
|
+
border: 0; border-radius: 5px;
|
|
108
|
+
background: transparent; color: var(--text);
|
|
109
|
+
padding: 3px 7px; font: 12.5px/1.6 var(--sans);
|
|
110
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
111
|
+
}
|
|
112
|
+
.row:hover { background: #1a212c; }
|
|
113
|
+
.row.active { background: var(--accent-soft); color: #dbe9ff; }
|
|
114
|
+
.row .caret { width: 10px; color: var(--faint); font-size: 10px; flex: none; text-align: center; }
|
|
115
|
+
.row .name { overflow: hidden; text-overflow: ellipsis; }
|
|
116
|
+
.row .size { margin-left: auto; padding-left: 8px; color: var(--faint); font: 10.5px var(--mono); }
|
|
117
|
+
.tree ul ul { padding-left: 13px; }
|
|
118
|
+
.empty { color: var(--faint); font-size: 12px; padding: 8px 10px; }
|
|
119
|
+
|
|
120
|
+
.run {
|
|
121
|
+
width: 100%; text-align: left;
|
|
122
|
+
border: 1px solid transparent; border-radius: 7px;
|
|
123
|
+
background: transparent; padding: 7px 8px; margin-bottom: 3px;
|
|
124
|
+
display: block; cursor: pointer;
|
|
125
|
+
}
|
|
126
|
+
.run:hover { background: #1a212c; }
|
|
127
|
+
.run.active { background: var(--accent-soft); border-color: rgba(90,162,255,.25); }
|
|
128
|
+
.run-top { display: flex; align-items: center; gap: 7px; }
|
|
129
|
+
.run-id { font: 11px var(--mono); color: var(--muted); }
|
|
130
|
+
.run-goal {
|
|
131
|
+
margin-top: 3px; font-size: 12px; color: #aeb9c8;
|
|
132
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
133
|
+
}
|
|
134
|
+
.pill {
|
|
135
|
+
font-size: 10px; padding: 1px 7px; border-radius: 999px;
|
|
136
|
+
border: 1px solid var(--line); color: var(--muted); text-transform: lowercase;
|
|
137
|
+
}
|
|
138
|
+
.pill.completed { color: var(--green); border-color: rgba(76,195,138,.35); background: var(--green-soft); }
|
|
139
|
+
.pill.failed, .pill.cancelled { color: var(--red); border-color: rgba(242,114,125,.35); background: var(--red-soft); }
|
|
140
|
+
.pill.running, .pill.planning, .pill.aggregating, .pill.queued { color: var(--amber); border-color: rgba(227,179,65,.35); background: rgba(227,179,65,.1); }
|
|
141
|
+
.pill.partial, .pill.interrupted { color: var(--amber); border-color: rgba(227,179,65,.3); }
|
|
142
|
+
|
|
143
|
+
.editor-pane {
|
|
144
|
+
display: flex; flex-direction: column;
|
|
145
|
+
background: #0f131a;
|
|
146
|
+
border-right: 1px solid var(--line);
|
|
147
|
+
}
|
|
148
|
+
.editor-head {
|
|
149
|
+
display: flex; align-items: center; gap: 12px;
|
|
150
|
+
padding: 0 16px; min-height: 46px;
|
|
151
|
+
border-bottom: 1px solid var(--line);
|
|
152
|
+
background: var(--panel);
|
|
153
|
+
}
|
|
154
|
+
.crumbs { flex: 1; min-width: 0; font: 12px var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
155
|
+
.crumbs .dir { color: var(--faint); }
|
|
156
|
+
.crumbs .file { color: #e6edf7; }
|
|
157
|
+
.badges { display: flex; align-items: center; gap: 8px; font: 10.5px var(--mono); color: var(--faint); white-space: nowrap; }
|
|
158
|
+
.badge { border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
|
|
159
|
+
.badge.warn { color: var(--amber); border-color: rgba(227,179,65,.35); }
|
|
160
|
+
#editor {
|
|
161
|
+
flex: 1; resize: none; width: 100%;
|
|
162
|
+
background: #0f131a; color: #d5deeb;
|
|
163
|
+
border: 0; outline: none;
|
|
164
|
+
padding: 16px 20px 24px;
|
|
165
|
+
font: 12.5px/1.7 var(--mono);
|
|
166
|
+
tab-size: 2;
|
|
167
|
+
caret-color: var(--accent);
|
|
168
|
+
}
|
|
169
|
+
#editor::placeholder { color: var(--faint); }
|
|
170
|
+
#editor[disabled] { color: var(--muted); }
|
|
171
|
+
.editor-actions {
|
|
172
|
+
display: flex; align-items: center; gap: 10px;
|
|
173
|
+
padding: 9px 16px;
|
|
174
|
+
border-top: 1px solid var(--line);
|
|
175
|
+
background: var(--panel);
|
|
176
|
+
}
|
|
177
|
+
.editor-actions .fill { flex: 1; }
|
|
178
|
+
.dirty { font-size: 11px; color: var(--faint); }
|
|
179
|
+
.dirty.on { color: var(--amber); }
|
|
180
|
+
.notice {
|
|
181
|
+
margin: 12px 16px 0;
|
|
182
|
+
border: 1px solid rgba(227,179,65,.35);
|
|
183
|
+
background: rgba(227,179,65,.08);
|
|
184
|
+
border-radius: 7px; padding: 9px 12px;
|
|
185
|
+
color: #ecd9a4; font-size: 12px;
|
|
186
|
+
}
|
|
187
|
+
.notice.error { border-color: rgba(242,114,125,.4); background: var(--red-soft); color: #ffc7cb; }
|
|
188
|
+
.notice.info { border-color: rgba(90,162,255,.3); background: var(--accent-soft); color: #bcd7ff; }
|
|
189
|
+
|
|
190
|
+
.confirm {
|
|
191
|
+
border-top: 1px solid var(--line);
|
|
192
|
+
background: var(--panel);
|
|
193
|
+
max-height: 46%;
|
|
194
|
+
display: flex; flex-direction: column;
|
|
195
|
+
}
|
|
196
|
+
.confirm-head {
|
|
197
|
+
display: flex; align-items: center; gap: 10px;
|
|
198
|
+
padding: 9px 16px; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
|
|
199
|
+
}
|
|
200
|
+
.confirm-head .stats { font: 11px var(--mono); text-transform: none; letter-spacing: 0; }
|
|
201
|
+
.confirm pre {
|
|
202
|
+
margin: 0; overflow: auto; flex: 1;
|
|
203
|
+
padding: 10px 16px 14px;
|
|
204
|
+
font: 11.5px/1.65 var(--mono);
|
|
205
|
+
background: #0b0e13;
|
|
206
|
+
border-top: 1px solid var(--line-soft);
|
|
207
|
+
}
|
|
208
|
+
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--line-soft); }
|
|
209
|
+
|
|
210
|
+
.side-pane { display: flex; flex-direction: column; background: var(--panel); }
|
|
211
|
+
.side-body { flex: 1; overflow: auto; padding: 0 12px 16px; }
|
|
212
|
+
.side-body pre {
|
|
213
|
+
margin: 0; padding: 10px 12px;
|
|
214
|
+
background: #0b0e13; border: 1px solid var(--line-soft); border-radius: 7px;
|
|
215
|
+
font: 11.5px/1.65 var(--mono); overflow: auto;
|
|
216
|
+
}
|
|
217
|
+
.diff-line { white-space: pre-wrap; word-break: break-word; }
|
|
218
|
+
.diff-add { color: #7ee2a8; background: rgba(76,195,138,.07); }
|
|
219
|
+
.diff-del { color: #ff9aa2; background: rgba(242,114,125,.07); }
|
|
220
|
+
.diff-meta { color: #7fb0ff; }
|
|
221
|
+
.diff-note { color: var(--muted); font-size: 12px; padding: 8px 2px 12px; }
|
|
222
|
+
.change-list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 14px; }
|
|
223
|
+
.change {
|
|
224
|
+
display: flex; align-items: center; gap: 8px;
|
|
225
|
+
width: 100%; text-align: left;
|
|
226
|
+
border: 1px solid transparent; border-radius: 6px;
|
|
227
|
+
background: transparent; padding: 5px 8px;
|
|
228
|
+
font: 11.5px var(--mono); color: #b9c5d6;
|
|
229
|
+
}
|
|
230
|
+
.change:hover { background: #1a212c; }
|
|
231
|
+
.change .tag { font-size: 9.5px; letter-spacing: .3px; border-radius: 4px; padding: 1px 5px; border: 1px solid var(--line); color: var(--muted); flex: none; }
|
|
232
|
+
.change .tag.added { color: var(--green); border-color: rgba(76,195,138,.35); }
|
|
233
|
+
.change .tag.deleted { color: var(--red); border-color: rgba(242,114,125,.35); }
|
|
234
|
+
.change .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
235
|
+
.side-title { font-size: 11px; color: var(--muted); padding: 2px 2px 8px; }
|
|
236
|
+
.toast {
|
|
237
|
+
position: fixed; right: 18px; bottom: 18px;
|
|
238
|
+
background: #1b2330; border: 1px solid #2c3a4d; border-radius: 8px;
|
|
239
|
+
padding: 9px 14px; font-size: 12px; color: #dbe5f2;
|
|
240
|
+
box-shadow: 0 10px 30px rgba(0,0,0,.4);
|
|
241
|
+
opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
|
|
242
|
+
pointer-events: none; max-width: 420px;
|
|
243
|
+
}
|
|
244
|
+
.toast.show { opacity: 1; transform: none; }
|
|
245
|
+
.auth {
|
|
246
|
+
height: 100%; display: grid; place-items: center; padding: 24px;
|
|
247
|
+
}
|
|
248
|
+
.auth-card {
|
|
249
|
+
width: 100%; max-width: 520px; background: var(--panel);
|
|
250
|
+
border: 1px solid var(--line); border-radius: 12px; padding: 26px 28px;
|
|
251
|
+
}
|
|
252
|
+
.auth-card h1 { font-size: 17px; margin: 0 0 10px; color: #e6edf7; }
|
|
253
|
+
.auth-card p { color: var(--muted); font-size: 12.5px; margin: 8px 0; }
|
|
254
|
+
.auth-card code { font: 11.5px var(--mono); color: #9cc4ff; background: #0c1017; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
|
|
255
|
+
[hidden] { display: none !important; }
|
|
256
|
+
@media (max-width: 860px) {
|
|
257
|
+
.layout { grid-template-columns: 240px minmax(0, 1fr); }
|
|
258
|
+
.side-pane { display: none; }
|
|
259
|
+
}
|
|
260
|
+
</style>
|
|
261
|
+
</head>
|
|
262
|
+
<body>
|
|
263
|
+
<header class="topbar">
|
|
264
|
+
<div class="brand">
|
|
265
|
+
<span class="mark">dsh</span>
|
|
266
|
+
<strong>superagent</strong><span class="sep">/</span><span class="muted">workbench</span>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="root" id="rootPath">connecting…</div>
|
|
269
|
+
<div class="status offline" id="conn"><span class="dot"></span><span id="connText">connecting</span></div>
|
|
270
|
+
</header>
|
|
271
|
+
|
|
272
|
+
<main class="layout" id="shell">
|
|
273
|
+
<aside class="sidebar">
|
|
274
|
+
<div class="pane-head"><span>Explorer</span><button class="ghost" id="refreshTree" title="刷新文件树">刷新</button></div>
|
|
275
|
+
<div class="tree" id="tree"><div class="empty">正在读取目录…</div></div>
|
|
276
|
+
<div class="pane-head small"><span>Runs</span><button class="ghost" id="refreshRuns" title="刷新 run 列表">刷新</button></div>
|
|
277
|
+
<div class="runs" id="runs"><div class="empty">正在读取 run…</div></div>
|
|
278
|
+
</aside>
|
|
279
|
+
|
|
280
|
+
<section class="editor-pane">
|
|
281
|
+
<div class="editor-head">
|
|
282
|
+
<div class="crumbs" id="crumbs">未打开文件</div>
|
|
283
|
+
<div class="badges" id="fileMeta"></div>
|
|
284
|
+
</div>
|
|
285
|
+
<div class="notice" id="notice" hidden></div>
|
|
286
|
+
<textarea id="editor" spellcheck="false" placeholder="从左侧文件树选择一个文本文件"></textarea>
|
|
287
|
+
<div class="editor-actions">
|
|
288
|
+
<span class="dirty" id="dirty">只读浏览</span>
|
|
289
|
+
<span class="fill"></span>
|
|
290
|
+
<button id="previewBtn" disabled>预览 diff</button>
|
|
291
|
+
<button id="saveBtn" class="primary" disabled>保存</button>
|
|
292
|
+
</div>
|
|
293
|
+
<div class="confirm" id="confirm" hidden>
|
|
294
|
+
<div class="confirm-head">保存前预览 <span class="stats" id="confirmStats"></span></div>
|
|
295
|
+
<pre id="confirmDiff"></pre>
|
|
296
|
+
<div class="confirm-actions">
|
|
297
|
+
<button id="cancelSave">取消</button>
|
|
298
|
+
<button id="confirmSave" class="primary">确认保存</button>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
</section>
|
|
302
|
+
|
|
303
|
+
<section class="side-pane">
|
|
304
|
+
<div class="pane-head"><span id="sideTitle">Diff</span></div>
|
|
305
|
+
<div class="side-body" id="sideBody">
|
|
306
|
+
<div class="diff-note">打开文件后可预览改动;选择一个 run 可查看它改过的文件与 diff。</div>
|
|
307
|
+
</div>
|
|
308
|
+
</section>
|
|
309
|
+
</main>
|
|
310
|
+
|
|
311
|
+
<div class="toast" id="toast"></div>
|
|
312
|
+
|
|
313
|
+
<div class="auth" id="auth" hidden>
|
|
314
|
+
<div class="auth-card">
|
|
315
|
+
<h1>需要访问令牌</h1>
|
|
316
|
+
<p>这个面板只监听 127.0.0.1,并且每次启动都会生成一次性令牌。</p>
|
|
317
|
+
<p>从插件启动日志里找到 <code>workbench listening on http://127.0.0.1:<port></code>,令牌在同级状态目录的 <code>workbench.json</code> 中。</p>
|
|
318
|
+
<p>打开 <code>http://127.0.0.1:<port>/?token=<token></code> 即可进入;令牌会保存在本次浏览器会话中。</p>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<script>
|
|
323
|
+
(() => {
|
|
324
|
+
'use strict';
|
|
325
|
+
|
|
326
|
+
const $ = id => document.getElementById(id);
|
|
327
|
+
const state = {
|
|
328
|
+
token: '',
|
|
329
|
+
file: null,
|
|
330
|
+
dirty: false,
|
|
331
|
+
activeRun: null,
|
|
332
|
+
busy: false,
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
function readToken() {
|
|
336
|
+
const params = new URLSearchParams(location.search);
|
|
337
|
+
const fromQuery = params.get('token');
|
|
338
|
+
if (fromQuery) {
|
|
339
|
+
sessionStorage.setItem('dsh-workbench-token', fromQuery);
|
|
340
|
+
params.delete('token');
|
|
341
|
+
const query = params.toString();
|
|
342
|
+
history.replaceState({}, '', location.pathname + (query ? '?' + query : ''));
|
|
343
|
+
return fromQuery;
|
|
344
|
+
}
|
|
345
|
+
return sessionStorage.getItem('dsh-workbench-token') || '';
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
async function api(route, options = {}) {
|
|
349
|
+
const headers = Object.assign({ authorization: 'Bearer ' + state.token }, options.headers || {});
|
|
350
|
+
if (options.body !== undefined) headers['content-type'] = 'application/json';
|
|
351
|
+
const response = await fetch(route, Object.assign({}, options, { headers }));
|
|
352
|
+
let payload = null;
|
|
353
|
+
try { payload = await response.json(); } catch { /* a non-JSON error body is handled below */ }
|
|
354
|
+
if (!response.ok || !payload || payload.ok !== true) {
|
|
355
|
+
const detail = payload && payload.error ? payload.error : {};
|
|
356
|
+
const error = new Error(detail.summary || ('HTTP ' + response.status));
|
|
357
|
+
error.id = detail.id || 'http-' + response.status;
|
|
358
|
+
error.hint = detail.hint || '';
|
|
359
|
+
error.status = response.status;
|
|
360
|
+
throw error;
|
|
361
|
+
}
|
|
362
|
+
return payload.data;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function toast(message, isError) {
|
|
366
|
+
const box = $('toast');
|
|
367
|
+
box.textContent = message;
|
|
368
|
+
box.style.borderColor = isError ? 'rgba(242,114,125,.5)' : '#2c3a4d';
|
|
369
|
+
box.classList.add('show');
|
|
370
|
+
clearTimeout(toast.timer);
|
|
371
|
+
toast.timer = setTimeout(() => box.classList.remove('show'), isError ? 5200 : 2400);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function setConn(ok, text) {
|
|
375
|
+
$('conn').classList.toggle('offline', !ok);
|
|
376
|
+
$('connText').textContent = text;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function notice(message, kind) {
|
|
380
|
+
const box = $('notice');
|
|
381
|
+
if (!message) { box.hidden = true; return; }
|
|
382
|
+
box.hidden = false;
|
|
383
|
+
box.className = 'notice' + (kind ? ' ' + kind : '');
|
|
384
|
+
box.textContent = message;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function formatBytes(bytes) {
|
|
388
|
+
if (bytes === null || bytes === undefined) return '';
|
|
389
|
+
if (bytes < 1024) return bytes + ' B';
|
|
390
|
+
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';
|
|
391
|
+
return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function statusPill(status) {
|
|
395
|
+
const span = document.createElement('span');
|
|
396
|
+
span.className = 'pill ' + String(status || '');
|
|
397
|
+
span.textContent = status || 'unknown';
|
|
398
|
+
return span;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function renderTree(container, entries) {
|
|
402
|
+
container.textContent = '';
|
|
403
|
+
if (!entries.length) {
|
|
404
|
+
const empty = document.createElement('div');
|
|
405
|
+
empty.className = 'empty';
|
|
406
|
+
empty.textContent = '空目录';
|
|
407
|
+
container.appendChild(empty);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
const list = document.createElement('ul');
|
|
411
|
+
for (const entry of entries) {
|
|
412
|
+
const item = document.createElement('li');
|
|
413
|
+
const row = document.createElement('button');
|
|
414
|
+
row.className = 'row';
|
|
415
|
+
row.type = 'button';
|
|
416
|
+
row.dataset.path = entry.path;
|
|
417
|
+
const caret = document.createElement('span');
|
|
418
|
+
caret.className = 'caret';
|
|
419
|
+
caret.textContent = entry.type === 'dir' ? '\u25B8' : '';
|
|
420
|
+
const name = document.createElement('span');
|
|
421
|
+
name.className = 'name';
|
|
422
|
+
name.textContent = entry.name;
|
|
423
|
+
row.append(caret, name);
|
|
424
|
+
if (entry.type === 'file') {
|
|
425
|
+
const size = document.createElement('span');
|
|
426
|
+
size.className = 'size';
|
|
427
|
+
size.textContent = formatBytes(entry.size);
|
|
428
|
+
row.appendChild(size);
|
|
429
|
+
}
|
|
430
|
+
if (entry.type === 'dir') {
|
|
431
|
+
const children = document.createElement('ul');
|
|
432
|
+
children.hidden = true;
|
|
433
|
+
item.append(row, children);
|
|
434
|
+
row.addEventListener('click', async () => {
|
|
435
|
+
const open = !children.hidden;
|
|
436
|
+
if (open) {
|
|
437
|
+
children.hidden = true;
|
|
438
|
+
caret.textContent = '\u25B8';
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
children.hidden = false;
|
|
442
|
+
caret.textContent = '\u25BE';
|
|
443
|
+
if (!children.dataset.loaded) {
|
|
444
|
+
try {
|
|
445
|
+
const data = await api('/api/tree?path=' + encodeURIComponent(entry.path));
|
|
446
|
+
renderTree(children, data.entries);
|
|
447
|
+
children.dataset.loaded = '1';
|
|
448
|
+
} catch (error) {
|
|
449
|
+
children.hidden = true;
|
|
450
|
+
toast(error.message, true);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
} else {
|
|
455
|
+
item.appendChild(row);
|
|
456
|
+
row.addEventListener('click', () => openFile(entry.path, row));
|
|
457
|
+
}
|
|
458
|
+
list.appendChild(item);
|
|
459
|
+
}
|
|
460
|
+
container.appendChild(list);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function markActive(path) {
|
|
464
|
+
document.querySelectorAll('#tree .row.active').forEach(node => node.classList.remove('active'));
|
|
465
|
+
if (!path) return;
|
|
466
|
+
const target = document.querySelector('#tree .row[data-path="' + CSS.escape(path) + '"]');
|
|
467
|
+
if (target) target.classList.add('active');
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function renderCrumbs(path) {
|
|
471
|
+
const crumbs = $('crumbs');
|
|
472
|
+
crumbs.textContent = '';
|
|
473
|
+
if (!path) { crumbs.textContent = '未打开文件'; return; }
|
|
474
|
+
const parts = path.split('/');
|
|
475
|
+
parts.forEach((part, index) => {
|
|
476
|
+
const span = document.createElement('span');
|
|
477
|
+
span.className = index === parts.length - 1 ? 'file' : 'dir';
|
|
478
|
+
span.textContent = part + (index === parts.length - 1 ? '' : ' / ');
|
|
479
|
+
crumbs.appendChild(span);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function setFileMeta(info) {
|
|
484
|
+
const meta = $('fileMeta');
|
|
485
|
+
meta.textContent = '';
|
|
486
|
+
if (!info) return;
|
|
487
|
+
const size = document.createElement('span');
|
|
488
|
+
size.className = 'badge';
|
|
489
|
+
size.textContent = formatBytes(info.size);
|
|
490
|
+
meta.appendChild(size);
|
|
491
|
+
if (info.readOnly) {
|
|
492
|
+
const badge = document.createElement('span');
|
|
493
|
+
badge.className = 'badge warn';
|
|
494
|
+
badge.textContent = info.readOnly === 'binary' ? 'binary · readonly' : 'too large · readonly';
|
|
495
|
+
meta.appendChild(badge);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function normalized(text) {
|
|
500
|
+
return String(text).replace(/\r\n/g, '\n');
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// A textarea reports LF even for a CRLF file. Keep the file's original
|
|
504
|
+
// convention when sending an edit back, so saving does not rewrite every
|
|
505
|
+
// line on Windows.
|
|
506
|
+
function editorText() {
|
|
507
|
+
const value = $('editor').value;
|
|
508
|
+
return state.file && state.file.eol === 'crlf' ? value.replace(/\r?\n/g, '\r\n') : value;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function updateDirty() {
|
|
512
|
+
const dirty = Boolean(state.file) && !state.file.readOnly
|
|
513
|
+
&& normalized($('editor').value) !== normalized(state.file.content);
|
|
514
|
+
state.dirty = dirty;
|
|
515
|
+
$('dirty').textContent = !state.file
|
|
516
|
+
? '只读浏览'
|
|
517
|
+
: state.file.readOnly
|
|
518
|
+
? '此文件不可编辑'
|
|
519
|
+
: dirty ? '有未保存改动' : '已保存';
|
|
520
|
+
$('dirty').classList.toggle('on', dirty);
|
|
521
|
+
$('previewBtn').disabled = !state.file || Boolean(state.file.readOnly) || state.busy;
|
|
522
|
+
$('saveBtn').disabled = !state.file || Boolean(state.file.readOnly) || !dirty || state.busy;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function renderDiff(target, diff) {
|
|
526
|
+
target.textContent = '';
|
|
527
|
+
if (!diff) {
|
|
528
|
+
const note = document.createElement('div');
|
|
529
|
+
note.className = 'diff-note';
|
|
530
|
+
note.textContent = '没有差异。';
|
|
531
|
+
target.appendChild(note);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
const lines = String(diff).split('\n');
|
|
535
|
+
for (const line of lines) {
|
|
536
|
+
if (line === '') continue;
|
|
537
|
+
const span = document.createElement('span');
|
|
538
|
+
span.className = 'diff-line';
|
|
539
|
+
if (line.startsWith('@@') || line.startsWith('---') || line.startsWith('+++') || line.startsWith('#')) {
|
|
540
|
+
span.classList.add('diff-meta');
|
|
541
|
+
} else if (line.startsWith('+')) {
|
|
542
|
+
span.classList.add('diff-add');
|
|
543
|
+
} else if (line.startsWith('-')) {
|
|
544
|
+
span.classList.add('diff-del');
|
|
545
|
+
}
|
|
546
|
+
span.textContent = line + '\n';
|
|
547
|
+
target.appendChild(span);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
async function openFile(path, row) {
|
|
552
|
+
try {
|
|
553
|
+
const info = await api('/api/file?path=' + encodeURIComponent(path));
|
|
554
|
+
state.file = info;
|
|
555
|
+
state.file.eol = info.content !== null && info.content.includes('\r\n') ? 'crlf' : 'lf';
|
|
556
|
+
state.dirty = false;
|
|
557
|
+
const editor = $('editor');
|
|
558
|
+
editor.value = info.content === null ? '' : normalized(info.content);
|
|
559
|
+
editor.disabled = Boolean(info.readOnly);
|
|
560
|
+
renderCrumbs(info.path);
|
|
561
|
+
setFileMeta(info);
|
|
562
|
+
markActive(info.path);
|
|
563
|
+
notice(info.readOnly ? info.note : '', '');
|
|
564
|
+
$('confirm').hidden = true;
|
|
565
|
+
$('sideTitle').textContent = 'Diff';
|
|
566
|
+
$('sideBody').textContent = '';
|
|
567
|
+
const hint = document.createElement('div');
|
|
568
|
+
hint.className = 'diff-note';
|
|
569
|
+
hint.textContent = info.readOnly ? info.note : '编辑后点“预览 diff”,确认改动后再保存。';
|
|
570
|
+
$('sideBody').appendChild(hint);
|
|
571
|
+
updateDirty();
|
|
572
|
+
} catch (error) {
|
|
573
|
+
toast(error.message, true);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
async function previewCurrent(showConfirm) {
|
|
578
|
+
if (!state.file || state.file.readOnly) return false;
|
|
579
|
+
state.busy = true;
|
|
580
|
+
updateDirty();
|
|
581
|
+
try {
|
|
582
|
+
const data = await api('/api/preview', {
|
|
583
|
+
method: 'POST',
|
|
584
|
+
body: JSON.stringify({ path: state.file.path, content: editorText() }),
|
|
585
|
+
});
|
|
586
|
+
if (!showConfirm) {
|
|
587
|
+
$('sideTitle').textContent = 'Diff';
|
|
588
|
+
$('sideBody').textContent = '';
|
|
589
|
+
renderDiff($('sideBody'), data.diff);
|
|
590
|
+
} else {
|
|
591
|
+
$('confirm').hidden = false;
|
|
592
|
+
$('confirmStats').textContent = data.identical
|
|
593
|
+
? '没有改动'
|
|
594
|
+
: '+' + data.stats.added + ' / -' + data.stats.removed;
|
|
595
|
+
renderDiff($('confirmDiff'), data.diff || '没有改动。');
|
|
596
|
+
$('confirmSave').disabled = data.identical;
|
|
597
|
+
}
|
|
598
|
+
return true;
|
|
599
|
+
} catch (error) {
|
|
600
|
+
toast(error.message, true);
|
|
601
|
+
return false;
|
|
602
|
+
} finally {
|
|
603
|
+
state.busy = false;
|
|
604
|
+
updateDirty();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
async function saveCurrent() {
|
|
609
|
+
if (!state.file || state.file.readOnly) return;
|
|
610
|
+
state.busy = true;
|
|
611
|
+
updateDirty();
|
|
612
|
+
try {
|
|
613
|
+
const data = await api('/api/save', {
|
|
614
|
+
method: 'POST',
|
|
615
|
+
body: JSON.stringify({
|
|
616
|
+
path: state.file.path,
|
|
617
|
+
content: editorText(),
|
|
618
|
+
expectedHash: state.file.hash,
|
|
619
|
+
expectedMtimeMs: state.file.mtimeMs,
|
|
620
|
+
}),
|
|
621
|
+
});
|
|
622
|
+
state.file.content = editorText();
|
|
623
|
+
state.file.hash = data.hash;
|
|
624
|
+
state.file.mtimeMs = data.mtimeMs;
|
|
625
|
+
state.file.size = data.size;
|
|
626
|
+
$('confirm').hidden = true;
|
|
627
|
+
setFileMeta(state.file);
|
|
628
|
+
notice('', '');
|
|
629
|
+
toast('已保存 ' + data.path);
|
|
630
|
+
updateDirty();
|
|
631
|
+
} catch (error) {
|
|
632
|
+
if (error.id === 'external-change') {
|
|
633
|
+
notice(error.message + ' 请重新打开该文件后再编辑。', 'error');
|
|
634
|
+
toast('保存被拒绝:文件已在磁盘上被改动', true);
|
|
635
|
+
} else {
|
|
636
|
+
notice(error.message, 'error');
|
|
637
|
+
toast(error.message, true);
|
|
638
|
+
}
|
|
639
|
+
} finally {
|
|
640
|
+
state.busy = false;
|
|
641
|
+
updateDirty();
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function renderRuns(runs) {
|
|
646
|
+
const box = $('runs');
|
|
647
|
+
box.textContent = '';
|
|
648
|
+
if (!runs.length) {
|
|
649
|
+
const empty = document.createElement('div');
|
|
650
|
+
empty.className = 'empty';
|
|
651
|
+
empty.textContent = '还没有 run 记录';
|
|
652
|
+
box.appendChild(empty);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
for (const run of runs) {
|
|
656
|
+
const button = document.createElement('button');
|
|
657
|
+
button.type = 'button';
|
|
658
|
+
button.className = 'run';
|
|
659
|
+
const top = document.createElement('div');
|
|
660
|
+
top.className = 'run-top';
|
|
661
|
+
top.appendChild(statusPill(run.status));
|
|
662
|
+
const id = document.createElement('span');
|
|
663
|
+
id.className = 'run-id';
|
|
664
|
+
id.textContent = String(run.id).slice(-12);
|
|
665
|
+
top.appendChild(id);
|
|
666
|
+
if (run.changedFiles !== null) {
|
|
667
|
+
const count = document.createElement('span');
|
|
668
|
+
count.className = 'run-id';
|
|
669
|
+
count.textContent = run.changedFiles + ' files';
|
|
670
|
+
top.appendChild(count);
|
|
671
|
+
}
|
|
672
|
+
const goal = document.createElement('div');
|
|
673
|
+
goal.className = 'run-goal';
|
|
674
|
+
goal.textContent = run.goal || '(no goal)';
|
|
675
|
+
button.append(top, goal);
|
|
676
|
+
button.addEventListener('click', () => openRun(run.id, button));
|
|
677
|
+
box.appendChild(button);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
async function openRun(runId, button) {
|
|
682
|
+
document.querySelectorAll('.run.active').forEach(node => node.classList.remove('active'));
|
|
683
|
+
if (button) button.classList.add('active');
|
|
684
|
+
state.activeRun = runId;
|
|
685
|
+
$('sideTitle').textContent = 'Run ' + String(runId).slice(-12);
|
|
686
|
+
const body = $('sideBody');
|
|
687
|
+
body.textContent = '';
|
|
688
|
+
const loading = document.createElement('div');
|
|
689
|
+
loading.className = 'diff-note';
|
|
690
|
+
loading.textContent = '正在读取 run…';
|
|
691
|
+
body.appendChild(loading);
|
|
692
|
+
try {
|
|
693
|
+
const run = await api('/api/runs/' + encodeURIComponent(runId));
|
|
694
|
+
body.textContent = '';
|
|
695
|
+
const head = document.createElement('div');
|
|
696
|
+
head.className = 'side-title';
|
|
697
|
+
head.textContent = (run.goal || '(no goal)');
|
|
698
|
+
body.appendChild(head);
|
|
699
|
+
const changes = run.changes && Array.isArray(run.changes.files) ? run.changes.files : null;
|
|
700
|
+
if (!changes) {
|
|
701
|
+
const note = document.createElement('div');
|
|
702
|
+
note.className = 'diff-note';
|
|
703
|
+
note.textContent = run.changes && run.changes.note
|
|
704
|
+
? run.changes.note
|
|
705
|
+
: '这个 run 没有记录改动文件(它可能在 workbench 关闭时启动)。';
|
|
706
|
+
body.appendChild(note);
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
if (run.changes.incomplete) {
|
|
710
|
+
const note = document.createElement('div');
|
|
711
|
+
note.className = 'diff-note';
|
|
712
|
+
note.textContent = run.changes.note || '这个 run 的改动清单不完整。';
|
|
713
|
+
body.appendChild(note);
|
|
714
|
+
}
|
|
715
|
+
if (!changes.length) {
|
|
716
|
+
const note = document.createElement('div');
|
|
717
|
+
note.className = 'diff-note';
|
|
718
|
+
note.textContent = '该 run 期间工作区没有文件变化。';
|
|
719
|
+
body.appendChild(note);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
const list = document.createElement('div');
|
|
723
|
+
list.className = 'change-list';
|
|
724
|
+
for (const item of changes) {
|
|
725
|
+
const row = document.createElement('button');
|
|
726
|
+
row.type = 'button';
|
|
727
|
+
row.className = 'change';
|
|
728
|
+
const tag = document.createElement('span');
|
|
729
|
+
tag.className = 'tag ' + item.change;
|
|
730
|
+
tag.textContent = item.change;
|
|
731
|
+
const name = document.createElement('span');
|
|
732
|
+
name.className = 'path';
|
|
733
|
+
name.textContent = item.path;
|
|
734
|
+
row.append(tag, name);
|
|
735
|
+
row.addEventListener('click', () => showRunDiff(runId, item.path));
|
|
736
|
+
list.appendChild(row);
|
|
737
|
+
}
|
|
738
|
+
body.appendChild(list);
|
|
739
|
+
const output = document.createElement('pre');
|
|
740
|
+
output.id = 'runDiff';
|
|
741
|
+
output.textContent = '选择一个文件查看 diff。';
|
|
742
|
+
body.appendChild(output);
|
|
743
|
+
} catch (error) {
|
|
744
|
+
body.textContent = '';
|
|
745
|
+
const note = document.createElement('div');
|
|
746
|
+
note.className = 'diff-note';
|
|
747
|
+
note.textContent = error.message;
|
|
748
|
+
body.appendChild(note);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
async function showRunDiff(runId, filePath) {
|
|
753
|
+
const output = $('runDiff');
|
|
754
|
+
if (!output) return;
|
|
755
|
+
output.textContent = '正在生成 diff…';
|
|
756
|
+
try {
|
|
757
|
+
const data = await api('/api/runs/' + encodeURIComponent(runId) + '/diff?path=' + encodeURIComponent(filePath));
|
|
758
|
+
output.textContent = '';
|
|
759
|
+
if (data.note) {
|
|
760
|
+
const note = document.createElement('div');
|
|
761
|
+
note.className = 'diff-note';
|
|
762
|
+
note.textContent = data.note;
|
|
763
|
+
output.appendChild(note);
|
|
764
|
+
}
|
|
765
|
+
renderDiff(output, data.diff);
|
|
766
|
+
} catch (error) {
|
|
767
|
+
output.textContent = error.message;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
async function boot() {
|
|
772
|
+
state.token = readToken();
|
|
773
|
+
if (!state.token) {
|
|
774
|
+
$('shell').hidden = true;
|
|
775
|
+
$('auth').hidden = false;
|
|
776
|
+
setConn(false, 'no token');
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
try {
|
|
780
|
+
const health = await api('/api/health');
|
|
781
|
+
$('rootPath').textContent = health.root;
|
|
782
|
+
setConn(true, 'local');
|
|
783
|
+
} catch (error) {
|
|
784
|
+
setConn(false, 'offline');
|
|
785
|
+
if (error.status === 401) {
|
|
786
|
+
$('shell').hidden = true;
|
|
787
|
+
$('auth').hidden = false;
|
|
788
|
+
sessionStorage.removeItem('dsh-workbench-token');
|
|
789
|
+
} else {
|
|
790
|
+
toast(error.message, true);
|
|
791
|
+
}
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
try {
|
|
795
|
+
const tree = await api('/api/tree?path=.');
|
|
796
|
+
renderTree($('tree'), tree.entries);
|
|
797
|
+
} catch (error) {
|
|
798
|
+
$('tree').textContent = error.message;
|
|
799
|
+
}
|
|
800
|
+
try {
|
|
801
|
+
const data = await api('/api/runs');
|
|
802
|
+
renderRuns(data.runs || []);
|
|
803
|
+
} catch (error) {
|
|
804
|
+
$('runs').textContent = error.message;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
$('refreshTree').addEventListener('click', async () => {
|
|
809
|
+
try {
|
|
810
|
+
const tree = await api('/api/tree?path=.');
|
|
811
|
+
renderTree($('tree'), tree.entries);
|
|
812
|
+
} catch (error) { toast(error.message, true); }
|
|
813
|
+
});
|
|
814
|
+
$('refreshRuns').addEventListener('click', async () => {
|
|
815
|
+
try {
|
|
816
|
+
const data = await api('/api/runs');
|
|
817
|
+
renderRuns(data.runs || []);
|
|
818
|
+
} catch (error) { toast(error.message, true); }
|
|
819
|
+
});
|
|
820
|
+
$('previewBtn').addEventListener('click', () => previewCurrent(false));
|
|
821
|
+
$('saveBtn').addEventListener('click', () => previewCurrent(true));
|
|
822
|
+
$('cancelSave').addEventListener('click', () => { $('confirm').hidden = true; });
|
|
823
|
+
$('confirmSave').addEventListener('click', saveCurrent);
|
|
824
|
+
$('editor').addEventListener('input', updateDirty);
|
|
825
|
+
$('editor').addEventListener('keydown', event => {
|
|
826
|
+
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') {
|
|
827
|
+
event.preventDefault();
|
|
828
|
+
if (state.dirty) previewCurrent(true);
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
|
|
832
|
+
boot();
|
|
833
|
+
})();
|
|
834
|
+
</script>
|
|
835
|
+
</body>
|
|
836
|
+
</html>
|