enable cluster on create

This commit is contained in:
medcl 2021-02-20 21:11:46 +08:00
parent 523ba2fbec
commit c83aa38de9
2 changed files with 2 additions and 1 deletions

View File

@ -33,6 +33,7 @@ func (h *APIHandler) HandleCreateClusterAction(w http.ResponseWriter, req *http.
esClient := elastic.GetClient(h.Config.Elasticsearch)
id := util.GetUUID()
conf.Created = time.Now()
conf.Enabled=true
conf.Updated = conf.Created
//conf.ID = id
index:=orm.GetIndexName(model.ClusterConfig{})

View File

@ -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" elastic_mapping:"enabled:{type:boolean}"`
Enabled bool `json:"enabled,omitempty" 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}"`
}