Skip to content

Commit daeda28

Browse files
committed
Bug fix.
1 parent f154534 commit daeda28

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

frontend/src/admin/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,13 +1116,18 @@ function confirmAction(options: ConfirmActionOptions): Promise<boolean> {
11161116
dialog.innerHTML = `
11171117
<div class="admin-dialog-body is-small">
11181118
<header>
1119-
<h2>${escapeHtml(options.title)}</h2>
1119+
<h2 style="display: flex; align-items: center; gap: 8px;">
1120+
${icon(options.danger ? 'alert' : 'info', 'admin-button-svg')}
1121+
${escapeHtml(options.title)}
1122+
</h2>
11201123
<button type="button" class="admin-dialog-close" data-dialog-cancel>×</button>
11211124
</header>
1122-
<p class="admin-confirm-message">${escapeHtml(options.message)}</p>
1125+
<div style="padding: 6px 4px 16px 4px;">
1126+
<p class="admin-confirm-message" style="font-size: 14px; color: rgba(0, 0, 0, 0.72); font-weight: 500;">${escapeHtml(options.message)}</p>
1127+
</div>
11231128
<footer>
1124-
<button class="admin-button is-ghost" type="button" data-dialog-cancel data-form-action="cancel">${icon('cancel', 'admin-button-svg')}<span>取消</span></button>
1125-
<button class="admin-button is-ghost" type="button" data-confirm-action data-form-action="${options.danger ? 'danger' : 'confirm'}">
1129+
<button class="admin-button is-ghost" type="button" data-dialog-cancel data-form-action="cancel"><span>取消</span></button>
1130+
<button class="admin-button" type="button" data-confirm-action data-form-action="${options.danger ? 'danger' : 'confirm'}" style="background: ${options.danger ? 'var(--danger-color, #ef4444)' : 'var(--primary-color, #3b82f6)'}; color: #fff; border: none; box-shadow: 0 4px 12px ${options.danger ? 'rgba(239, 68, 68, 0.3)' : 'rgba(59, 130, 246, 0.3)'};">
11261131
${icon(options.danger ? 'trash' : 'play', 'admin-button-svg')}<span>${escapeHtml(options.confirmLabel)}</span>
11271132
</button>
11281133
</footer>

frontend/src/style.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,8 @@ i.fl-tux {
24302430
}
24312431

24322432
.admin-dialog {
2433-
width: min(760px, calc(100vw - 28px));
2433+
width: fit-content;
2434+
max-width: calc(100vw - 28px);
24342435
max-height: calc(100vh - 48px);
24352436
padding: 0;
24362437
border: 1px solid var(--glass-border);
@@ -2447,13 +2448,16 @@ i.fl-tux {
24472448
}
24482449

24492450
.admin-dialog-body {
2451+
width: min(760px, calc(100vw - 28px));
24502452
display: grid;
2451-
gap: 12px;
2453+
gap: 16px;
24522454
padding: 14px;
24532455
}
24542456

24552457
.admin-dialog-body.is-small {
2456-
width: min(420px, calc(100vw - 28px));
2458+
width: fit-content;
2459+
min-width: 340px;
2460+
max-width: min(480px, calc(100vw - 28px));
24572461
}
24582462

24592463
.admin-dialog-body header,

0 commit comments

Comments
 (0)