mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
前端重构改良
This commit is contained in:
parent
b9bbd49e5a
commit
20e5ce22b3
@ -21,7 +21,7 @@ var storeNameAutoAddDate bool
|
||||
var serverUrl string
|
||||
var serverIp string
|
||||
var serverPort string = "8080"
|
||||
var contextPath string
|
||||
var contextPath string = "/glc" // web服务contextPath,固定【/glc】
|
||||
var enableSecurityKey bool
|
||||
var securityKey string
|
||||
var headerSecurityKey string
|
||||
@ -68,7 +68,6 @@ func UpdateConfigByEnv() {
|
||||
storeNameAutoAddDate = cmn.GetEnvBool("GLC_STORE_NAME_AUTO_ADD_DATE", true) // 存储名是否自动添加日期(日志量大通常按日单位区分存储),默认true
|
||||
serverUrl = cmn.GetEnvStr("GLC_SERVER_URL", "") // 服务URL,默认“”,集群配置时自动获取地址可能不对,可通过这个设定
|
||||
serverIp = cmn.GetEnvStr("GLC_SERVER_IP", "") // 服务IP,默认“”,当“”时会自动获取
|
||||
contextPath = cmn.GetEnvStr("GLC_CONTEXT_PATH", "/glc") // web服务contextPath
|
||||
enableSecurityKey = cmn.GetEnvBool("GLC_ENABLE_SECURITY_KEY", false) // web服务是否开启API秘钥校验,默认false
|
||||
headerSecurityKey = cmn.GetEnvStr("GLC_HEADER_SECURITY_KEY", "X-GLC-AUTH") // web服务API秘钥的header键名
|
||||
securityKey = cmn.GetEnvStr("GLC_SECURITY_KEY", "glogcenter") // web服务API秘钥
|
||||
@ -93,6 +92,7 @@ func UpdateConfigByEnv() {
|
||||
goMaxProcess = getGoMaxProcessConf(cmn.GetEnvInt("GLC_GOMAXPROCS", -1)) // 使用的最大CPU数量,默认是最大CPU数量(设定值不在实际数量范围是按最大看待)
|
||||
enableCors = cmn.GetEnvBool("GLC_ENABLE_CORS", false) // 是否允许跨域,默认false
|
||||
pageSize = getPageSizeConf(cmn.GetEnvInt("GLC_PAGE_SIZE", 100)) // 每次检索件数,默认100(有效范围1~1000)
|
||||
// contextPath = cmn.GetEnvStr("GLC_CONTEXT_PATH", "/glc") // web服务contextPath
|
||||
}
|
||||
|
||||
func GetPageSize() int {
|
||||
|
||||
@ -454,14 +454,20 @@ button.el-button.is-link:active {
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.c-gx-dialog * {
|
||||
font-size: 12px;
|
||||
}
|
||||
// .c-gx-dialog *,
|
||||
// .c-popover-table * {
|
||||
// font-size: 14px;
|
||||
// }
|
||||
|
||||
div.el-range-editor--small.el-input__wrapper {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
// 表格配置
|
||||
.c-popover-table .el-input--small input.el-input__inner {
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
// el-table setting
|
||||
.c-popover-table {
|
||||
.el-input--small .el-input__inner {
|
||||
|
||||
@ -209,21 +209,19 @@ function search() {
|
||||
if (rs.success) {
|
||||
const resultData = rs.result.data || [];
|
||||
tableData.value.splice(0, tableData.value.length); // 删除原全部元素,nextTick时再插入新查询结果
|
||||
|
||||
// tableData.value.push(resultData);
|
||||
document.querySelector('.c-glc-table .el-scrollbar__wrap').scrollTop = 0; // 滚动到顶部
|
||||
|
||||
if (resultData.length < data.pageSize) {
|
||||
info.value = `日志总量 ${rs.result.total} 条,当前条件最多匹配 ${resultData.length} 条,正展示前 ${resultData.length} 条`
|
||||
} else {
|
||||
info.value = `日志总量 ${rs.result.total} 条,当前条件最多匹配 ${rs.result.count} 条,正展示前 ${tableData.value.length} 条`
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
resultData.forEach(item => {
|
||||
tableData.value.push(item);
|
||||
item.system && !systemSet.has(item.system) && systemSet.add(item.system) && systemOptions.value.push({ value: item.system, label: item.system });
|
||||
});
|
||||
|
||||
if (resultData.length < data.pageSize) {
|
||||
info.value = `日志总量 ${rs.result.total} 条,当前条件最多匹配 ${resultData.length} 条,正展示前 ${resultData.length} 条`
|
||||
} else {
|
||||
info.value = `日志总量 ${rs.result.total} 条,当前条件最多匹配 ${rs.result.count} 条,正展示前 ${tableData.value.length} 条`
|
||||
}
|
||||
});
|
||||
} else if (rs.code == 403) {
|
||||
userLogout(); // 403 时登出
|
||||
|
||||
Loading…
Reference in New Issue
Block a user