Migrate updater LAN and devkit features from old repo
This commit is contained in:
@@ -41,6 +41,10 @@
|
||||
export let importActionLabel = "";
|
||||
export let connectionNotice = "";
|
||||
export let connectionNoticeTone: HudNoticeTone = "info";
|
||||
export let noticeConfirmLabel = "";
|
||||
export let noticeCancelLabel = "";
|
||||
export let noticeShowActions = false;
|
||||
export let noticeActionBusy = false;
|
||||
export let isRefreshingPorts = false;
|
||||
export let isConnectDisabled = false;
|
||||
export let isExporting = false;
|
||||
@@ -58,6 +62,8 @@
|
||||
serialexport: void;
|
||||
csvimport: void;
|
||||
noticeclear: void;
|
||||
noticeconfirm: void;
|
||||
noticecancel: void;
|
||||
}>();
|
||||
|
||||
const connectionToneByState: Record<ConnectionState, "ok" | "warn" | "idle"> = {
|
||||
@@ -123,6 +129,14 @@
|
||||
function emitNoticeClear(): void {
|
||||
dispatch("noticeclear");
|
||||
}
|
||||
|
||||
function emitNoticeConfirm(): void {
|
||||
dispatch("noticeconfirm");
|
||||
}
|
||||
|
||||
function emitNoticeCancel(): void {
|
||||
dispatch("noticecancel");
|
||||
}
|
||||
</script>
|
||||
|
||||
<section class="hud-panel" aria-label={controlAreaLabel}>
|
||||
@@ -301,14 +315,25 @@
|
||||
{#if connectionNotice}
|
||||
<div class="connection-notice tone-{connectionNoticeTone}" role={connectionNoticeTone === "warn" ? "alert" : "status"}>
|
||||
<p class="connection-notice-text">{connectionNotice}</p>
|
||||
<button
|
||||
type="button"
|
||||
class="notice-close-btn"
|
||||
aria-label={locale === "zh-CN" ? "关闭提示" : "Dismiss notice"}
|
||||
on:click={emitNoticeClear}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
{#if noticeShowActions}
|
||||
<div class="notice-actions">
|
||||
<button type="button" class="notice-action-btn is-primary" disabled={noticeActionBusy} on:click={emitNoticeConfirm}>
|
||||
{noticeActionBusy ? (locale === "zh-CN" ? "处理中..." : "Working...") : noticeConfirmLabel}
|
||||
</button>
|
||||
<button type="button" class="notice-action-btn" disabled={noticeActionBusy} on:click={emitNoticeCancel}>
|
||||
{noticeCancelLabel}
|
||||
</button>
|
||||
</div>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="notice-close-btn"
|
||||
aria-label={locale === "zh-CN" ? "关闭提示" : "Dismiss notice"}
|
||||
on:click={emitNoticeClear}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -921,6 +946,58 @@
|
||||
background: rgb(9 16 22 / 0.92);
|
||||
}
|
||||
|
||||
.notice-actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.42rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.notice-action-btn {
|
||||
min-block-size: 1.55rem;
|
||||
border: 1px solid rgb(116 151 176 / 0.38);
|
||||
border-radius: 999px;
|
||||
padding: 0.24rem 0.72rem;
|
||||
background: rgb(7 12 16 / 0.76);
|
||||
color: rgb(194 225 245 / 0.94);
|
||||
font-size: 0.68rem;
|
||||
letter-spacing: 0.04em;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
border-color 180ms ease,
|
||||
color 180ms ease,
|
||||
background-color 180ms ease,
|
||||
box-shadow 200ms ease,
|
||||
opacity 180ms ease;
|
||||
}
|
||||
|
||||
.notice-action-btn:hover:not(:disabled) {
|
||||
border-color: rgb(62 232 255 / 0.46);
|
||||
color: rgb(237 250 255 / 0.98);
|
||||
background: rgb(9 16 22 / 0.92);
|
||||
}
|
||||
|
||||
.notice-action-btn.is-primary {
|
||||
border-color: rgb(var(--hud-lime-rgb) / 0.44);
|
||||
background:
|
||||
linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.94), rgb(var(--hud-surface-rgb) / 0.88)),
|
||||
radial-gradient(circle at 50% 0, rgb(var(--hud-lime-rgb) / 0.14), transparent 58%);
|
||||
color: rgb(var(--hud-text-main-rgb) / 0.98);
|
||||
box-shadow: 0 0 10px rgb(var(--hud-lime-rgb) / 0.08);
|
||||
}
|
||||
|
||||
.notice-action-btn.is-primary:hover:not(:disabled) {
|
||||
border-color: rgb(var(--hud-lime-rgb) / 0.62);
|
||||
box-shadow:
|
||||
inset 0 0 0 1px rgb(var(--hud-text-main-rgb) / 0.08),
|
||||
0 0 13px rgb(var(--hud-lime-rgb) / 0.14);
|
||||
}
|
||||
|
||||
.notice-action-btn:disabled {
|
||||
cursor: default;
|
||||
opacity: 0.64;
|
||||
}
|
||||
|
||||
.connection-notice.tone-warn .notice-close-btn:hover {
|
||||
border-color: rgb(255 91 63 / 0.6);
|
||||
color: rgb(255 227 220 / 0.98);
|
||||
@@ -1139,4 +1216,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user