refactor: unify kubernetes_ table prefix, merge CI/CD models, LLM session support
- Rename container_clusters → kubernetes_clusters, container_topology_layouts → kubernetes_topology_layouts - LLM: add session_id to chat history for multi-turn conversation support - CI/CD: add pipeline_id, deploy_type, artifact_url, k8s_cluster_id to AppRelease - Cleanup: remove deprecated playbook handler, simplify automation models - Database: optimize auto-migrate model list - Frontend: AIOps assistant improvements, api.ts updates
This commit is contained in:
1 parent
9365c1e9db
commit
732974d152
14 files changed
+121
-474
No files matched your search
@@ -59,10 +59,10 @@ func (Script) TableName() string {
|
||||
return "ops_scripts"
|
||||
}
|
||||
|
||||
// TaskExecution 任务执行记录
|
||||
// TaskExecution 任务执行记录(cron / script,不含 Ansible;Ansible 走 AnsibleJob)
|
||||
type TaskExecution struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
TaskType string `gorm:"size:32;not null" json:"task_type"` // cron, script, playbook
|
||||
TaskType string `gorm:"size:32;not null" json:"task_type"` // cron, script
|
||||
TaskID uint `json:"task_id"`
|
||||
TaskName string `gorm:"size:128" json:"task_name"`
|
||||
Status string `gorm:"size:32;default:pending" json:"status"` // pending, running, success, failed, cancelled
|
||||
@@ -83,42 +83,6 @@ func (TaskExecution) TableName() string {
|
||||
return "ops_task_executions"
|
||||
}
|
||||
|
||||
// Playbook Ansible Playbook模型
|
||||
type Playbook struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
Name string `gorm:"size:128;not null" json:"name"`
|
||||
Code string `gorm:"size:64;uniqueIndex;not null" json:"code"`
|
||||
Description string `gorm:"size:500" json:"description"`
|
||||
Content string `gorm:"type:text;not null" json:"content"`
|
||||
Category string `gorm:"size:64" json:"category"`
|
||||
Tags string `gorm:"type:text" json:"tags"` // JSON 数组字符串,如 ["deploy","docker"]
|
||||
Variables string `gorm:"type:text" json:"variables"`
|
||||
Inventory string `gorm:"type:text" json:"inventory"`
|
||||
Timeout int `gorm:"default:600" json:"timeout"`
|
||||
RunCount int `gorm:"default:0" json:"run_count"`
|
||||
CreatedBy uint `json:"created_by"`
|
||||
UpdatedBy uint `json:"updated_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName 表名
|
||||
func (Playbook) TableName() string {
|
||||
return "ops_playbooks"
|
||||
}
|
||||
|
||||
// CreatePlaybookRequest 创建Playbook请求
|
||||
type CreatePlaybookRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
Category string `json:"category"`
|
||||
Tags string `json:"tags"` // JSON 数组字符串
|
||||
Variables string `json:"variables"`
|
||||
Inventory string `json:"inventory"`
|
||||
Timeout int `json:"timeout"`
|
||||
}
|
||||
|
||||
// CreateCronJobRequest 创建定时任务请求
|
||||
type CreateCronJobRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
|
||||
Reference in new issue
Block a user