feat: K8s 部署清单、Token 接入加固与日志/设置页优化
- kubernetes/: 30Gi PVC、单副本 Recreate、Secret/Service/NodePort/Ingress 清单与部署文档 - 数据安全: kubeconfig/token 统一加密存储,启动迁移历史明文,DB 0600 - Token 接入: 命名空间级最小权限提示、长期 Token、自签证书 TLS 兼容 - 部署: 命名空间级 Token 下跳过 Namespace patch/枚举,节点信息容错 - 日志页: namespace → app → pod 选择顺序与作用域收窄 - 设置页: 拆分为通用/告警/LDAP/镜像源四个 tab - 弹框: 统一 max-h 滚动与长命令换行,修复内容溢出
This commit is contained in:
1 parent
2d73661dd1
commit
9f7c522157
50 files changed
+1346
-149
No files matched your search
@@ -29,7 +29,7 @@ import { STORAGE_TYPE_ICONS, STORAGE_TYPE_ICON_CLASS, STORAGE_TYPES } from '../c
|
||||
// 表单 schema:zod 为唯一校验源,消息中文且具体
|
||||
const storageFormSchema = z.object({
|
||||
name: z.string().min(1, '请输入存储配置名称'),
|
||||
storageType: z.enum(['s3', 'oss', 'minio', 'rustfs']),
|
||||
storageType: z.enum(['s3', 'oss', 'cos', 'obs', 'minio', 'rustfs']),
|
||||
endpoint: z.string().optional(),
|
||||
bucket: z.string().min(1, '请填写 Bucket 名称'),
|
||||
region: z.string().optional(),
|
||||
@@ -82,7 +82,8 @@ export const StorageFormDialog = memo(function StorageFormDialog({
|
||||
})
|
||||
const storageType = form.watch('storageType')
|
||||
// 区域仅对公有云(s3/oss)有意义;minio/rustfs 为本地部署不显示、不提交
|
||||
const isCloudStorage = storageType === 's3' || storageType === 'oss'
|
||||
const isCloudStorage =
|
||||
storageType === 's3' || storageType === 'oss' || storageType === 'cos' || storageType === 'obs'
|
||||
|
||||
// 打开时重置;编辑模式回填(密钥留空=保留旧值)
|
||||
useEffect(() => {
|
||||
@@ -218,7 +219,11 @@ export const StorageFormDialog = memo(function StorageFormDialog({
|
||||
? 's3.amazonaws.com'
|
||||
: storageType === 'oss'
|
||||
? 'oss-cn-hangzhou.aliyuncs.com'
|
||||
: 'http://10.0.0.8:9000'
|
||||
: storageType === 'cos'
|
||||
? 'cos.ap-guangzhou.myqcloud.com'
|
||||
: storageType === 'obs'
|
||||
? 'obs.cn-north-4.myhuaweicloud.com'
|
||||
: 'http://10.0.0.8:9000'
|
||||
}
|
||||
{...field}
|
||||
/>
|
||||
@@ -236,7 +241,12 @@ export const StorageFormDialog = memo(function StorageFormDialog({
|
||||
<FormItem>
|
||||
<FormLabel>Bucket *</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="loki-logs" {...field} />
|
||||
<Input
|
||||
placeholder={
|
||||
storageType === 'cos' ? 'my-bucket-1250000000' : 'loki-logs'
|
||||
}
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -250,7 +260,20 @@ export const StorageFormDialog = memo(function StorageFormDialog({
|
||||
<FormItem>
|
||||
<FormLabel>区域</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="us-east-1" {...field} />
|
||||
<Input
|
||||
placeholder={
|
||||
storageType === 's3'
|
||||
? 'us-east-1'
|
||||
: storageType === 'oss'
|
||||
? 'oss-cn-hangzhou'
|
||||
: storageType === 'cos'
|
||||
? 'ap-guangzhou'
|
||||
: storageType === 'obs'
|
||||
? 'cn-north-4'
|
||||
: 'us-east-1'
|
||||
}
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
||||
@@ -4,6 +4,8 @@ import { Cloud, Database, Package, type LucideIcon } from 'lucide-react'
|
||||
export const STORAGE_TYPE_ICONS: Record<string, LucideIcon> = {
|
||||
s3: Cloud,
|
||||
oss: Cloud,
|
||||
cos: Cloud,
|
||||
obs: Cloud,
|
||||
minio: Database,
|
||||
rustfs: Package,
|
||||
}
|
||||
@@ -11,6 +13,8 @@ export const STORAGE_TYPE_ICONS: Record<string, LucideIcon> = {
|
||||
export const STORAGE_TYPE_ICON_CLASS: Record<string, string> = {
|
||||
s3: 'text-warning',
|
||||
oss: 'text-destructive',
|
||||
cos: 'text-info',
|
||||
obs: 'text-info',
|
||||
minio: 'text-info',
|
||||
rustfs: 'text-info',
|
||||
}
|
||||
@@ -18,8 +22,10 @@ export const STORAGE_TYPE_ICON_CLASS: Record<string, string> = {
|
||||
export const STORAGE_TYPE_COLORS: Record<string, string> = {
|
||||
s3: 'bg-warning/10 text-warning',
|
||||
oss: 'bg-destructive/10 text-destructive',
|
||||
cos: 'bg-info/10 text-info',
|
||||
obs: 'bg-info/10 text-info',
|
||||
minio: 'bg-info/10 text-info',
|
||||
rustfs: 'bg-info/10 text-info',
|
||||
}
|
||||
|
||||
export const STORAGE_TYPES = ['s3', 'oss', 'minio', 'rustfs'] as const
|
||||
export const STORAGE_TYPES = ['s3', 'oss', 'cos', 'obs', 'minio', 'rustfs'] as const
|
||||
Reference in new issue
Block a user