* Refactor alert mute and recording rule retrieval to handle cases where group IDs are empty in the current session
* Update `tags` column default value to '[]' in `alert_mute` table and `AlertMute` struct
* Update gids variable to handle empty query parameter in alertMuteGetsByGids and recordingRuleGetsByGids functions
* Refactor alertMuteGet function to include database to frontend transformation
* change mute datasource
* Refactor AlertSubscribeGetsByBGIds function to handle empty bgids parameter gracefully
* Refactor taskTplTotal and taskTplGets functions to allow filtering by groupIds when provided, enhancing flexibility and optimization
* Refactor taskGetsByGids to handle empty gids and non-admin user cases more efficiently
* add: batch subscription
* add: sql columns for rule_ids and rule_names
* add: add migrate of AlertSubscribe
* update: Remove redundant codes
* fix: The question of 1821
* fix: Optimized for getting rule_ids and rule_names
* fix: error handle
* fix: add rule_ids for update api
* fix: Clear the rule_id to zero when updating
* refactor: Compatible with old rule_id
* refactor: rename
* fix: set rule_id=0 when updating subscription rules
---------
Co-authored-by: wdk <wdk_cc@163.com>
* refactor: remove prod and cate in alert mute (#1828)
* add: remove monitor type in alter mute
* chore: remove prod in alter mute
* chore: remove cate in alter mute
---------
Co-authored-by: wdk <wdk_cc@163.com>
---------
Co-authored-by: Deke Wang <94156972+wdkcc@users.noreply.github.com>
Co-authored-by: wdk <wdk_cc@163.com>
* configs form user crud
* configs form user crud
* code refactor
* code refactor
* configs for user variable update & add InitRSAConfig for alert.go
* configs for user variable update
* remove InitRSAConfig for alert.go
* add config of Center.Encryption
* migrate for config and set default value
* add annotation for Center.Encryption
* code refactor
* code refactor
* code refactor again
* code refactor
* remove userVariableCheck bool return
* remove userVariableCheck bool return
* optimize InitRSAConfig
* optimize InitRSAConfig
* optimize InitRSAConfig
* macro variable
* optimize config
* remove test function user-variable-ras
* code refactor config_cache
* code refactor again
* code refactor again
* ReplaceMacroVariables return string value & optimize code
* add user variable check on ckey, it is not recommended to use the period "."
* change configs ckey+external=uniqueness
* configs add add external value
* configs remove isInternal check(ckey is no longer unique field)
* update userVariableCheck
* migrate drop unique filed limit
* refactor rsa generate logic. read key pairs from config.toml(HTTP.RSA) if file is not exist generate rsa key paris and saving to database(configs).
* Improve the RSA key generation logic. In the first step, attempt to read key pairs from the database or the 'config.toml' file. If they don't exist, generate a new set of key pairs and store them in the database.
* optimize code
* ckey use C-style naming convention and optimize smtp validations
* change email logger. print host & port
* update init rsa config logically
* update migrate about DropUniqueFiled
* update migrate about DropUniqueFiled
* make migrating at the first step
* move config of rsa. generate in db.
---------
Co-authored-by: shardingHe <wangzihe@flashcat.cloud>
Co-authored-by: Yening Qin <710leo@gmail.com>
* configs form user crud
* configs for user variable update & add InitRSAConfig for alert.go
* configs for user variable update
* remove InitRSAConfig for alert.go
* add config of Center.Encryption
* migrate for config and set default value
* add annotation for Center.Encryption
* remove userVariableCheck bool return
* optimize InitRSAConfig
---------
Co-authored-by: shardingHe <wangzihe@flashcat.cloud>
Co-authored-by: Yening Qin <710leo@gmail.com>
* add host ip for target
* update host ip from heartbeat
* update host ip from heartbeat
* batch update host ip from heartbeat
* batch update host ip from heartbeat
* refactor code
* update target when either gid or host_ip has a new value
* rollback
* add debug log
---------
Co-authored-by: shardingHe <wangzihe@flashcat.cloud>
* auto migrate alerting_engines[engine_cluster],task_record[event_id],chart_share[datasource_id],recording_rule[datasource_ids]
* auto migrate code refactor
* auto migrate drop chart_share
* auto migrate drop dashboard_id
---------
Co-authored-by: shardingHe <wangzihe@flashcat.cloud>