diff --git a/model/cluster_config.go b/model/cluster_config.go index 5e194a0e..07a7cd38 100644 --- a/model/cluster_config.go +++ b/model/cluster_config.go @@ -12,7 +12,7 @@ type ClusterConfig struct { } `json:"basic_auth,omitempty" elastic_mapping:"basic_auth:{type:object}"` Order int `json:"order,omitempty" elastic_mapping:"order:{type:integer}"` Description string `json:"description,omitempty" elastic_mapping:"description:{type:text}"` - Enabled bool `json:"enabled,omitempty" elastic_mapping:"enabled:{type:boolean}"` + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:boolean}"` Created time.Time `json:"created,omitempty" elastic_mapping:"created:{type:date}"` Updated time.Time `json:"updated,omitempty" elastic_mapping:"updated:{type:date}"` } diff --git a/web/mock/system/cluster.js b/web/mock/system/cluster.js index 40619968..bc552842 100644 --- a/web/mock/system/cluster.js +++ b/web/mock/system/cluster.js @@ -65,7 +65,7 @@ export default { }, 'POST /_search-center/system/cluster': function(req, res){ res.send({ - "_id": "c0obhd4gq9s7akom0o60", + "_id": "c0oc4kkgq9s8qss2uk50", "_source": { "name": "cluster1", "endpoint": "http://localhost:9200", @@ -83,7 +83,7 @@ export default { }, 'PUT /_search-center/system/cluster/:id': function(req, res){ res.send({ - "_id": "c0obhd4gq9s7akom0o60", + "_id": "c0oc4kkgq9s8qss2uk50", "_source": { "basic_auth": { "password": "456", @@ -92,6 +92,7 @@ export default { "description": "xx业务集群2", "endpoint": "http://localhost:9201", "name": "cluster2", + "enabled": true, "updated": "2021-02-20T15:25:12.159789+08:00" }, "result": "updated" @@ -99,8 +100,8 @@ export default { }, 'DELETE /_search-center/system/cluster/:id': function(req, res){ res.send({ - "_id": "c0obk7cgq9s7hi05aou0", + "_id": "c0oc4kkgq9s8qss2uk50", "result": "deleted" }); } -} \ No newline at end of file +} diff --git a/web/src/pages/System/Cluster/Form.js b/web/src/pages/System/Cluster/Form.js index 2223518b..80c85af3 100644 --- a/web/src/pages/System/Cluster/Form.js +++ b/web/src/pages/System/Cluster/Form.js @@ -159,14 +159,14 @@ class ClusterForm extends React.Component{ /> {this.state.needAuth === true ? (