From 7d81da65cf602f4bca26623be3d2304e8308620b Mon Sep 17 00:00:00 2001 From: zikai <1621362626@qq.com> Date: Thu, 23 Jul 2026 02:25:54 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=97=A5=E7=A8=8B?= =?UTF-8?q?=E6=95=B4=E7=90=86=E9=A1=B5=E7=AD=BE=EF=BC=88iframe=20=E5=B5=8C?= =?UTF-8?q?=E5=85=A5=20timeTableFix=20/ttf/=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 timetable 模块:iframe 嵌入同源 /ttf/(Apache 反代到本地 vite preview) - 声明 requiresAlive 探测 /ttf/,复用现有存活校验:周期探测、失活隐藏页签 并卸载组件、恢复自动重载(与其他 requiresAlive 模块一致) - app.config.js 新增 timeTableFix 配置(pageUrl / healthUrl) - timeTableFix 作为独立项目维护(独立仓库/构建/systemd),mainPage 仅嵌入, 删除该模块文件夹不影响 timeTableFix 本身与其他页签 - i18n:tabs.timetable(日程整理 / Schedule Organizer) --- src/config/app.config.js | 20 ++++++++++++++++---- src/i18n/locales/en.js | 3 ++- src/i18n/locales/zh-CN.js | 3 ++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/config/app.config.js b/src/config/app.config.js index d67842a..7f19ae3 100644 --- a/src/config/app.config.js +++ b/src/config/app.config.js @@ -7,7 +7,7 @@ export const appConfig = { whiteboard: { // 服务根地址(含协议与域名) baseUrl: 'https://f.zikai.wang', - // 存活探针路径;启动时探测一次,挂掉则隐藏页签 + // 存活探针路径;周期探测,挂掉则隐藏页签并卸载组件 healthPath: '/health', // 记事本页面路径生成器 pagePath: (boardId) => `/wb/${encodeURIComponent(boardId)}`, @@ -15,16 +15,28 @@ export const appConfig = { defaultBoardId: 'share', // 探测超时(毫秒) healthTimeoutMs: 4000 + }, + + // timeTableFix -- ICS 日程整理器(同源 /ttf/ 反向代理到本地 vite preview) + timeTableFix: { + // 应用页面(同源相对路径,由 Apache /ttf/ 代理到 8888) + pageUrl: '/ttf/', + // 存活探针 URL(同源,fetch /ttf/ 返回 2xx 即存活) + healthUrl: '/ttf/', + // 探测超时(毫秒) + healthTimeoutMs: 4000 } } /** - * 拼接服务的完整存活探针 URL。 - * @param {'whiteboard'} service 配置中的服务名 - * @returns {string} 完整 URL,如 https://f.zikai.wang/health + * 取某服务的存活探针 URL。 + * whiteboard 用 baseUrl+healthPath 拼接;timeTableFix 直接用 healthUrl。 + * @param {keyof typeof appConfig} service 配置中的服务名 + * @returns {string} 完整探针 URL,如 https://f.zikai.wang/health */ export function healthUrl(service) { const cfg = appConfig[service] if (!cfg) return '' + if (cfg.healthUrl) return cfg.healthUrl return `${cfg.baseUrl}${cfg.healthPath}` } diff --git a/src/i18n/locales/en.js b/src/i18n/locales/en.js index 881fbd2..ed0b872 100644 --- a/src/i18n/locales/en.js +++ b/src/i18n/locales/en.js @@ -12,7 +12,8 @@ export default { tabs: { mobileGame: 'Mobile Game Project', calendar: 'CQY Timetable', - whiteboard: 'Shared Notepad' + whiteboard: 'Shared Notepad', + timetable: 'Schedule Organizer' }, whiteboard: { openExternal: 'Open in new tab', diff --git a/src/i18n/locales/zh-CN.js b/src/i18n/locales/zh-CN.js index e45c55d..aeb24ea 100644 --- a/src/i18n/locales/zh-CN.js +++ b/src/i18n/locales/zh-CN.js @@ -11,7 +11,8 @@ export default { tabs: { mobileGame: '移动游戏项目', calendar: 'cqy课程表', - whiteboard: '共享记事本' + whiteboard: '共享记事本', + timetable: '日程整理' }, whiteboard: { openExternal: '在新标签页打开',