Explorar o código

[web-app] bugfix-boolean型监控参数回显无效问题

tomsun28 %!s(int64=4) %!d(string=hai) anos
pai
achega
582dccbfb5

+ 9 - 0
web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts

@@ -51,6 +51,7 @@ export class MonitorEditComponent implements OnInit {
           });
           });
         }
         }
         this.params = message.data.params;
         this.params = message.data.params;
+        this.detected = message.data.detected;
       } else {
       } else {
         console.warn(message.msg);
         console.warn(message.msg);
         this.notifySvc.error("查询异常,此监控不存在", message.msg);
         this.notifySvc.error("查询异常,此监控不存在", message.msg);
@@ -72,6 +73,14 @@ export class MonitorEditComponent implements OnInit {
             if (param.field === "host") {
             if (param.field === "host") {
               param.value = this.monitor.host;
               param.value = this.monitor.host;
             }
             }
+          } else {
+            if (define.type === "boolean") {
+              if (param.value != null) {
+                param.value = param.value.toLowerCase() == 'true';
+              } else {
+                param.value = false;
+              }
+            }
           }
           }
           this.params.push(param);
           this.params.push(param);
         })
         })