mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
Compare commits
3 Commits
b875fe7168
...
cef1e64cab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cef1e64cab | ||
|
|
430aa6bbf1 | ||
|
|
a086e48aae |
@ -119,7 +119,6 @@ docker run -d -p 8080:8080 -e GLC_CLUSTER_MODE=true -e GLC_SERVER_URL=http://172
|
||||
- [x] `GLC_BLACK_LIST`黑名单,多个用逗号分隔,黑白名单冲突时白名单优先,默认空白。可设定IP,最后段支持通配符,如`1.2.3.*`,也支持单个通配符`*`代表全部(也就是只允许内网或白名单指定使用),实验性质的支持区域名称(因为IP地域查询可能有误差)
|
||||
- [x] `GLC_IP_ADD_CITY`对IP字段是否自动附加城市信息,默认`false`
|
||||
- [x] `GLC_NEAR_SEARCH_SIZE`定位相邻检索时的检索件数,默认200,有效范围50-1000
|
||||
- [x] `GLC_ENABLE_CHATAI`是否开启GLC智能助手,默认true,会在菜单栏显示
|
||||
|
||||
|
||||
## 接口
|
||||
@ -293,6 +292,12 @@ docker run -d -p --log-driver=fluentd --log-opt fluentd-address=192.168.169.170:
|
||||
- [ ] 日志审计、告警
|
||||
|
||||
|
||||
### 版本`0.17.6`
|
||||
|
||||
- [x] 取消智能助手(AI发展引动难以满足的高期望值)
|
||||
- [x] 修复已知问题(#65、#70)
|
||||
|
||||
|
||||
### 版本`0.17.5`
|
||||
|
||||
- [x] 更新依赖包(#66)
|
||||
|
||||
@ -61,7 +61,6 @@ var tokenSalt string
|
||||
var aryWhite []string
|
||||
var aryBlack []string
|
||||
var ipAddCity bool
|
||||
var enableChatAi bool
|
||||
|
||||
func init() {
|
||||
UpdateConfigByEnv()
|
||||
@ -107,12 +106,6 @@ func UpdateConfigByEnv() {
|
||||
nearSearchSize = getNearSearchSizeConf(cmn.GetEnvInt("GLC_NEAR_SEARCH_SIZE", 200)) // 定位相邻检索的查询件数,默认200(有效范围50~1000)
|
||||
mulitLineSearch = cmn.GetEnvBool("GLC_SEARCH_MULIT_LINE", false) // 是否检索日志的全部行(日志可能有换行),默认false仅第一行
|
||||
testMode = cmn.GetEnvBool("GLC_TEST_MODE", false) // 是否测试模式,默认false
|
||||
enableChatAi = cmn.GetEnvBool("GLC_ENABLE_CHATAI", true) // 是否开启GLC智能助手,默认true
|
||||
}
|
||||
|
||||
// 取配置: 是否开启GLC智能助手
|
||||
func IsEnableChatAi() bool {
|
||||
return enableChatAi
|
||||
}
|
||||
|
||||
// 取配置: 定位相邻检索的查询件数,可通过环境变量“GLC_NEAR_SEARCH_SIZE”设定,默认200件
|
||||
|
||||
@ -240,6 +240,7 @@ func (s *WordIndexStorage) Close() {
|
||||
idxMu.Lock() // map锁
|
||||
defer idxMu.Unlock() // map解锁
|
||||
mapStorage.Delete(s.storeName) // 设空,下回GetStorage时自动再创建
|
||||
s.mapWordCounter.Clear() // 清空辅助回收
|
||||
|
||||
cmn.Info("关闭WordIndexStorage:", s.storeName+cmn.PathSeparator()+s.subPath)
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import (
|
||||
)
|
||||
|
||||
var mapStorageHandle sync.Map
|
||||
var mapStorageMu sync.Mutex
|
||||
|
||||
// 日志存储结构体
|
||||
type LogDataStorageHandle struct {
|
||||
@ -30,6 +31,21 @@ func NewLogDataStorageHandle(storeName string) *LogDataStorageHandle {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除缓存中已关闭的存储对象
|
||||
mapStorageMu.Lock()
|
||||
defer mapStorageMu.Unlock()
|
||||
var delKeys []any
|
||||
mapStorageHandle.Range(func(key, value any) bool {
|
||||
s := value.(*LogDataStorageHandle)
|
||||
if s.storage.IsClose() {
|
||||
delKeys = append(delKeys, key)
|
||||
}
|
||||
return true
|
||||
})
|
||||
for _, key := range delKeys {
|
||||
mapStorageHandle.Delete(key)
|
||||
}
|
||||
|
||||
store := &LogDataStorageHandle{
|
||||
storage: logdata.NewLogDataStorage(storeName),
|
||||
}
|
||||
|
||||
@ -57,7 +57,6 @@ func Run() {
|
||||
gweb.RegisterController(method.POST, contextPath+conf.SysUserTransferChgPsw, controller.UserTransferChangePswController) // [用户]转发修改自己密码
|
||||
gweb.RegisterController(method.POST, contextPath+conf.SysUserTransferSave, controller.UserTransferSaveController) // [用户]转发保存
|
||||
gweb.RegisterController(method.POST, contextPath+conf.SysUserTransferDel, controller.UserTransferDelController) // [用户]转发删除
|
||||
gweb.RegisterController(method.POST, contextPath+"/v1/sys/chatai", controller.ChatAiController) // 查询是否开启智能助手
|
||||
|
||||
// 集群操作接口
|
||||
gweb.RegisterController(method.POST, contextPath+"/sys/cluster/info", controller.ClusterGetClusterInfoController) // 获取集群信息
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package ver
|
||||
|
||||
// 版本号,升级版本时修改
|
||||
const VERSION = "v0.17.5"
|
||||
const VERSION = "v0.17.6"
|
||||
|
||||
@ -16,11 +16,6 @@ import (
|
||||
var glcLatest string = ""
|
||||
var glcOrigin string = ""
|
||||
|
||||
// 查询是否开启智能助手
|
||||
func ChatAiController(req *gweb.HttpRequest) *gweb.HttpResult {
|
||||
return gweb.Result(conf.IsEnableChatAi())
|
||||
}
|
||||
|
||||
// 查询是否测试模式
|
||||
func TestModeController(req *gweb.HttpRequest) *gweb.HttpResult {
|
||||
return gweb.Result(conf.IsTestMode())
|
||||
|
||||
@ -60,7 +60,7 @@ export const getUserMenu = async () => {
|
||||
openInner: true,
|
||||
});
|
||||
|
||||
let rs = await $post('/v1/user/enableLogin', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' });
|
||||
const rs = await $post('/v1/user/enableLogin', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' });
|
||||
if (rs.success && rs.result) {
|
||||
menus.push({
|
||||
path: '/glc/sysuser',
|
||||
@ -72,16 +72,5 @@ export const getUserMenu = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
rs = await $post('/v1/sys/chatai', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' });
|
||||
if (rs.success && rs.result) {
|
||||
menus.push({
|
||||
path: '/glc/chatai',
|
||||
title: 'GLC智能助手',
|
||||
icon: 'ai',
|
||||
component: 'https://ai.youdao.com/saas/qanything/#/bots/C9BA280AA796491F/share',
|
||||
openInner: true,
|
||||
});
|
||||
}
|
||||
|
||||
return (menuState.aryMenu = menus);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user