security: 前端 WebSocket 连接传递 panel_token 认证
- dashboard.js / logs.js: WS URL 追加 ?token= 查询参数 - app.js: 添加 getCookie() 工具函数 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,12 @@
|
||||
document.documentElement.setAttribute("data-theme", s);
|
||||
})();
|
||||
|
||||
// ═══ 工具函数 ═══
|
||||
function getCookie(name) {
|
||||
var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
|
||||
return match ? match[2] : '';
|
||||
}
|
||||
|
||||
window.toggleTheme = function(){
|
||||
var t = document.documentElement.getAttribute("data-theme") === "light" ? "dark" : "light";
|
||||
document.documentElement.setAttribute("data-theme", t);
|
||||
|
||||
Reference in New Issue
Block a user