move frontend settings into the DB (for consistent settings handling).

Flattened settings object.
This commit is contained in:
Jason Kulatunga
2022-07-23 09:32:56 -07:00
parent c0f1dfdb0b
commit 54e2cacb00
7 changed files with 79 additions and 43 deletions
@@ -1,6 +1,7 @@
package handler
import (
"fmt"
"github.com/analogj/scrutiny/webapp/backend/pkg"
"github.com/analogj/scrutiny/webapp/backend/pkg/config"
"github.com/analogj/scrutiny/webapp/backend/pkg/database"
@@ -70,8 +71,8 @@ func UploadDeviceMetrics(c *gin.Context) {
if notify.ShouldNotify(
updatedDevice,
smartData,
pkg.MetricsStatusThreshold(appConfig.GetInt("dbsetting.metrics.status.threshold")),
pkg.MetricsStatusFilterAttributes(appConfig.GetInt("dbsetting.metrics.status.filter_attributes")),
pkg.MetricsStatusThreshold(appConfig.GetInt(fmt.Sprintf("%s.metrics.statusThreshold", config.DB_USER_SETTINGS_SUBKEY))),
pkg.MetricsStatusFilterAttributes(appConfig.GetInt(fmt.Sprintf("%s.metrics.statusFilterAttributes", config.DB_USER_SETTINGS_SUBKEY))),
) {
//send notifications