feat: PTY kubectl终端 + 侧边栏对齐修复 + 构建缓存清理

**kubectl WebShell 修复:**
- 引入 github.com/creack/pty 库实现真正的伪终端
- 替换 bash --noediting + TERM=dumb 方案为 PTY-backed bash
- 支持 xterm-256color、窗口自适应、readline 交互
- 修复键盘输入无响应问题

**侧边栏优化:**
- 独立菜单项高度从 py-1.5 改为 h-8,与父菜单对齐
- 独立菜单图标从 h-3 w-3 改为 h-3.5 w-3.5,统一 14px

**构建优化:**
- run.sh docker up 增加 docker image prune -f 清理悬空镜像
- 每次部署自动清理 builder cache + dangling images

**认证修复(历史):**
- Token 存储:Zustand + localStorage 双写,http.ts 双源 fallback
- YamlViewer/DeploymentDetail token 来源统一为 Zustand store
This commit is contained in:
attacker committed 2026-06-19 11:22:45 +00:00
1 parent cac1414917
commit a3cd0d3910
29 files changed
+2954 -180

No files matched your search

+21 -1
View File
@@ -36,7 +36,7 @@ async function request<T = any>(
}
// 获取 token
const token = useUserStore.getState().token;
const token = useUserStore.getState().token || localStorage.getItem('token');
const headers: Record<string, string> = {
'Content-Type': 'application/json',
@@ -77,6 +77,26 @@ export const http = {
request<T>('PUT', url, body),
delete: <T = any>(url: string, body?: any) =>
request<T>('DELETE', url, body),
getRaw: async (url: string) => {
const tk = useUserStore.getState().token;
const baseUrl = import.meta.env.VITE_API_BASE_URL || '';
const resp = await fetch(`${baseUrl}/api/v1${url}`, { headers: { Authorization: `Bearer ${tk}` } });
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
return resp.text();
},
putRaw: async (url: string, body: string, contentType: string) => {
const tk = useUserStore.getState().token;
const baseUrl = import.meta.env.VITE_API_BASE_URL || '';
const resp = await fetch(`${baseUrl}/api/v1${url}`, {
method: 'PUT',
headers: { Authorization: `Bearer ${tk}`, 'Content-Type': contentType },
body,
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
return resp.json();
},
};
export default http;