update for metric monitoring
This commit is contained in:
parent
b9781eb545
commit
6af35863fb
|
@ -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)
|
||||
|
|
2
main.go
2
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")
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ modules:
|
|||
enabled: true
|
||||
store:
|
||||
enabled: true
|
||||
monitoring:
|
||||
enabled: true
|
||||
orm:
|
||||
enabled: true
|
||||
init_template: true
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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={<Icon type="close" />}
|
||||
/>)}
|
||||
</Form.Item>
|
||||
<Form.Item label="启用监控">
|
||||
{getFieldDecorator('monitored', {
|
||||
valuePropName: 'checked',
|
||||
initialValue: typeof editValue.monitored === 'undefined' ? true: editValue.monitored,
|
||||
})(<Switch
|
||||
checkedChildren={<Icon type="check" />}
|
||||
unCheckedChildren={<Icon type="close" />}
|
||||
/>)}
|
||||
</Form.Item>
|
||||
<Form.Item {...tailFormItemLayout}>
|
||||
<Button type="primary" onClick={this.handleSubmit}>
|
||||
{editMode === 'NEW' ? 'Register': 'Save'}
|
||||
|
|
Loading…
Reference in New Issue