- domain/rules: 计分与排名解耦、破纪录按组别、tieBreak 生效、调整分不丢、移除 aggregate 假能力 - realtime: 新建 internal/dto,快照三项契约对齐,/ws 只认会话身份 - httpapi: 流水幂等、standings 整表载荷、广播接线、强制改密、XFF 防伪造、records 写入、审计、赛事包内容、发布前备份、result.points、实例列表 - web: FormData 上传、YAML 解析、快照归一化、大屏解析层、bootstrap 降级、访客判定、主题切换 - console: 优雅关闭握手、中文化、免验证改管理员账号、选屏与日志轮转修复 - docs: 用户文档三份 + README - 主代理: 破纪录加分接线(levels 未加载导致恒 0)
31 lines
1.4 KiB
JavaScript
31 lines
1.4 KiB
JavaScript
'use strict'
|
|
|
|
const { contextBridge, ipcRenderer } = require('electron')
|
|
|
|
// 渲染层是纯静态页面,能力全部经这里白名单暴露,不开 nodeIntegration
|
|
const subscribe = (channel, callback) => {
|
|
const handler = (_event, payload) => callback(payload)
|
|
ipcRenderer.on(channel, handler)
|
|
return () => ipcRenderer.removeListener(channel, handler)
|
|
}
|
|
|
|
contextBridge.exposeInMainWorld('consoleApi', {
|
|
getStatus: () => ipcRenderer.invoke('service:get-status'),
|
|
startService: () => ipcRenderer.invoke('service:start'),
|
|
stopService: () => ipcRenderer.invoke('service:stop'),
|
|
restartService: () => ipcRenderer.invoke('service:restart'),
|
|
getLog: () => ipcRenderer.invoke('log:tail'),
|
|
clearLog: () => ipcRenderer.invoke('log:clear'),
|
|
relayoutDisplays: () => ipcRenderer.invoke('display:relayout'),
|
|
openServerAdmin: () => ipcRenderer.invoke('app:open-server-admin'),
|
|
resetAdminAccount: (payload) => ipcRenderer.invoke('account:reset', payload),
|
|
minimize: () => ipcRenderer.invoke('window:minimize'),
|
|
maximize: () => ipcRenderer.invoke('window:maximize'),
|
|
close: () => ipcRenderer.invoke('window:close'),
|
|
isMaximized: () => ipcRenderer.invoke('window:is-maximized'),
|
|
onMaximizeChange: (callback) => subscribe('window:maximize-changed', callback),
|
|
onAccountOutput: (callback) => subscribe('account:output', callback),
|
|
onLog: (callback) => subscribe('log:line', callback),
|
|
onStatus: (callback) => subscribe('service:status', callback)
|
|
})
|