feat: 新增日志中心、功能优化与代码重构
- 新增 log_datasource.go / log_proxy.go / user_api_token.go 后端控制器 - 新增 log_datasource.go model - 新增 monitor/log-center.ts API 模块 - 新增 LogCenter 前端组件及页面 - 重构 deployment 相关组件 (HPDA/UpdateImageModal/bundle-yaml 等) - 新增 ResetPasswordDialog / code-snippet-block / copy-button 等 UI 组件 - 重构多个 k8s 相关组件 (TopologyView/ResourceVisualEditor/PodFileBrowser 等) - 更新多个 API 和工具函数 (auth.ts/monitor/index.ts/request.ts 等) - 更新静态资源 (index.html + 新 JS/CSS bundle) - 删除废弃静态资源文件
This commit is contained in:
1 parent
5ca0e6d83a
commit
8d46e8f352
197 files changed
+5014
-815
No files matched your search
@@ -0,0 +1,44 @@
|
||||
// image-ref-utils.ts — 容器镜像引用解析与拼接 // Logan.Li
|
||||
|
||||
export interface ImageRefParts {
|
||||
repository: string;
|
||||
tag: string;
|
||||
/** digest 形式时存在,如 sha256:abc... // Logan.Li */
|
||||
digest?: string;
|
||||
}
|
||||
|
||||
/** 解析镜像引用为仓库地址 + tag(兼容 registry:port 与 digest)// Logan.Li */
|
||||
export function parseImageRef(image: string): ImageRefParts {
|
||||
const raw = (image || '').trim();
|
||||
if (!raw) return { repository: '', tag: 'latest' };
|
||||
|
||||
if (raw.includes('@')) {
|
||||
const at = raw.lastIndexOf('@');
|
||||
return {
|
||||
repository: raw.slice(0, at),
|
||||
tag: raw.slice(at + 1),
|
||||
digest: raw.slice(at + 1),
|
||||
};
|
||||
}
|
||||
|
||||
const slashIdx = raw.lastIndexOf('/');
|
||||
const colonIdx = raw.lastIndexOf(':');
|
||||
if (colonIdx > slashIdx) {
|
||||
return {
|
||||
repository: raw.slice(0, colonIdx),
|
||||
tag: raw.slice(colonIdx + 1) || 'latest',
|
||||
};
|
||||
}
|
||||
|
||||
return { repository: raw, tag: 'latest' };
|
||||
}
|
||||
|
||||
/** 拼接完整镜像引用 // Logan.Li */
|
||||
export function joinImageRef(repository: string, tag: string): string {
|
||||
const repo = repository.trim();
|
||||
const t = tag.trim();
|
||||
if (!repo) return '';
|
||||
if (!t) return repo;
|
||||
if (t.startsWith('sha256:')) return `${repo}@${t}`;
|
||||
return `${repo}:${t}`;
|
||||
}
|
||||
Reference in new issue
Block a user