mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
issue: #36784 1. Implement an embedded web server for WebUI access. 2. Complete the homepage development. Home page demo: <img width="2177" alt="iShot_2024-10-10_17 57 34" src="https://github.com/user-attachments/assets/38539917-ce09-4e54-a5b5-7f4f7eaac353"> Signed-off-by: jaime <yun.zhang@zilliz.com>
44 lines
939 B
Go
44 lines
939 B
Go
package paramtable
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/milvus-io/milvus/pkg/config"
|
|
"github.com/milvus-io/milvus/pkg/log"
|
|
)
|
|
|
|
const hookYamlFile = "hook.yaml"
|
|
|
|
type hookConfig struct {
|
|
hookBase *BaseTable
|
|
|
|
SoPath ParamItem `refreshable:"false"`
|
|
SoConfig ParamGroup `refreshable:"true"`
|
|
}
|
|
|
|
func (h *hookConfig) init(base *BaseTable) {
|
|
h.hookBase = base
|
|
log.Info("hook config", zap.Any("hook", base.FileConfigs()))
|
|
|
|
h.SoPath = ParamItem{
|
|
Key: "soPath",
|
|
Version: "2.0.0",
|
|
DefaultValue: "",
|
|
}
|
|
h.SoPath.Init(base.mgr)
|
|
|
|
h.SoConfig = ParamGroup{
|
|
KeyPrefix: "",
|
|
Version: "2.2.0",
|
|
}
|
|
h.SoConfig.Init(base.mgr)
|
|
}
|
|
|
|
func (h *hookConfig) WatchHookWithPrefix(ident string, keyPrefix string, onEvent func(*config.Event)) {
|
|
h.hookBase.mgr.Dispatcher.RegisterForKeyPrefix(keyPrefix, config.NewHandler(ident, onEvent))
|
|
}
|
|
|
|
func (h *hookConfig) GetAll() map[string]string {
|
|
return h.hookBase.mgr.GetConfigs()
|
|
}
|