feat: complete Loki query, insights, settings and deployment workflows
Add the Loki query UI, access policies, ingress insights, alert and registry settings, and their backend APIs. Include the related Kubernetes deployment and collector updates required by the integrated application. Validated with go test ./..., npm run build, and npm run lint.
This commit is contained in:
1 parent
f9c6c1d826
commit
2d73661dd1
127 files changed
+8117
-2876
No files matched your search
@@ -120,6 +120,33 @@ func (s *HostService) Update(id uint, updates map[string]interface{}) error {
|
||||
if v, ok := updates["arch"].(string); ok {
|
||||
db.Hosts[i].Arch = v
|
||||
}
|
||||
if v, ok := updates["hostIP"].(string); ok && v != "" {
|
||||
db.Hosts[i].HostIP = v
|
||||
}
|
||||
if v, ok := updates["port"].(float64); ok && v > 0 {
|
||||
db.Hosts[i].Port = int(v)
|
||||
}
|
||||
if v, ok := updates["user"].(string); ok && v != "" {
|
||||
db.Hosts[i].User = v
|
||||
}
|
||||
if v, ok := updates["labels"].(string); ok {
|
||||
db.Hosts[i].Labels = v
|
||||
}
|
||||
// 凭证编辑约定:非空才更新(留空=保留旧密文)
|
||||
for _, field := range []string{"password", "privateKey", "keyPhrase"} {
|
||||
if v, ok := updates[field].(string); ok && v != "" {
|
||||
if enc, err := crypto.EncryptField(v); err == nil {
|
||||
switch field {
|
||||
case "password":
|
||||
db.Hosts[i].Password = enc
|
||||
case "privateKey":
|
||||
db.Hosts[i].PrivateKey = enc
|
||||
case "keyPhrase":
|
||||
db.Hosts[i].KeyPhrase = enc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
db.Hosts[i].UpdatedAt = time.Now()
|
||||
db.RequestSave()
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user