mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
Add filewatcher for config files (#63)
This adds the filewatcher and forwards events to the frontend. It also sets up the widgets as something that can be controlled with a config file.
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/wavetermdev/thenextwave/pkg/filestore"
|
||||
"github.com/wavetermdev/thenextwave/pkg/util/utilfn"
|
||||
"github.com/wavetermdev/thenextwave/pkg/wavebase"
|
||||
"github.com/wavetermdev/thenextwave/pkg/wconfig"
|
||||
)
|
||||
|
||||
const MaxFileSize = 10 * 1024 * 1024 // 10M
|
||||
@@ -117,3 +118,18 @@ func (fs *FileService) GetWaveFile(id string, path string) (any, error) {
|
||||
}
|
||||
return file, nil
|
||||
}
|
||||
|
||||
func (fs *FileService) GetSettingsConfig() interface{} {
|
||||
watcher := wconfig.GetWatcher()
|
||||
return watcher.GetSettingsConfig()
|
||||
}
|
||||
|
||||
func (fs *FileService) AddWidget(newWidget wconfig.WidgetsConfigType) error {
|
||||
watcher := wconfig.GetWatcher()
|
||||
return watcher.AddWidget(newWidget)
|
||||
}
|
||||
|
||||
func (fs *FileService) RemoveWidget(idx uint) error {
|
||||
watcher := wconfig.GetWatcher()
|
||||
return watcher.RmWidget(idx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user