Files
Scoreboard/console/renderer/styles.css
T
AskaEth 1b78c38bb8 feat(console): 开机自启默认关闭,服务管理窗口加手动开关
- DEFAULTS.startup.openAtLogin 与随包 config.json 默认改为 false;
  applyOpenAtLogin 只有显式 true 才注册登录项(缺省/null/false 都不注册)
- config.js 新增 updateConfig():只写回文件里已有的键 + 目标键,不把 DEFAULTS 落盘
- 主进程 setOpenAtLogin():改内存 → 写回 config.json → setLoginItemSettings,
  任一失败都回滚,返回 {ok, openAtLogin};状态快照新增 openAtLogin / openAtLoginSupported
- 渲染层:服务端状态卡片新增「开机自启」滑块(纯 CSS,无依赖),
  切换即时生效并有本地意图守卫,避免被随后到达的陈旧快照冲掉
- 文档:console/README.md 与 docs/部署指南.md 同步

注意:旧包 config.json 里已显式写 true 的用户升级后仍会自启(不悄悄改既有行为),
在窗口里关一次即可;全新安装默认不注册。
2026-09-10 00:06:59 +08:00

474 lines
7.4 KiB
CSS

:root {
--bg: #0f1420;
--panel: #161d2d;
--panel-2: #1d2637;
--border: #27314a;
--text: #e6ecf7;
--muted: #8b98b4;
--accent: #4fd8ff;
--ok: #3ddc97;
--warn: #ffb454;
--err: #ff6b6b;
}
* {
box-sizing: border-box;
}
html,
body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
background: var(--bg);
color: var(--text);
font: 14px/1.5 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
height: 50px;
flex: 0 0 auto;
padding: 0 8px 0 16px;
border-bottom: 1px solid var(--border);
background: var(--panel);
/* 整条标题栏拖拽,按钮区单独开洞,否则按钮点不动 */
-webkit-app-region: drag;
user-select: none;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
}
.brand-mark {
width: 30px;
height: 30px;
border-radius: 8px;
object-fit: cover;
flex: none;
}
h1 {
margin: 0;
font-size: 15px;
font-weight: 600;
line-height: 1.25;
letter-spacing: 0.02em;
}
.brand-sub {
margin: 0;
font-size: 11px;
line-height: 1.3;
color: var(--muted);
}
.topbar-right {
display: flex;
align-items: center;
gap: 12px;
}
.win-controls {
display: flex;
align-items: center;
gap: 4px;
-webkit-app-region: no-drag;
}
.win-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 32px;
padding: 0;
border: 1px solid transparent;
border-radius: 8px;
background: transparent;
color: var(--muted);
cursor: pointer;
transition:
background 0.15s ease,
color 0.15s ease,
border-color 0.15s ease;
}
.win-btn svg {
fill: none;
stroke: currentColor;
stroke-width: 1.7;
stroke-linecap: round;
stroke-linejoin: round;
}
.win-btn:hover {
background: rgba(255, 255, 255, 0.08);
color: var(--text);
}
.win-btn:active {
background: rgba(255, 255, 255, 0.14);
}
.win-btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -2px;
}
/* 关闭键是唯一的破坏性操作,hover 变红做区分 */
.win-btn-close:hover {
border-color: var(--err);
background: var(--err);
color: #fff;
}
.win-btn .icon-restore {
display: none;
}
.win-btn.is-maximized .icon-max {
display: none;
}
.win-btn.is-maximized .icon-restore {
display: block;
}
main {
flex: 1;
min-height: 0;
padding: 16px 20px 20px;
display: grid;
gap: 14px;
grid-template-columns: 1fr 1fr;
/* 五张卡片各占一整行;最后一行(运行日志)吃掉剩余高度 */
grid-template-rows: auto auto auto auto minmax(160px, 1fr);
overflow: auto;
}
.card {
grid-column: span 2;
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--panel);
}
.log-card {
display: flex;
flex-direction: column;
min-height: 0;
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
h2 {
margin: 0;
font-size: 13px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.actions {
display: flex;
gap: 8px;
align-items: center;
}
.btn {
padding: 6px 14px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--panel-2);
color: var(--text);
font-size: 13px;
cursor: pointer;
}
.btn:hover:not(:disabled) {
border-color: var(--accent);
}
.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.btn.primary {
border-color: transparent;
background: var(--accent);
color: #06202b;
font-weight: 600;
}
.status-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
font-size: 15px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--muted);
}
.dot.ok {
background: var(--ok);
box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15);
}
.dot.warn {
background: var(--warn);
box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.15);
}
.dot.err {
background: var(--err);
box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}
.muted {
color: var(--muted);
}
.kv {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 10px 16px;
margin: 0;
}
.kv > div.wide {
grid-column: span 2;
}
.kv dt {
margin: 0;
font-size: 12px;
color: var(--muted);
}
.kv dd {
margin: 2px 0 0;
word-break: break-all;
}
.mono {
font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12px;
}
.warning {
margin: 12px 0 0;
padding: 8px 10px;
border-radius: 6px;
background: rgba(255, 180, 84, 0.12);
color: var(--warn);
font-size: 12px;
}
.hint {
margin: 0 0 10px;
font-size: 12px;
color: var(--muted);
}
.display-list {
margin: 0;
padding: 0;
list-style: none;
display: grid;
gap: 6px;
}
.display-list li {
display: flex;
gap: 10px;
padding: 8px 10px;
border-radius: 6px;
background: var(--panel-2);
font-size: 13px;
}
.display-list .page {
min-width: 96px;
color: var(--accent);
font-weight: 600;
}
.display-list .url {
color: var(--muted);
font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12px;
word-break: break-all;
}
.display-list .state {
margin-left: auto;
flex: none;
font-weight: 600;
}
.display-list .state.online {
color: var(--ok);
}
.display-list .state.offline {
color: var(--muted);
}
.check {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--muted);
cursor: pointer;
}
/* 滑块式开关:勾选后轨道变强调色,不依赖任何第三方样式 */
.switch {
display: inline-flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
.switch input {
appearance: none;
-webkit-appearance: none;
position: relative;
flex: none;
width: 34px;
height: 18px;
margin: 0;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--panel-2);
cursor: pointer;
transition:
background 0.15s ease,
border-color 0.15s ease;
}
.switch input::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--muted);
transition:
transform 0.15s ease,
background 0.15s ease;
}
.switch input:checked {
border-color: var(--accent);
background: var(--accent);
}
.switch input:checked::after {
transform: translateX(16px);
background: #06202b;
}
.switch input:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.switch input:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.form-row {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px 16px;
}
.field {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
color: var(--muted);
}
.input {
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: 6px;
background: #0a0e17;
color: var(--text);
font: inherit;
font-size: 13px;
}
.input:focus {
outline: none;
border-color: var(--accent);
}
.input:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.hint.ok {
color: var(--ok);
}
.hint.err {
color: var(--err);
}
.log {
flex: 1;
min-height: 0;
margin: 0;
padding: 10px 12px;
overflow: auto;
border-radius: 8px;
background: #0a0e17;
color: #b9c6e0;
font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12px;
line-height: 1.55;
white-space: pre-wrap;
word-break: break-all;
}
/* 账号重置的输出框沿用 .log 的终端样式,但要限高、别把卡片撑开 */
.account-output {
max-height: 180px;
margin: 10px 0 0;
}