feat: household TV companion with scoped pairing and direct LAN camera strip

This commit is contained in:
Codex
2026-10-16 00:35:17 +08:00
parent fb87ae4de9
commit 6aa20391b2
42 changed files with 1153 additions and 33 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "zhao-steward-ui",
"private": true,
"version": "0.1.43",
"version": "0.1.44",
"type": "module",
"scripts": {
"build": "vite build",
+1 -1
View File
@@ -15,6 +15,6 @@ export function enhance(root){
export async function loadControllers(){
enhance(document.getElementById('app'))
new MutationObserver(records=>{for(const record of records)for(const node of record.addedNodes)enhance(node)}).observe(document.getElementById('app'),{childList:true,subtree:true})
for(const path of [...scripts,'/vue-bridge.js'])await new Promise((resolve,reject)=>{const script=document.createElement('script');script.src=path+'?ui=0.1.43';script.onload=resolve;script.onerror=()=>reject(new Error('Could not load '+path));document.head.append(script)})
for(const path of [...scripts,'/vue-bridge.js'])await new Promise((resolve,reject)=>{const script=document.createElement('script');script.src=path+'?ui=0.1.44';script.onload=resolve;script.onerror=()=>reject(new Error('Could not load '+path));document.head.append(script)})
await window.ZhaoVue.boot()
}
@@ -7,6 +7,8 @@ import {
} from "../composables/bridge.js";
import AppIcon from "./AppIcon.vue";
import NetworkStatus from "./NetworkStatus.vue";
import DisplayManager from './DisplayManager.vue';
import DeviceTransfer from './DeviceTransfer.vue';
const channels = (d) =>
(snapshot.value.state.cameras || []).filter((c) =>
d.source === "camera"
@@ -118,6 +120,8 @@ const monitored = (d) =>
snapshot.page === 'objects' && deviceView.mode === 'cards'
"
/>
<DisplayManager v-if="d.source==='device' && /电视|显示|大屏/.test(d.deviceType)" :device="d"/>
<DeviceTransfer :device="d"/>
</div>
<div class="card-footer device-card-actions">
<button
@@ -1,5 +1,7 @@
<script setup>
import {snapshot} from '../composables/bridge.js'
import NetworkStatus from './NetworkStatus.vue'
import DisplayManager from './DisplayManager.vue'
import DeviceTransfer from './DeviceTransfer.vue'
</script>
<template><section v-if="snapshot.admin&&snapshot.device&&snapshot.page==='device'" class="panel"><h3>网络状态与管理入口</h3><NetworkStatus :device="snapshot.device"/><p class="description mb-0">只检查已登记的设备地址。常用端口未响应不一定表示断电;Tailscale 节点在线也不代表下级网段可达。</p></section></template>
<template><section v-if="snapshot.admin&&snapshot.device&&snapshot.page==='device'" class="panel"><h3>网络状态与管理入口</h3><DisplayManager v-if="snapshot.device.source==='device' && /电视|显示|大屏/.test(snapshot.device.deviceType)" :device="snapshot.device"/><NetworkStatus v-else :device="snapshot.device"/><DeviceTransfer :device="snapshot.device"/></section></template>
@@ -0,0 +1,11 @@
<script setup>
import {ref,computed,watch} from 'vue'
import {snapshot,bridge} from '../composables/bridge.js'
const props=defineProps({device:Object})
const open=ref(false),target=ref(''),confirm=ref(false),busy=ref(false),message=ref('')
const targets=computed(()=>(snapshot.value.state.households||[]).filter(h=>h.id!==snapshot.value.state.familyId))
watch(()=>snapshot.value.state.familyId,()=>{open.value=false;target.value='';confirm.value=false;message.value=''})
async function transfer(){if(!confirm.value||!target.value)return;busy.value=true;message.value=''
try{await bridge().api('/api/devices/transfer',{source:props.device.source,id:props.device.id,targetFamilyId:target.value});bridge().notify('设备已转移,电视需在新家庭重新授权。');open.value=false;await bridge().refresh()}catch(e){message.value=e.message}finally{busy.value=false}}
</script>
<template><div v-if="snapshot.user?.role==='admin'" class="mt-3"><button class="btn btn-sm btn-outline-secondary" @click="open=!open">转移到其他家庭</button><div v-if="open" class="border rounded p-3 mt-2"><label class="w-100">目标家庭 / 公司 / 工厂<select v-model="target" class="form-select mt-2"><option value="">请选择</option><option v-for="h in targets" :key="h.id" :value="h.id">{{h.name}}</option></select></label><p class="small text-secondary mt-2">保留设备编号与基本档案。所属区域、负责人和上级设备需重新设置;电视旧展示授权会停用。关联录像机的摄像头需先解除关联。</p><label class="d-flex gap-2 small mb-2"><input v-model="confirm" type="checkbox">确认将这台设备转移给目标家庭管理</label><button class="btn btn-primary btn-sm" :disabled="busy||!confirm||!target" @click="transfer">确认转移</button></div><p v-if="message" class="small mt-2" role="status">{{message}}</p></div></template>
@@ -0,0 +1,45 @@
<script setup>
import {ref,watch,onUnmounted,computed} from 'vue'
import {snapshot,bridge} from '../composables/bridge.js'
const props=defineProps({device:Object})
const open=ref(false),result=ref(null),grants=ref([]),error=ref(''),busy=ref(false),link=ref(''),preview=ref(''),previewUntil=ref(0)
let timer,epoch=0,blob=''
const home=computed(()=>snapshot.value.state.households?.find(h=>h.id===snapshot.value.state.familyId))
const city=ref(''),latitude=ref(''),longitude=ref('')
const pairingCode=ref('')
const endpoint=path=>path+'?deviceId='+encodeURIComponent(props.device.id)
const hardware=computed(()=>result.value?.hardware||{})
const number=(value,digits=1)=>typeof value==='number'?value.toFixed(digits):'未提供'
const formatTime=value=>value?new Date(value*1000).toLocaleString('zh-CN'):'尚未上报'
async function reload(){const e=epoch;if(!open.value)return
try{const value=await bridge().api(endpoint('/api/displays/hardware'));if(e!==epoch)return;result.value=value
if(Date.now()<previewUntil.value&&value.previewAt){const response=await fetch(endpoint('/api/displays/preview'),{headers:{'X-Household-Id':snapshot.value.state.familyId},cache:'no-store'});if(response.ok){const image=await response.blob();if(e!==epoch)return;if(blob)URL.revokeObjectURL(blob);blob=URL.createObjectURL(image);preview.value=blob}}
}catch(e2){if(e===epoch)error.value=e2.message}finally{if(e===epoch&&open.value)timer=setTimeout(reload,5000)}
}
async function change(action,id){busy.value=true;error.value='';const e=epoch
try{const value=await bridge().api('/api/displays',{action,deviceId:props.device.id,id,city:city.value,latitude:latitude.value,longitude:longitude.value});if(e!==epoch)return
if(value.path)link.value=location.origin+value.path
if(value.pairingCode)pairingCode.value=value.pairingCode
if(action==='preview')previewUntil.value=Date.now()+60000
if(action==='revoke'){link.value='';pairingCode.value='';preview.value='';previewUntil.value=0}
grants.value=(await bridge().api(endpoint('/api/displays'))).items;clearTimeout(timer);reload()
}catch(e2){if(e===epoch)error.value=e2.message}finally{if(e===epoch)busy.value=false}
}
watch(open,async value=>{epoch++;clearTimeout(timer);link.value='';error.value='';preview.value='';previewUntil.value=0;if(blob){URL.revokeObjectURL(blob);blob=''}if(value){city.value=home.value?.city||'';latitude.value=city.value==='济南市'?'36.67':'';longitude.value=city.value==='济南市'?'116.99':'';reload();try{grants.value=(await bridge().api(endpoint('/api/displays'))).items}catch(e){error.value=e.message}}})
watch(()=>[snapshot.value.state.familyId,snapshot.value.session,snapshot.value.page,props.device.id].join('|'),()=>open.value=false)
onUnmounted(()=>{epoch++;clearTimeout(timer);if(blob)URL.revokeObjectURL(blob)})
</script>
<template><div v-if="snapshot.admin" class="display-manager mt-3"><button class="btn btn-outline-primary btn-sm" @click="open=!open">{{open?'收起电视管理':'电视管理 · 状态与模拟屏'}}</button>
<section v-if="open" class="border rounded-3 p-3 mt-3">
<div class="d-flex justify-content-between align-items-center gap-2 mb-3"><strong>{{device.name}}</strong><span class="badge" :class="result?.online?'text-bg-success':'text-bg-secondary'">{{result?.online?'在线 · 心跳正常':result?.paired?'未收到心跳':'尚未绑定'}}</span></div>
<p class="small text-secondary">所属:{{home?.name}} · 最后心跳 {{formatTime(result?.lastSeen)}}</p>
<div class="row g-2 hardware-grid"><div class="col-6"><span>处理器温度</span><strong>{{number(hardware.temperatureC)}}{{hardware.temperatureC!=null?' °C':''}}</strong><small>{{hardware.temperatureSource||'等待传感器上报'}}</small></div><div class="col-6"><span>整机功率</span><strong>{{number(hardware.powerW)}}{{hardware.powerW!=null?' W':''}}</strong><small>{{hardware.powerSource||'需设备传感器或计量插座'}}</small></div><div class="col-6"><span>可用内存</span><strong>{{number(hardware.memoryAvailableMB,0)}} / {{number(hardware.memoryTotalMB,0)}} MB</strong></div><div class="col-6"><span>可用存储</span><strong>{{number(hardware.storageAvailableGB)}} / {{number(hardware.storageTotalGB)}} GB</strong></div></div>
<p class="small text-secondary mt-3">{{hardware.model||device.model}} · Android {{hardware.osVersion||'—'}} · IP {{hardware.ip||device.managementHost||'—'}}<br>{{hardware.screenWidth||'—'}} × {{hardware.screenHeight||'—'}} · {{hardware.foreground?'看板在前台':'看板未在前台'}} · {{hardware.screenOn?'屏幕亮':'屏幕状态待确认'}}<span v-if="!result?.online"> · 当前数值为最后一次上报</span></p>
<h4 class="fs-6">异常与报警</h4><p v-if="!result?.alerts?.some(a=>!a.cleared)" class="small text-secondary">{{result?.online?'当前无活动报警':'连接恢复后继续检查硬件状态'}}</p><div v-for="a in result?.alerts?.filter(a=>!a.cleared)" :key="a.code" class="alert py-2 small" :class="a.severity==='critical'?'alert-danger':'alert-warning'">{{a.message}} · {{formatTime(a.opened)}}</div>
<details class="small mb-3"><summary>报警记录与规则</summary><p>心跳中断超过 100 秒;处理器 ≥75°C 提醒、≥85°C 严重;可用内存低于 5%;可用存储低于 0.5 GB;看板退出前台。数值来自电视上报。</p><div v-for="(a,i) in result?.alerts" :key="i">{{a.cleared?'已恢复':'处理中'}} · {{a.message}} · {{formatTime(a.opened)}}</div></details>
<button class="btn btn-primary btn-sm" :disabled="busy||!result?.online" @click="change('preview')">查看模拟屏 · 60 秒</button><p class="small text-secondary mt-2">显示电视当前家庭看板的应用画面,约 20 秒更新一次;退出看板后不显示其他应用。预览仅短时保存在内存。</p><figure v-if="preview" class="tv-remote-preview"><img :src="preview" alt="电视家庭看板的真实应用画面"><figcaption class="small text-secondary">画面时间:{{formatTime(result?.previewAt)}}</figcaption></figure>
<details class="mt-3"><summary>展示授权与天气设置</summary><div class="row g-2 my-2"><label class="col-12">天气城市<input v-model="city" class="form-control" maxlength="60"></label><label class="col-6">纬度<input v-model="latitude" class="form-control" type="number" step="0.0001" min="-90" max="90"></label><label class="col-6">经度<input v-model="longitude" class="form-control" type="number" step="0.0001" min="-180" max="180"></label></div><p class="small text-secondary">链接有效期一年,仅可展示本家庭概况、设备状态与已发布日程。重新生成会停用旧链接。</p><button class="btn btn-outline-primary btn-sm" :disabled="busy" @click="change('create')">生成新的电视展示链接</button><div v-if="link" class="my-3"><label>本次展示链接(请仅交给这台电视)<input class="form-control" :value="link" readonly @focus="$event.target.select()"></label><a class="btn btn-sm btn-outline-secondary mt-2" :href="link" target="_blank" rel="noreferrer">打开看板</a></div><div v-for="g in grants.filter(g=>!g.revoked)" :key="g.id" class="d-flex gap-2 align-items-center small mt-2"><span>授权至 {{formatTime(g.expires_at)}}</span><button class="btn btn-sm btn-outline-danger" :disabled="busy" @click="change('revoke',g.id)">停用展示权限</button></div></details>
<div v-if="pairingCode&&link" class="alert alert-success mt-3">App 配对码:<strong class="fs-3 font-monospace">{{pairingCode}}</strong><div class="small">在“赵府家庭屏”App 输入,10 分钟内有效,使用一次即失效。App 摄像头画面在本地网络直接播放。</div></div>
<p v-if="error" class="text-danger mt-2" role="alert">{{error}}</p>
</section></div></template>
<style scoped>.hardware-grid>div{display:flex;flex-direction:column;gap:4px;background:#f5f7f7;padding:12px;border:3px solid white;border-radius:12px}.hardware-grid span,.hardware-grid small{font-size:12px;color:#637471}.hardware-grid strong{font-size:18px}.tv-remote-preview{margin:16px 0;text-align:center}.tv-remote-preview img{max-height:640px;max-width:100%;border:6px solid #303b38;border-radius:12px}.display-manager summary{cursor:pointer}details p{margin-top:12px}</style>
+57
View File
@@ -0,0 +1,57 @@
<script setup>
import {ref,computed,onMounted,onBeforeUnmount} from 'vue'
import {chinaParts,weatherLabel} from './time.mjs'
const data=ref(null),clock=ref(Date.now()),error=ref(''),lastSync=ref(0),paging=ref(0),offset=ref(0),fullscreen=ref(false)
let poll,tick,cycle,controller,token='',failures=0,wake
try {const found=new URLSearchParams(location.hash.slice(1)).get('display');if(found){localStorage.setItem('zhao.display',found);history.replaceState(null,'',location.pathname)} token=localStorage.getItem('zhao.display')||''}catch{}
const time=computed(()=>chinaParts(new Date(clock.value+offset.value)))
const lunar=computed(()=>{try{return new Intl.DateTimeFormat('zh-CN-u-ca-chinese',{timeZone:'Asia/Shanghai',month:'long',day:'numeric'}).format(new Date(clock.value+offset.value))}catch{return ''}})
const greeting=computed(()=>+time.value.hour<6?'夜深了,愿你好梦':+time.value.hour<11?'早安,新的一天':+time.value.hour<14?'午安,慢慢生活':+time.value.hour<18?'午后,家有暖意':'晚安时光,灯火可亲')
const angles=computed(()=>({hour:(+time.value.hour%12)*30+(+time.value.minute)/2,minute:(+time.value.minute)*6,second:(+time.value.second)*6}))
const devices=computed(()=>{const all=data.value?.devices||[];return all.slice((paging.value%Math.max(1,Math.ceil(all.length/4)))*4,(paging.value%Math.max(1,Math.ceil(all.length/4)))*4+4)})
const weather=computed(()=>data.value?.weather)
const syncLabel=computed(()=>!lastSync.value?'正在连接家庭':clock.value-lastSync.value>90000?'网络暂时中断 · 显示上次资料':'家庭资料已同步')
const fmt=n=>typeof n==='number'?Math.round(n):'—'
async function load(){
if(!token){error.value='请从家庭设备页获取这台电视的展示授权';return}
controller=new AbortController();const timeout=setTimeout(()=>controller.abort(),12000)
try {const res=await fetch('/api/display/snapshot',{headers:{Authorization:'Bearer '+token},signal:controller.signal,cache:'no-store'});const value=await res.json();if(!res.ok){if(res.status===401||res.status===403){data.value=null;localStorage.removeItem('zhao.display');token=''}throw Error(value.error||'暂时无法同步')}
data.value=value;offset.value=new Date(value.serverTime).getTime()-Date.now();lastSync.value=Date.now();error.value='';failures=0
}catch(e){error.value=e.name==='AbortError'?'家庭连接暂时超时':e.message;failures++}
finally {clearTimeout(timeout);if(token)poll=setTimeout(load,Math.min(120000,30000*Math.max(1,failures)))}
}
async function enterFullscreen(){try{if(!document.fullscreenElement)await document.documentElement.requestFullscreen();else await document.exitFullscreen();fullscreen.value=!!document.fullscreenElement;if(navigator.wakeLock)wake=await navigator.wakeLock.request('screen')}catch{}}
const visibility=()=>{if(!document.hidden&&navigator.wakeLock)navigator.wakeLock.request('screen').then(v=>wake=v).catch(()=>{})}
onMounted(()=>{load();tick=setInterval(()=>clock.value=Date.now(),1000);cycle=setInterval(()=>paging.value++,15000);document.addEventListener('visibilitychange',visibility)})
onBeforeUnmount(()=>{clearTimeout(poll);clearInterval(tick);clearInterval(cycle);controller?.abort();wake?.release();document.removeEventListener('visibilitychange',visibility)})
</script>
<template>
<div class="tv-shell">
<header class="tv-top"><span class="tv-brand"><img src="/zhao-icon.png" alt="赵">赵府 <span>家庭时光</span></span><button class="tv-fullscreen" @click="enterFullscreen" aria-label="切换全屏">{{fullscreen?'退出全屏':'全屏展示'}} ⛶</button></header>
<div class="tv-upper">
<section class="square-clock" aria-label="北京时间时钟">
<svg viewBox="0 0 440 440" role="img" :aria-label="`${time.hour}:${time.minute}:${time.second}`">
<g v-for="n in 60" :key="n" :transform="`rotate(${n*6} 220 220)`"><line x1="220" :y1="n%5===0?29:32" x2="220" :y2="n%5===0?46:39" :class="n%5===0?'hour-mark':'minute-mark'"/></g>
<text v-for="n in 12" :key="'n'+n" :x="220+148*Math.sin(n*Math.PI/6)" :y="220-148*Math.cos(n*Math.PI/6)+10" class="clock-number">{{n}}</text>
<text x="220" y="140" class="clock-word">家 · 在 此 刻</text>
<line x1="220" y1="231" x2="220" y2="127" class="clock-hour" :transform="`rotate(${angles.hour} 220 220)`"/>
<line x1="220" y1="234" x2="220" y2="91" class="clock-minute" :transform="`rotate(${angles.minute} 220 220)`"/>
<line x1="220" y1="247" x2="220" y2="65" class="clock-second" :transform="`rotate(${angles.second} 220 220)`"/>
<circle cx="220" cy="220" r="8" fill="#a66645"/><circle cx="220" cy="220" r="3" fill="#fffaf0"/>
<text x="220" y="303" class="digital-time">{{time.hour}}:{{time.minute}}</text><text x="220" y="329" class="clock-zone">北京时间</text>
</svg>
</section>
<section class="tv-home"><div class="tv-greeting">{{greeting}}</div><h1>{{data?.home.name||'欢迎回家'}}</h1><div class="tv-date">{{time.year}} 年 {{+time.month}} 月 {{+time.day}} 日 <b>{{time.weekday}}</b></div><div class="tv-date-extra"><span v-if="lunar">农历 {{lunar}}</span><span>{{time.weekYear}} 年 · 第 {{time.week}} 周</span></div></section>
</div>
<section class="tv-weather tv-card" aria-label="天气">
<div class="weather-current"><div class="section-label">{{weather?.city||data?.home.city||'本地'}} · 天气</div><div class="weather-big"><span class="weather-symbol">{{weather?.available?(weather.current.weather_code<3?'☀':'☁'):'☁'}}</span><strong>{{weather?.available?fmt(weather.current.temperature_2m):'—'}}<small>°</small></strong><div><b>{{weather?.available?weatherLabel(weather.current.weather_code):'天气更新中'}}</b><span v-if="weather?.available">体感 {{fmt(weather.current.apparent_temperature)}}° · 湿度 {{fmt(weather.current.relative_humidity_2m)}}%</span></div></div><div class="weather-note">{{weather?.stale?'上次天气 · 待更新':weather?.available?'室外天气 · '+(weather.current.time||'').slice(11,16)+' 更新':weather?.message||'正在连接天气服务'}}</div></div>
<div class="weather-forecast" v-if="weather?.available"><div v-for="(day,i) in weather.days" :key="day.date"><span>{{['今天','明天','后天'][i]}}</span><b>{{weatherLabel(day.code)}}</b><span>{{fmt(day.low)}}° / {{fmt(day.high)}}°</span></div></div>
</section>
<div class="tv-bottom">
<section class="tv-card tv-devices"><div class="tv-section-heading"><h2>家中设备</h2><span>{{data?.home.deviceCount??'—'}} 台 · {{data?.home.spaces??'—'}} 处区域</span></div><div class="tv-device-grid"><article v-for="d in devices" :key="d.id" class="tv-device"><div class="device-emblem">{{/电视|显示/.test(d.type)?'▣':/摄像/.test(d.type)?'◉':/路由|网关/.test(d.type)?'⌁':'◇'}}</div><div><h3>{{d.name}}</h3><p>{{d.location}}</p><span :class="['tv-status',d.status]"><i></i>{{d.statusLabel}}</span></div></article><div class="tv-empty" v-if="!devices.length">设备接入后,会在这里与你见面。</div></div><div class="tv-page-count" v-if="(data?.devices.length||0)>4">设备分组自动轮换 · 每 15 秒</div></section>
<section class="tv-card tv-agenda"><div class="tv-section-heading"><h2>近期日程</h2><span>未来 60 天</span></div><div v-if="!data?.events.length" class="agenda-empty"><span class="agenda-line">日子从容,家有余闲。</span><p>暂没有已发布的家庭安排</p></div><article v-for="e in data?.events.slice(0,3)" :key="e.id" class="tv-event"><time>{{e.date.slice(5).replace('-',' / ')}}</time><h3>{{e.title}}</h3></article><div class="agenda-source">来自本家庭已发布的重大记事</div></section>
</div>
<section class="tv-family-presence tv-card"><div><h2>家人位置</h2><p>等待家人主动开启位置共享</p></div><span>共享关闭</span></section>
<footer class="tv-footer"><span :class="{warning:!!error}"><i></i>{{syncLabel}}</span><span v-if="error" class="sync-error">{{error}}</span><span>愿每个平常日,都有家的温度</span><a href="https://open-meteo.com/" target="_blank" rel="noreferrer">天气 Open-Meteo</a></footer>
</div>
</template>
+5
View File
@@ -0,0 +1,5 @@
import {createApp} from 'vue'
import 'bootstrap/dist/css/bootstrap.min.css'
import './tv.css'
import Television from './Television.vue'
createApp(Television).mount('#app')
+8
View File
@@ -0,0 +1,8 @@
export function chinaParts(date) {
const values=Object.fromEntries(new Intl.DateTimeFormat('en-GB',{timeZone:'Asia/Shanghai',year:'numeric',month:'2-digit',day:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit',hourCycle:'h23'}).formatToParts(date).map(p=>[p.type,p.value]));
const day=new Date(Date.UTC(+values.year,+values.month-1,+values.day)), weekday=day.getUTCDay();
const thursday=new Date(day);thursday.setUTCDate(day.getUTCDate()+4-(weekday||7));
const start=new Date(Date.UTC(thursday.getUTCFullYear(),0,1));
return {...values,weekday:'星期'+'日一二三四五六'[weekday],week:Math.ceil((((thursday-start)/86400000)+1)/7),weekYear:thursday.getUTCFullYear(),date:`${values.year}-${values.month}-${values.day}`};
}
export const weatherLabel=code=>code===0?'晴':code<=3?'多云':code<=48?'有雾':code<=67?'有雨':code<=77?'有雪':code<=82?'阵雨':code<=86?'阵雪':code>=95?'雷雨':'天气更新中';
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f3eee4"><meta name="referrer" content="no-referrer"><link rel="icon" href="/zhao-icon.png"><title>赵府 · 家庭时光</title></head><body><div id="app"></div><script type="module" src="/src/tv/main.js"></script></body></html>
+1 -1
View File
@@ -1,3 +1,3 @@
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({plugins:[vue({template:{transformAssetUrls:false}})],base:'/ui/',build:{outDir:'../web/ui',emptyOutDir:true,assetsDir:'assets'}})
export default defineConfig({plugins:[vue({template:{transformAssetUrls:false}})],base:'/ui/',build:{target:'es2018',outDir:'../web/ui',emptyOutDir:true,assetsDir:'assets',rollupOptions:{input:{index:'index.html',tv:'tv.html'}}}})