Skip to content

Commit 9bf18e6

Browse files
committed
chore: update webui
1 parent 841fe17 commit 9bf18e6

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

cmd/runner-manager/templates/index.html

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
.btn-start:hover { opacity: 0.9; }
9090
.btn-stop { padding: 4px 10px; font-size: 12px; margin-right: 6px; background: rgba(248, 81, 73, 0.2); color: var(--danger); border: 1px solid var(--danger); border-radius: 4px; cursor: pointer; }
9191
.btn-stop:hover { opacity: 0.9; }
92+
.btn-save { padding: 4px 10px; font-size: 12px; margin-right: 6px; background: rgba(88, 166, 255, 0.2); color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; cursor: pointer; }
93+
.btn-save:hover { opacity: 0.9; }
94+
.btn-edit-primary { padding: 4px 10px; font-size: 12px; margin-right: 6px; background: rgba(210, 153, 34, 0.2); color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; cursor: pointer; }
95+
.btn-edit-primary:hover { opacity: 0.9; }
9296
.modal-overlay {
9397
display: none;
9498
position: fixed;
@@ -111,8 +115,17 @@
111115
}
112116
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
113117
.modal-header h3 { margin: 0; font-size: 1rem; }
114-
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; padding: 0 4px; }
115-
.modal-close:hover { color: var(--text); }
118+
.modal-close {
119+
padding: 4px 10px;
120+
font-size: 12px;
121+
margin-right: 6px;
122+
background: rgba(139, 148, 158, 0.15);
123+
color: var(--muted);
124+
border: 1px solid var(--border);
125+
border-radius: 4px;
126+
cursor: pointer;
127+
}
128+
.modal-close:hover { color: var(--text); border-color: var(--text); opacity: 0.9; }
116129
.modal-body { padding: 20px; }
117130
.modal-body .row { margin-bottom: 12px; }
118131
.modal-body .row label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
@@ -158,10 +171,10 @@
158171
}
159172
.parse-box label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
160173
.parse-box code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
161-
.parse-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
174+
.parse-row { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
162175
.parse-row textarea {
163-
flex: 1;
164-
min-width: 280px;
176+
width: 100%;
177+
min-width: 0;
165178
padding: 10px 12px;
166179
background: var(--bg);
167180
border: 1px solid var(--border);
@@ -171,6 +184,7 @@
171184
font-size: 13px;
172185
resize: vertical;
173186
}
187+
.parse-btn-row { align-self: flex-start; }
174188
.btn-parse {
175189
padding: 10px 16px;
176190
background: var(--accent);
@@ -276,8 +290,12 @@ <h2>{{index .T "form.quick_add"}}</h2>
276290
<div class="parse-box">
277291
<label>{{index .T "parse.label"}}</label>
278292
<div class="parse-row">
279-
<textarea id="githubCommandInput" rows="3" placeholder="{{index .T "parse.placeholder"}}"></textarea>
280-
<button type="button" id="parseCommandBtn" class="btn-parse">{{index .T "parse.btn"}}</button>
293+
<div>
294+
<textarea id="githubCommandInput" rows="3" placeholder="{{index .T "parse.placeholder"}}"></textarea>
295+
</div>
296+
<div class="parse-btn-row">
297+
<button type="button" id="parseCommandBtn" class="btn-parse">{{index .T "parse.btn"}}</button>
298+
</div>
281299
</div>
282300
<div id="parseMsg" class="parse-msg"></div>
283301
</div>
@@ -297,7 +315,9 @@ <h2>{{index .T "form.quick_add"}}</h2>
297315
<input name="labelsStr" id="addFormLabelsStr" placeholder="{{index .T "form.labels_placeholder"}}">
298316
<label>{{index .T "form.token_label"}}</label>
299317
<input name="registration_token" id="addFormToken" type="password" placeholder="{{index .T "form.token_placeholder"}}">
300-
<button type="submit">{{index .T "form.submit"}}</button>
318+
<div>
319+
<button type="submit">{{index .T "form.submit"}}</button>
320+
</div>
301321
</form>
302322
<div id="addMsgWrap" class="msg-wrap" style="display: none;">
303323
<div id="addMsg" class="msg"></div>
@@ -346,8 +366,8 @@ <h3 id="modalTitle">{{index .T "modal.title"}}</h3>
346366
<button type="button" id="modalStartBtnFooter" class="btn-start" style="display:none">{{index .T "modal.btn_start"}}</button>
347367
<button type="button" id="modalStopBtnFooter" class="btn-stop" style="display:none">{{index .T "modal.btn_stop"}}</button>
348368
</span>
349-
<button type="button" id="modalEditBtn" style="display:none">{{index .T "modal.btn_edit"}}</button>
350-
<button type="button" id="modalSaveBtn" style="display:none">{{index .T "modal.btn_save"}}</button>
369+
<button type="button" id="modalEditBtn" class="btn-edit-primary" style="display:none">{{index .T "modal.btn_edit"}}</button>
370+
<button type="button" id="modalSaveBtn" class="btn-save" style="display:none">{{index .T "modal.btn_save"}}</button>
351371
<button type="button" class="modal-close" id="modalCancelBtn">{{index .T "modal.btn_close"}}</button>
352372
</div>
353373
</div>
@@ -649,6 +669,7 @@ <h3 id="modalTitle">{{index .T "modal.title"}}</h3>
649669
document.getElementById('modalClose').addEventListener('click', closeModal);
650670
document.getElementById('modalCancelBtn').addEventListener('click', closeModal);
651671
modal.addEventListener('click', (e) => { if (e.target === modal) closeModal(); });
672+
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && modal.classList.contains('show')) closeModal(); });
652673

653674
document.getElementById('modalEditBtn').addEventListener('click', () => {
654675
const name = document.getElementById('vName').textContent;

0 commit comments

Comments
 (0)