feat: 新增日程整理页签(iframe 嵌入 timeTableFix /ttf/)
- 新增 timetable 模块:iframe 嵌入同源 /ttf/(Apache 反代到本地 vite preview) - 声明 requiresAlive 探测 /ttf/,复用现有存活校验:周期探测、失活隐藏页签 并卸载组件、恢复自动重载(与其他 requiresAlive 模块一致) - app.config.js 新增 timeTableFix 配置(pageUrl / healthUrl) - timeTableFix 作为独立项目维护(独立仓库/构建/systemd),mainPage 仅嵌入, 删除该模块文件夹不影响 timeTableFix 本身与其他页签 - i18n:tabs.timetable(日程整理 / Schedule Organizer)
This commit is contained in:
@@ -7,7 +7,7 @@ export const appConfig = {
|
|||||||
whiteboard: {
|
whiteboard: {
|
||||||
// 服务根地址(含协议与域名)
|
// 服务根地址(含协议与域名)
|
||||||
baseUrl: 'https://f.zikai.wang',
|
baseUrl: 'https://f.zikai.wang',
|
||||||
// 存活探针路径;启动时探测一次,挂掉则隐藏页签
|
// 存活探针路径;周期探测,挂掉则隐藏页签并卸载组件
|
||||||
healthPath: '/health',
|
healthPath: '/health',
|
||||||
// 记事本页面路径生成器
|
// 记事本页面路径生成器
|
||||||
pagePath: (boardId) => `/wb/${encodeURIComponent(boardId)}`,
|
pagePath: (boardId) => `/wb/${encodeURIComponent(boardId)}`,
|
||||||
@@ -15,16 +15,28 @@ export const appConfig = {
|
|||||||
defaultBoardId: 'share',
|
defaultBoardId: 'share',
|
||||||
// 探测超时(毫秒)
|
// 探测超时(毫秒)
|
||||||
healthTimeoutMs: 4000
|
healthTimeoutMs: 4000
|
||||||
|
},
|
||||||
|
|
||||||
|
// timeTableFix -- ICS 日程整理器(同源 /ttf/ 反向代理到本地 vite preview)
|
||||||
|
timeTableFix: {
|
||||||
|
// 应用页面(同源相对路径,由 Apache /ttf/ 代理到 8888)
|
||||||
|
pageUrl: '/ttf/',
|
||||||
|
// 存活探针 URL(同源,fetch /ttf/ 返回 2xx 即存活)
|
||||||
|
healthUrl: '/ttf/',
|
||||||
|
// 探测超时(毫秒)
|
||||||
|
healthTimeoutMs: 4000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接服务的完整存活探针 URL。
|
* 取某服务的存活探针 URL。
|
||||||
* @param {'whiteboard'} service 配置中的服务名
|
* whiteboard 用 baseUrl+healthPath 拼接;timeTableFix 直接用 healthUrl。
|
||||||
* @returns {string} 完整 URL,如 https://f.zikai.wang/health
|
* @param {keyof typeof appConfig} service 配置中的服务名
|
||||||
|
* @returns {string} 完整探针 URL,如 https://f.zikai.wang/health
|
||||||
*/
|
*/
|
||||||
export function healthUrl(service) {
|
export function healthUrl(service) {
|
||||||
const cfg = appConfig[service]
|
const cfg = appConfig[service]
|
||||||
if (!cfg) return ''
|
if (!cfg) return ''
|
||||||
|
if (cfg.healthUrl) return cfg.healthUrl
|
||||||
return `${cfg.baseUrl}${cfg.healthPath}`
|
return `${cfg.baseUrl}${cfg.healthPath}`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ export default {
|
|||||||
tabs: {
|
tabs: {
|
||||||
mobileGame: 'Mobile Game Project',
|
mobileGame: 'Mobile Game Project',
|
||||||
calendar: 'CQY Timetable',
|
calendar: 'CQY Timetable',
|
||||||
whiteboard: 'Shared Notepad'
|
whiteboard: 'Shared Notepad',
|
||||||
|
timetable: 'Schedule Organizer'
|
||||||
},
|
},
|
||||||
whiteboard: {
|
whiteboard: {
|
||||||
openExternal: 'Open in new tab',
|
openExternal: 'Open in new tab',
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ export default {
|
|||||||
tabs: {
|
tabs: {
|
||||||
mobileGame: '移动游戏项目',
|
mobileGame: '移动游戏项目',
|
||||||
calendar: 'cqy课程表',
|
calendar: 'cqy课程表',
|
||||||
whiteboard: '共享记事本'
|
whiteboard: '共享记事本',
|
||||||
|
timetable: '日程整理'
|
||||||
},
|
},
|
||||||
whiteboard: {
|
whiteboard: {
|
||||||
openExternal: '在新标签页打开',
|
openExternal: '在新标签页打开',
|
||||||
|
|||||||
Reference in New Issue
Block a user