diff --git a/api/index_management/indices.go b/api/index_management/indices.go index 75508841..a0f44ae0 100644 --- a/api/index_management/indices.go +++ b/api/index_management/indices.go @@ -39,7 +39,7 @@ func (handler APIHandler) HandleGetMappingsAction(w http.ResponseWriter, req *ht func (handler APIHandler) HandleGetIndicesAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { client := elastic.GetClient(handler.Config.Elasticsearch) - catIndices, err := client.GetIndices() + catIndices, err := client.GetIndices("") for key, _ := range *catIndices { if strings.HasPrefix(key,".") || strings.HasPrefix(key, "infini-"){ delete(*catIndices, key) @@ -130,4 +130,4 @@ func (handler APIHandler) HandleCreateIndexAction(w http.ResponseWriter, req *ht } resBody["payload"] = true handler.WriteJSON(w, resBody, http.StatusOK) -} \ No newline at end of file +} diff --git a/main.go b/main.go index e2d6ddf9..9fcca0de 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ import ( "errors" _ "expvar" "infini.sh/framework" - "infini.sh/framework/core/elastic" "infini.sh/framework/core/env" "infini.sh/framework/core/module" "infini.sh/framework/core/orm" @@ -71,7 +70,6 @@ func main() { }, func() { orm.RegisterSchemaWithIndexName(model.Dict{}, "dict") orm.RegisterSchemaWithIndexName(model.Reindex{}, "reindex") - orm.RegisterSchemaWithIndexName(elastic.ElasticsearchConfig{}, "cluster") }) } diff --git a/search-center.yml b/search-center.yml index 5d65c849..8b2cc038 100644 --- a/search-center.yml +++ b/search-center.yml @@ -23,6 +23,8 @@ modules: enabled: true store: enabled: true + monitoring: + enabled: true orm: enabled: true init_template: true diff --git a/web/mock/cluster/cluster.js b/web/mock/cluster/cluster.js index 318b7d80..37c8570b 100644 --- a/web/mock/cluster/cluster.js +++ b/web/mock/cluster/cluster.js @@ -22,6 +22,7 @@ export default { "created": "2021-02-20T16:03:30.867084+08:00", "description": "xx业务集群1", "enabled": true, + "monitored": true, "endpoint": "http://localhost:9200", "name": "cluster1", "updated": "2021-02-20T16:03:30.867084+08:00" @@ -39,6 +40,7 @@ export default { "created": "2021-02-20T16:03:30.867084+08:00", "description": "xx业务集群2", "enabled": true, + "monitored": true, "endpoint": "http://localhost:9201", "name": "cluster2", "updated": "2021-02-20T16:03:30.867084+08:00" @@ -71,6 +73,7 @@ export default { "created": "2021-02-20T16:03:30.867084+08:00", "description": "xx业务集群1", "enabled": false, + "monitored": true, "endpoint": "http://localhost:9200", "name": "cluster1", "updated": "2021-02-20T16:03:30.867084+08:00" @@ -92,6 +95,7 @@ export default { }, "description": "xx业务集群1", "enabled": false, + "monitored": true, "created": "2021-02-20T15:12:50.984062+08:00", "updated": "2021-02-20T15:12:50.984062+08:00" }, @@ -110,6 +114,7 @@ export default { "endpoint": "http://localhost:9201", "name": "cluster2", "enabled": true, + "monitored": true, "updated": "2021-02-20T15:25:12.159789+08:00" }, "result": "updated" diff --git a/web/src/pages/System/Cluster/Form.js b/web/src/pages/System/Cluster/Form.js index 80c85af3..79f36662 100644 --- a/web/src/pages/System/Cluster/Form.js +++ b/web/src/pages/System/Cluster/Form.js @@ -59,6 +59,7 @@ class ClusterForm extends React.Component{ }, description: values.description, enabled: values.enabled, + monitored: values.monitored, order: values.order, } if(clusterConfig.editMode === 'NEW') { @@ -193,6 +194,15 @@ class ClusterForm extends React.Component{ unCheckedChildren={} />)} + + {getFieldDecorator('monitored', { + valuePropName: 'checked', + initialValue: typeof editValue.monitored === 'undefined' ? true: editValue.monitored, + })(} + unCheckedChildren={} + />)} +