mirror of
https://github.com/YuleBest/LuminPro.git
synced 2026-12-04 00:54:42 +08:00
Merge branch 'dev' into beta
This commit is contained in:
commit
66a1749948
12 files changed
+178
-101
No files matched your search
@@ -63,17 +63,19 @@ const ok = (obj) => ({ ok: true, errno: 0, stdout: JSON.stringify(obj), stderr:
|
||||
|
||||
/** 依据命令内容返回模拟响应;无法识别时返回 null */
|
||||
export function devMock(command) {
|
||||
if (command.includes(' config read')) return ok(mockConfig())
|
||||
if (command.includes(' config patch') || command.includes(' config set')) return ok({ ok: true })
|
||||
if (command.includes(' status')) return ok(mockStatus(!command.includes('--no-display')))
|
||||
if (command.includes(' oplock')) return ok({ locked: false, seconds: 0 })
|
||||
if (command.includes(' focus')) return ok({ focus: 'com.example.video/.MainActivity' })
|
||||
if (command.includes(' brightness set')) return ok({ ok: true, value: 2000 })
|
||||
if (command.includes(' log tail')) {
|
||||
// 参数经 shellQuote 包装过,比较前先去掉单引号
|
||||
const plain = command.replace(/'/g, '')
|
||||
if (plain.includes(' config read')) return ok(mockConfig())
|
||||
if (plain.includes(' config patch') || plain.includes(' config set')) return ok({ ok: true })
|
||||
if (plain.includes(' status')) return ok(mockStatus(!plain.includes('--no-display')))
|
||||
if (plain.includes(' oplock')) return ok({ locked: false, seconds: 0 })
|
||||
if (plain.includes(' focus')) return ok({ focus: 'com.example.video/.MainActivity' })
|
||||
if (plain.includes(' brightness set')) return ok({ ok: true, value: 2000 })
|
||||
if (plain.includes(' log tail')) {
|
||||
return ok({ entries: mockLogEntries, sizeKB: 12, total: mockLogEntries.length })
|
||||
}
|
||||
if (command.includes(' log clear') || command.includes(' log export')) return ok({ ok: true })
|
||||
if (command.includes('boost') || command.includes('restart') || command.includes('action.sh')) {
|
||||
if (plain.includes(' log clear') || plain.includes(' log export')) return ok({ ok: true })
|
||||
if (plain.includes('boost') || plain.includes('restart') || plain.includes('action.sh')) {
|
||||
return { ok: true, errno: 0, stdout: 'LuminPro: 服务已启用', stderr: '' }
|
||||
}
|
||||
return null
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script setup>
|
||||
import { ref, watch, nextTick } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { MoreVertical } from 'lucide-vue-next'
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
items: { type: Array, default: () => [] }, // [{ key, label }]
|
||||
title: { type: String, default: '更多' },
|
||||
disabled: { type: Boolean, default: false },
|
||||
@@ -13,13 +13,13 @@ const open = ref(false)
|
||||
const anchorEl = ref(null)
|
||||
const menuEl = ref(null)
|
||||
|
||||
async function toggle() {
|
||||
function toggle() {
|
||||
const menu = menuEl.value
|
||||
if (!menu) return
|
||||
// 注意:md-menu 的 anchor 是 idref 字符串,元素引用必须用 anchorElement;
|
||||
// 且必须在打开前设置——菜单打开时会立刻按锚点定位
|
||||
if (anchorEl.value) menu.anchorElement = anchorEl.value
|
||||
open.value = !open.value
|
||||
if (open.value) {
|
||||
await nextTick()
|
||||
// MWC 菜单需要通过属性接收锚点元素(不能用 attribute 绑定)
|
||||
if (menuEl.value && anchorEl.value) menuEl.value.anchor = anchorEl.value
|
||||
}
|
||||
}
|
||||
|
||||
function pick(item) {
|
||||
@@ -32,9 +32,14 @@ function pick(item) {
|
||||
<md-icon-button ref="anchorEl" :title="title" :disabled="disabled" @click="toggle">
|
||||
<MoreVertical :size="20" />
|
||||
</md-icon-button>
|
||||
<md-menu ref="menuEl" :open="open" @closed="open = false">
|
||||
<md-menu-item v-for="item in items" :key="item.key" @click="pick(item)">
|
||||
<span slot="headline">{{ item.label }}</span>
|
||||
</md-menu-item>
|
||||
</md-menu>
|
||||
<!-- 菜单挂到 body 并用窗口定位:
|
||||
页面滑轨带 transform,若菜单留在原地,包含块会变成 .page-track,
|
||||
再被 .page-viewport 的 overflow:hidden 裁掉(表现为点了没反应) -->
|
||||
<Teleport to="body">
|
||||
<md-menu ref="menuEl" positioning="fixed" :open="open" @closed="open = false">
|
||||
<md-menu-item v-for="item in items" :key="item.key" @click="pick(item)">
|
||||
<span slot="headline">{{ item.label }}</span>
|
||||
</md-menu-item>
|
||||
</md-menu>
|
||||
</Teleport>
|
||||
</template>
|
||||
@@ -1,10 +1,9 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { RefreshCw, Pause, Play, RotateCw } from 'lucide-vue-next'
|
||||
import { Pause, Play } from 'lucide-vue-next'
|
||||
import ActionMenu from './ActionMenu.vue'
|
||||
|
||||
const props = defineProps({
|
||||
title: { type: String, default: 'LuminPro' },
|
||||
subtitle: { type: String, default: '' },
|
||||
version: { type: String, default: '' },
|
||||
statusText: { type: String, default: '—' },
|
||||
statusClass: { type: String, default: 'stopped' },
|
||||
@@ -13,7 +12,7 @@ const props = defineProps({
|
||||
scrolled: { type: Boolean, default: false },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['refresh', 'toggle-service', 'restart'])
|
||||
const emit = defineEmits(['toggle-service', 'refresh', 'restart'])
|
||||
|
||||
/** 通道徽标:版本号里带 -beta / -dev 即为对应通道 */
|
||||
const channel = computed(() => {
|
||||
@@ -22,27 +21,34 @@ const channel = computed(() => {
|
||||
if (v.includes('-dev')) return 'Dev'
|
||||
return ''
|
||||
})
|
||||
|
||||
// 刷新与重启都收进「更多」:文字标签比图标更不容易混淆
|
||||
const menuItems = [
|
||||
{ key: 'refresh', label: '刷新状态' },
|
||||
{ key: 'restart', label: '重启模块' },
|
||||
]
|
||||
|
||||
function onMenuSelect(key) {
|
||||
if (key === 'refresh') emit('refresh')
|
||||
else if (key === 'restart') emit('restart')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="app-bar" :class="{ scrolled }">
|
||||
<div class="app-bar__text">
|
||||
<h1 class="app-bar__title ts-title-lg">
|
||||
{{ title }}
|
||||
LuminPro
|
||||
<span v-if="channel" class="channel-badge">{{ channel }}</span>
|
||||
</h1>
|
||||
<span class="app-bar__subtitle ts-body-sm">{{ subtitle || version || '—' }}</span>
|
||||
<span class="app-bar__meta ts-body-sm">
|
||||
<span class="status-dot" :class="statusClass"></span>
|
||||
{{ statusText }}
|
||||
<template v-if="version"> · {{ version }}</template>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span class="status-pill" :class="statusClass">
|
||||
<span class="status-pill__dot"></span>
|
||||
{{ statusText }}
|
||||
</span>
|
||||
|
||||
<div class="app-bar__actions">
|
||||
<md-icon-button title="刷新" @click="emit('refresh')">
|
||||
<RefreshCw :size="20" />
|
||||
</md-icon-button>
|
||||
<md-icon-button
|
||||
:title="paused ? '启用' : '暂停'"
|
||||
:disabled="locked"
|
||||
@@ -51,9 +57,7 @@ const channel = computed(() => {
|
||||
<Play v-if="paused" :size="20" />
|
||||
<Pause v-else :size="20" />
|
||||
</md-icon-button>
|
||||
<md-icon-button title="重启模块" :disabled="locked" @click="emit('restart')">
|
||||
<RotateCw :size="20" />
|
||||
</md-icon-button>
|
||||
<ActionMenu :items="menuItems" :disabled="locked" title="更多操作" @select="onMenuSelect" />
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
@@ -89,6 +89,21 @@ export function useConfig() {
|
||||
return patch
|
||||
}
|
||||
|
||||
/** 整型开关字段(0/1)与布尔值之间的桥接:md-switch 给出的是布尔值 */
|
||||
function intBool(key) {
|
||||
return computed({
|
||||
get: () => Number(form[key]) === 1,
|
||||
set: (on) => {
|
||||
form[key] = on ? '1' : '0'
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const autoBriSleep = intBool('auto_bri_sleep')
|
||||
const displayHdrSleep = intBool('display_hdr_sleep')
|
||||
const compatibilityMode = intBool('compatibility_mode')
|
||||
const debugMode = intBool('debug_mode')
|
||||
|
||||
const diffMain = computed(() => changedKeys(MAIN_KEYS))
|
||||
const diffAdvanced = computed(() => changedKeys(ADVANCED_KEYS))
|
||||
const dirtyMain = computed(() => Object.keys(diffMain.value).length > 0)
|
||||
@@ -157,6 +172,10 @@ export function useConfig() {
|
||||
error,
|
||||
dirtyMain,
|
||||
dirtyAdvanced,
|
||||
autoBriSleep,
|
||||
displayHdrSleep,
|
||||
compatibilityMode,
|
||||
debugMode,
|
||||
load,
|
||||
saveMain,
|
||||
saveAdvanced,
|
||||
|
||||
+36
-48
@@ -22,9 +22,9 @@
|
||||
align-items: center;
|
||||
gap: var(--md-sys-spacing-1);
|
||||
min-height: 64px;
|
||||
padding: var(--md-sys-spacing-2) var(--md-sys-spacing-1) var(--md-sys-spacing-2)
|
||||
var(--md-sys-spacing-4);
|
||||
background-color: var(--md-sys-color-surface);
|
||||
padding: calc(var(--md-sys-spacing-2) + var(--safe-area-inset-top, var(--window-inset-top, 0px)))
|
||||
var(--md-sys-spacing-1) var(--md-sys-spacing-2) var(--md-sys-spacing-4);
|
||||
background-color: var(--md-sys-color-background);
|
||||
transition: background-color var(--md-sys-motion-duration-medium2)
|
||||
var(--md-sys-motion-easing-standard);
|
||||
}
|
||||
@@ -49,10 +49,35 @@
|
||||
gap: var(--md-sys-spacing-2);
|
||||
}
|
||||
|
||||
.app-bar__subtitle {
|
||||
.app-bar__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
flex: 0 0 auto;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--md-sys-color-outline);
|
||||
}
|
||||
|
||||
.status-dot.running {
|
||||
background-color: var(--lp-color-success);
|
||||
animation: status-pulse 2.4s var(--md-sys-motion-easing-standard) infinite;
|
||||
}
|
||||
|
||||
.status-dot.paused {
|
||||
background-color: var(--lp-color-warning);
|
||||
}
|
||||
|
||||
.status-dot.stopped {
|
||||
background-color: var(--md-sys-color-error);
|
||||
animation: status-pulse 2s var(--md-sys-motion-easing-standard) infinite;
|
||||
}
|
||||
|
||||
/* 发布通道徽标(Beta / Dev) */
|
||||
.channel-badge {
|
||||
flex: 0 0 auto;
|
||||
@@ -66,42 +91,6 @@
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* 守护进程状态胶囊 */
|
||||
.status-pill {
|
||||
flex: 0 0 auto;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 10px;
|
||||
border-radius: var(--md-sys-shape-corner-full);
|
||||
background-color: var(--md-sys-color-surface-container-high);
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
font-size: var(--md-sys-typescale-label-small-size);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.status-pill__dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--md-sys-color-outline);
|
||||
}
|
||||
|
||||
.status-pill.running .status-pill__dot {
|
||||
background-color: var(--lp-color-success);
|
||||
box-shadow: 0 0 8px var(--lp-color-success-container);
|
||||
animation: status-pulse 2.4s var(--md-sys-motion-easing-standard) infinite;
|
||||
}
|
||||
|
||||
.status-pill.paused .status-pill__dot {
|
||||
background-color: var(--lp-color-warning);
|
||||
}
|
||||
|
||||
.status-pill.stopped .status-pill__dot {
|
||||
background-color: var(--md-sys-color-error);
|
||||
animation: status-pulse 2s var(--md-sys-motion-easing-standard) infinite;
|
||||
}
|
||||
|
||||
@keyframes status-pulse {
|
||||
0%,
|
||||
100% {
|
||||
@@ -144,14 +133,15 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--md-sys-spacing-3);
|
||||
padding: var(--md-sys-spacing-3) var(--md-sys-spacing-3)
|
||||
calc(var(--md-sys-spacing-5) + var(--safe-area-inset-bottom, 0px));
|
||||
padding: var(--md-sys-spacing-3) var(--md-sys-spacing-3) var(--md-sys-spacing-5);
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
/* ── M3 导航栏 ────────────────────────────────────────────────────── */
|
||||
md-navigation-bar {
|
||||
flex: 0 0 auto;
|
||||
/* 背景延伸到屏幕底部,内容抬到手势条之上 */
|
||||
padding-bottom: var(--safe-area-inset-bottom, var(--window-inset-bottom, 0px));
|
||||
--md-navigation-bar-container-color: var(--md-sys-color-surface-container);
|
||||
--md-navigation-bar-active-indicator-color: var(--md-sys-color-secondary-container);
|
||||
--md-navigation-bar-active-icon-color: var(--md-sys-color-on-secondary-container);
|
||||
@@ -166,11 +156,9 @@ md-navigation-tab {
|
||||
|
||||
/* ── 操作锁横幅 ───────────────────────────────────────────────────── */
|
||||
.oplock-banner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 5;
|
||||
/* 参与正常流(并排在顶栏之前):出现时把内容整体下推,而不是盖住顶栏 */
|
||||
order: -1;
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--md-sys-spacing-2);
|
||||
@@ -228,7 +216,7 @@ md-navigation-tab {
|
||||
position: absolute;
|
||||
left: var(--md-sys-spacing-3);
|
||||
right: var(--md-sys-spacing-3);
|
||||
bottom: calc(96px + var(--safe-area-inset-bottom, 0px));
|
||||
bottom: calc(96px + var(--safe-area-inset-bottom, var(--window-inset-bottom, 0px)));
|
||||
z-index: 7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -33,8 +33,8 @@ body {
|
||||
body {
|
||||
/* 全局 0.95 视觉缩放;用户自定义缩放叠加在 html 上(沿用既有策略) */
|
||||
zoom: 0.95;
|
||||
padding-top: var(--safe-area-inset-top, 0);
|
||||
padding-bottom: var(--safe-area-inset-bottom, 0);
|
||||
/* edge-to-edge:安全区由顶栏/底部导航栏各自内缩处理,
|
||||
这样系统栏区域的背景色能延伸到屏幕边缘(参考 FontMM) */
|
||||
background-color: var(--md-sys-color-background);
|
||||
color: var(--md-sys-color-on-background);
|
||||
font-family: var(--md-sys-typescale-font);
|
||||
@@ -132,6 +132,11 @@ body::-webkit-scrollbar,
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* 中英混排的数值:用页面字体 + 等宽数字,避免中文落到等宽栈的 CJK 兜底字体 */
|
||||
.tabular {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* ── 表面:MD3 用色调层级而非阴影表达层级 ─────────────────────────── */
|
||||
.section {
|
||||
background-color: var(--md-sys-color-surface-container-low);
|
||||
|
||||
@@ -70,8 +70,11 @@
|
||||
.collapse {
|
||||
display: grid;
|
||||
grid-template-rows: 0fr;
|
||||
transition: grid-template-rows var(--md-sys-motion-duration-medium2)
|
||||
var(--md-sys-motion-easing-emphasized);
|
||||
margin-top: 0;
|
||||
transition:
|
||||
grid-template-rows var(--md-sys-motion-duration-medium2)
|
||||
var(--md-sys-motion-easing-emphasized),
|
||||
margin-top var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
|
||||
}
|
||||
|
||||
.collapse.open {
|
||||
@@ -92,6 +95,11 @@
|
||||
padding-bottom: var(--collapse-gap, 0px);
|
||||
}
|
||||
|
||||
/* 收起时高度为 0 但仍参与父容器 gap,会多留一段空白;抵消其中一次间距 */
|
||||
.collapse:not(.open) {
|
||||
margin-top: calc(-1 * var(--md-sys-spacing-3));
|
||||
}
|
||||
|
||||
.collapse--gap {
|
||||
--collapse-gap: var(--md-sys-spacing-3);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,17 @@
|
||||
--md-sys-typescale-label-small-tracking: 0.0313em;
|
||||
|
||||
--md-sys-typescale-font: 'Geist', system-ui, -apple-system, sans-serif;
|
||||
--md-sys-typescale-font-mono: 'Geist Mono', ui-monospace, monospace;
|
||||
/* 等宽栈要带上 CJK 无衬线兜底:Geist Mono 无中文字形,直接落到通用 monospace
|
||||
会在 Windows 上显示为宋体 */
|
||||
--md-sys-typescale-font-mono:
|
||||
'Geist Mono', ui-monospace, 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', monospace;
|
||||
|
||||
/* @material/web 组件内部的字体族取自 ref typeface(默认回退 Roboto),
|
||||
必须显式指向项目字体,否则组件内文字与页面字体不一致 */
|
||||
--md-ref-typeface-brand: 'Geist', system-ui, -apple-system, sans-serif;
|
||||
--md-ref-typeface-plain: 'Geist', system-ui, -apple-system, sans-serif;
|
||||
--md-ref-typeface-weight-regular: 400;
|
||||
--md-ref-typeface-weight-medium: 500;
|
||||
|
||||
/* ── 形状 shape ─────────────────────────────────────────────────── */
|
||||
--md-sys-shape-corner-none: 0;
|
||||
|
||||
@@ -264,9 +264,13 @@ onUnmounted(stopPolling)
|
||||
<div class="app-row__main">
|
||||
<md-checkbox
|
||||
:checked="row.app.checked"
|
||||
:class="{
|
||||
'is-unsaved':
|
||||
row.app.checked && !appsApi.savedBlacklist.value.has(row.app.packageName),
|
||||
}"
|
||||
@change="row.app.checked = $event.target.checked; appsApi.reorder()"
|
||||
></md-checkbox>
|
||||
<div class="app-row__text">
|
||||
<div class="app-row__text" @click="row.app.checked = !row.app.checked; appsApi.reorder()">
|
||||
<span class="app-row__name">
|
||||
{{ row.app.appLabel }}
|
||||
<span class="app-row__uid ts-body-sm supporting">{{ row.app.uid }}</span>
|
||||
@@ -432,16 +436,33 @@ onUnmounted(stopPolling)
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--md-sys-spacing-2);
|
||||
padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3) var(--md-sys-spacing-2) 0;
|
||||
padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
|
||||
min-height: 64px;
|
||||
}
|
||||
|
||||
/* 选中但尚未保存:绿色提示;保存后回到默认主色 */
|
||||
md-checkbox.is-unsaved {
|
||||
--md-checkbox-selected-container-color: var(--lp-color-success);
|
||||
--md-checkbox-selected-hover-container-color: var(--lp-color-success);
|
||||
--md-checkbox-selected-focus-container-color: var(--lp-color-success);
|
||||
--md-checkbox-selected-pressed-container-color: var(--lp-color-success);
|
||||
--md-checkbox-selected-hover-state-layer-color: var(--lp-color-success);
|
||||
--md-checkbox-selected-pressed-state-layer-color: var(--lp-color-success);
|
||||
--md-checkbox-selected-icon-color: var(--md-sys-color-surface);
|
||||
--md-checkbox-selected-hover-icon-color: var(--md-sys-color-surface);
|
||||
--md-checkbox-selected-focus-icon-color: var(--md-sys-color-surface);
|
||||
--md-checkbox-selected-pressed-icon-color: var(--md-sys-color-surface);
|
||||
}
|
||||
|
||||
/* 名称/包名区域也可点击切换(复选框本身只有 18px,触控偏小) */
|
||||
.app-row__text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
cursor: pointer;
|
||||
padding: var(--md-sys-spacing-1) 0;
|
||||
}
|
||||
|
||||
.app-row__name {
|
||||
|
||||
@@ -127,13 +127,13 @@ async function confirmReset() {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AppSwitch v-model="form.auto_bri_sleep" name="自动亮度时休眠" support="系统自动亮度开启时不提升" />
|
||||
<AppSwitch v-model="config.autoBriSleep.value" name="自动亮度时休眠" support="系统自动亮度开启时不提升" />
|
||||
<AppSwitch
|
||||
v-model="form.display_hdr_sleep"
|
||||
v-model="config.displayHdrSleep.value"
|
||||
name="显示 HDR 内容时休眠"
|
||||
support="比率 ≥ 进入阈值休眠,≤ 退出阈值恢复"
|
||||
/>
|
||||
<div class="collapse collapse--gap" :class="{ open: form.display_hdr_sleep === '1' }">
|
||||
<div class="collapse collapse--gap" :class="{ open: config.displayHdrSleep.value }">
|
||||
<div class="sleep-row">
|
||||
<AppTextField
|
||||
v-model="form.hdr_enter_ratio"
|
||||
@@ -156,7 +156,7 @@ async function confirmReset() {
|
||||
</div>
|
||||
</div>
|
||||
<AppSwitch
|
||||
v-model="form.compatibility_mode"
|
||||
v-model="config.compatibilityMode.value"
|
||||
name="兼容模式(轮询驱动)"
|
||||
support="不使用事件监听,改为 2 秒一次轮询"
|
||||
warning="仅在事件驱动失效时开启,会略微增加耗电"
|
||||
@@ -191,7 +191,7 @@ async function confirmReset() {
|
||||
<Wrench :size="16" aria-hidden="true" /> 运行环境
|
||||
</div>
|
||||
<AppSwitch
|
||||
v-model="form.debug_mode"
|
||||
v-model="config.debugMode.value"
|
||||
name="调试模式"
|
||||
support="记录详细事件到日志"
|
||||
warning="需重启模块生效,用完请关闭"
|
||||
|
||||
@@ -94,6 +94,13 @@ const levelClass = (level) => `log-line--${(level || 'plain').toLowerCase()}`
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
/* UA 样式表给 code 单独设了 font-family: monospace(不继承 pre),
|
||||
必须显式 inherit,否则中文回落到宋体 */
|
||||
.log-output code {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.log-line {
|
||||
display: block;
|
||||
white-space: pre-wrap;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import { inject, computed, ref } from 'vue'
|
||||
import { SunMedium, Smartphone, Activity, Clock, Moon, Layers, Gauge } from 'lucide-vue-next'
|
||||
import { SunMedium, Smartphone, Activity, Clock, Moon, Layers, Gauge, RefreshCw } from 'lucide-vue-next'
|
||||
import ConfirmDialog from '../components/ConfirmDialog.vue'
|
||||
|
||||
const status = inject('status')
|
||||
@@ -39,6 +39,11 @@ const thresholdPercent = computed(() =>
|
||||
const autoBrightness = computed(() => status.display.value?.autoBrightness ?? null)
|
||||
const nodeError = computed(() => status.brightness.value.error || '')
|
||||
|
||||
async function refresh() {
|
||||
await status.load({ display: true })
|
||||
snackbar('已刷新')
|
||||
}
|
||||
|
||||
async function applyBrightness(value) {
|
||||
try {
|
||||
await status.setBrightness(value)
|
||||
@@ -75,6 +80,9 @@ async function confirmLow() {
|
||||
<div class="section-header">
|
||||
<h2 class="section-title ts-title-md">实时状态</h2>
|
||||
<span v-if="status.error.value" class="state-badge is-unsaved">读取失败</span>
|
||||
<md-icon-button title="刷新" @click="refresh">
|
||||
<RefreshCw :size="20" />
|
||||
</md-icon-button>
|
||||
</div>
|
||||
|
||||
<div class="status-grid">
|
||||
@@ -83,7 +91,7 @@ async function confirmLow() {
|
||||
<component :is="item.icon" :size="14" aria-hidden="true" />
|
||||
{{ item.label }}
|
||||
</span>
|
||||
<span class="status-item__value mono">{{ item.value }}</span>
|
||||
<span class="status-item__value tabular">{{ item.value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user