diff --git a/i18n/en/msg.txt b/i18n/en/msg.txt index abd0ce9..d344aaf 100644 --- a/i18n/en/msg.txt +++ b/i18n/en/msg.txt @@ -32,3 +32,5 @@ Submit: Submit 营销产线: Marketing Pipeline 运维产线(面向FOMS)规划中,尚未开发: Operations Pipeline (for FOMS) is planned, not yet developed 营销产线规划中,尚未开发: Marketing Pipeline is planned, not yet developed +切换主题: Toggle theme +显示所有已最小化的窗口: Show all minimized windows diff --git a/i18n/jp/msg.txt b/i18n/jp/msg.txt index efa816f..264c955 100644 --- a/i18n/jp/msg.txt +++ b/i18n/jp/msg.txt @@ -32,3 +32,5 @@ Submit: 送信 营销产线: マーケティングパイプライン 运维产线(面向FOMS)规划中,尚未开发: 運用パイプライン(FOMS向け)は計画中で、まだ開発されていません 营销产线规划中,尚未开发: マーケティングパイプラインは計画中で、まだ開発されていません +切换主题: テーマ切替 +显示所有已最小化的窗口: 最小化されたすべてのウィンドウを表示 diff --git a/i18n/ko/msg.txt b/i18n/ko/msg.txt index ce1ad2a..d8cc1a5 100644 --- a/i18n/ko/msg.txt +++ b/i18n/ko/msg.txt @@ -32,3 +32,5 @@ Submit: 제출 营销产线: 마케팅 파이프라인 运维产线(面向FOMS)规划中,尚未开发: 운영 파이프라인(FOMS 대상)은 계획 중이며 아직 개발되지 않았습니다 营销产线规划中,尚未开发: 마케팅 파이프라인은 계획 중이며 아직 개발되지 않았습니다 +切换主题: 테마 전환 +显示所有已最小化的窗口: 최소화된 모든 창 표시 diff --git a/i18n/zh/msg.txt b/i18n/zh/msg.txt index a0cf2cc..f3694fa 100644 --- a/i18n/zh/msg.txt +++ b/i18n/zh/msg.txt @@ -32,3 +32,5 @@ Submit: Submit 营销产线: 营销产线 运维产线(面向FOMS)规划中,尚未开发: 运维产线(面向FOMS)规划中,尚未开发 营销产线规划中,尚未开发: 营销产线规划中,尚未开发 +切换主题: 切换主题 +显示所有已最小化的窗口: 显示所有已最小化的窗口 diff --git a/scripts/load_path.py b/scripts/load_path.py index 0d7d964..7deb057 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -55,6 +55,7 @@ PERMS = [ ("/index.ui", "app", "any"), ("/todo_badge.js", "app", "any"), ("/index_tab.js", "app", "any"), + ("/theme_toggle.js", "app", "any"), ("/pipeline-sdlc/index.ui", "pipeline_sdlc", "any"), ("/pipeline_core/index.ui", "pipeline_core", "any"), ("/pipeline_ops/index.ui", "pipeline_ops", "any"), diff --git a/wwwroot/i18n/en/i18n.json b/wwwroot/i18n/en/i18n.json index bf116aa..87dddc7 100644 --- a/wwwroot/i18n/en/i18n.json +++ b/wwwroot/i18n/en/i18n.json @@ -273,5 +273,7 @@ "🎤 KTV": "🎤 KTV", "🎬 MTV": "🎬 MTV", "🎵 音乐": "🎵 Music", - "📱 短视频": "📱 Short Video" + "📱 短视频": "📱 Short Video", + "切换主题": "Toggle theme", + "显示所有已最小化的窗口": "Show all minimized windows" } \ No newline at end of file diff --git a/wwwroot/i18n/jp/i18n.json b/wwwroot/i18n/jp/i18n.json index 74c7eec..5a52417 100644 --- a/wwwroot/i18n/jp/i18n.json +++ b/wwwroot/i18n/jp/i18n.json @@ -273,5 +273,7 @@ "🎤 KTV": "🎤 KTV", "🎬 MTV": "🎬 MTV", "🎵 音乐": "🎵 音楽", - "📱 短视频": "📱 ショート動画" + "📱 短视频": "📱 ショート動画", + "切换主题": "テーマ切替", + "显示所有已最小化的窗口": "最小化されたすべてのウィンドウを表示" } \ No newline at end of file diff --git a/wwwroot/i18n/ko/i18n.json b/wwwroot/i18n/ko/i18n.json index ffe4914..a735d11 100644 --- a/wwwroot/i18n/ko/i18n.json +++ b/wwwroot/i18n/ko/i18n.json @@ -273,5 +273,7 @@ "🎤 KTV": "🎤 KTV", "🎬 MTV": "🎬 MTV", "🎵 音乐": "🎵 음악", - "📱 短视频": "📱 숏폼 영상" + "📱 短视频": "📱 숏폼 영상", + "切换主题": "테마 전환", + "显示所有已最小化的窗口": "최소화된 모든 창 표시" } \ No newline at end of file diff --git a/wwwroot/i18n/zh/i18n.json b/wwwroot/i18n/zh/i18n.json index 2003919..7b78796 100644 --- a/wwwroot/i18n/zh/i18n.json +++ b/wwwroot/i18n/zh/i18n.json @@ -95,5 +95,7 @@ "🎤 KTV": "🎤 KTV", "🎬 MTV": "🎬 MTV", "🎵 音乐": "🎵 音乐", - "📱 短视频": "📱 短视频" + "📱 短视频": "📱 短视频", + "切换主题": "切换主题", + "显示所有已最小化的窗口": "显示所有已最小化的窗口" } \ No newline at end of file diff --git a/wwwroot/index.ui b/wwwroot/index.ui index f3b69cc..b55d313 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -51,6 +51,48 @@ { "widgettype": "Filler" }, + { + "widgettype": "Button", + "id": "theme_toggle_btn", + "options": { + "label": "🌙", + "css": "text", + "width": "36px", + "height": "36px", + "borderRadius": "50%", + "border": "1px solid #475569", + "bgcolor": "transparent", + "cfontsize": 1.1, + "tip": "切换主题" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "script", + "target": "self", + "script": "var h=document.documentElement;var t=h.getAttribute('data-theme')||'light';var n=t=='light'?'dark':'light';h.setAttribute('data-theme',n);try{localStorage.setItem('pipeline_ui_theme',n);}catch(e){}if(window.applyPipelineTheme){window.applyPipelineTheme(n);}" + } + ] + }, + { + "widgettype": "Svg", + "options": { + "css": "clickable", + "rate": 2, + "tip": "显示所有已最小化的窗口", + "url": "{{entire_url('/bricks/imgs/app-dock.svg')}}" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "script", + "target": "app", + "script": "bricks.app.show_windows_panel(event)" + } + ] + }, { "widgettype": "urlwidget", "options": { diff --git a/wwwroot/theme_toggle.js b/wwwroot/theme_toggle.js new file mode 100644 index 0000000..1bb2051 --- /dev/null +++ b/wwwroot/theme_toggle.js @@ -0,0 +1,27 @@ +/* 顶栏主题切换:页面加载时恢复上次主题 + 同步按钮图标 + 约定:light 主题显示 🌙(点击切暗),dark 主题显示 ☀️(点击切亮) */ +(function(){ + if (typeof bricks === 'undefined') return; + var KEY = 'pipeline_ui_theme'; + + function applyTheme(t){ + document.documentElement.setAttribute('data-theme', t); + var btn = bricks.getWidgetById('theme_toggle_btn', bricks.app); + if (btn && btn.dom_element){ + btn.opts.label = (t === 'light') ? '🌙' : '☀️'; + btn.dom_element.textContent = btn.opts.label; + } + } + window.applyPipelineTheme = applyTheme; + + function _start(){ + if (bricks.app && bricks.getWidgetById){ + var t = null; + try { t = localStorage.getItem(KEY); } catch(e) {} + applyTheme(t || 'light'); + } else { + setTimeout(_start, 300); + } + } + setTimeout(_start, 300); +})();