Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-04-15 15:58:44 +08:00
16 changed files with 41 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
# Makefile for rest agent project # Makefile for rest agent project
PROJECT = OMC PROJECT = OMC
VERSION = 2.2404.3 VERSION = 2.2404.4
PLATFORM = amd64 PLATFORM = amd64
ARMPLATFORM = aarch64 ARMPLATFORM = aarch64
BUILDDIR = ../../build BUILDDIR = ../../build

View File

@@ -1,7 +1,7 @@
# Makefile for OMC-OMC-crontask project # Makefile for OMC-OMC-crontask project
PROJECT = OMC PROJECT = OMC
VERSION = 2.2404.3 VERSION = 2.2404.4
LIBDIR = be.ems/lib LIBDIR = be.ems/lib
BINNAME = crontask BINNAME = crontask

View File

@@ -1,7 +1,7 @@
# Makefile for rest agent project # Makefile for rest agent project
PROJECT = OMC PROJECT = OMC
VERSION = 2.2404.3 VERSION = 2.2404.4
RelDate = `date +%Y%m%d` RelDate = `date +%Y%m%d`
Release = $(RelDate) Release = $(RelDate)
RelVer = $(VERSION)-$(RelDate) RelVer = $(VERSION)-$(RelDate)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
ProjectL = omc ProjectL = omc
ProjectU = OMC ProjectU = OMC
PROJECT = $(ProjectL) PROJECT = $(ProjectL)
VERSION = 2.2404.3 VERSION = 2.2404.4
RelDate = `date +%Y%m%d` RelDate = `date +%Y%m%d`
Release = $(RelDate) Release = $(RelDate)
RelVer = $(VERSION)-$(RelDate) RelVer = $(VERSION)-$(RelDate)

View File

@@ -27,6 +27,7 @@ case "${extension}" in
EOF EOF
if [ ${neType} == "OMC" ]; then if [ ${neType} == "OMC" ]; then
${omcBin}/setomc.sh -m upgrade >> ${logFile} ${omcBin}/setomc.sh -m upgrade >> ${logFile}
${omcBin}/omcsvc.sh restart
fi fi
;; ;;
rpm) rpm)
@@ -42,6 +43,7 @@ EOF
EOF EOF
if [ ${neType} == "OMC" ]; then if [ ${neType} == "OMC" ]; then
${omcBin}/setomc.sh -m upgrade >> ${logFile} ${omcBin}/setomc.sh -m upgrade >> ${logFile}
${omcBin}/omcsvc.sh restart
fi fi
;; ;;
*) *)

View File

@@ -27,6 +27,7 @@ case "${extension}" in
EOF EOF
if [ ${neType} == "OMC" ]; then if [ ${neType} == "OMC" ]; then
${omcBin}/setomc.sh -m upgrade >> ${logFile} ${omcBin}/setomc.sh -m upgrade >> ${logFile}
${omcBin}/omcsvc.sh restart
fi fi
;; ;;
rpm) rpm)
@@ -42,6 +43,7 @@ EOF
EOF EOF
if [ ${neType} == "OMC" ]; then if [ ${neType} == "OMC" ]; then
${omcBin}/setomc.sh -m upgrade >> ${logFile} ${omcBin}/setomc.sh -m upgrade >> ${logFile}
${omcBin}/omcsvc.sh restart
fi fi
;; ;;
*) *)

View File

@@ -2,7 +2,7 @@
ProcList="restagent crontask sshsvc captrace data2html" ProcList="restagent crontask sshsvc captrace data2html"
ProjectL=omc ProjectL=omc
VERSION=2.2404.3 VERSION=2.2404.4
RelDate=`date +%Y%m%d` RelDate=`date +%Y%m%d`
Release=${RelDate} Release=${RelDate}
RelVer=${VERSION}-${RelDate} RelVer=${VERSION}-${RelDate}

View File

@@ -1,7 +1,7 @@
# Makefile for rest agent project # Makefile for rest agent project
PROJECT = OMC PROJECT = OMC
VERSION = 2.2404.3 VERSION = 2.2404.4
PLATFORM = amd64 PLATFORM = amd64
ARMPLATFORM = aarch64 ARMPLATFORM = aarch64
BUILDDIR = ../../build BUILDDIR = ../../build

View File

@@ -1,7 +1,7 @@
# 项目信息 # 项目信息
framework: framework:
name: "CN EMS" name: "CN EMS"
version: "2.2404.3" version: "2.2404.4"
# 应用服务配置 # 应用服务配置
server: server:

View File

@@ -40,12 +40,17 @@ type SysJobController struct {
// //
// GET /list // GET /list
func (s *SysJobController) List(c *gin.Context) { func (s *SysJobController) List(c *gin.Context) {
querys := ctx.QueryMap(c)
data := s.sysJobService.SelectJobPage(querys)
rows := data["rows"].([]model.SysJob)
// 闭包函数处理多语言
language := ctx.AcceptLanguage(c) language := ctx.AcceptLanguage(c)
querys := ctx.QueryMap(c)
// 多语言值转key查询
if v, ok := querys["jobName"]; ok && v != "" {
querys["jobName"] = i18n.TFindKeyPrefix(language, "job", v.(string))
}
data := s.sysJobService.SelectJobPage(querys)
rows := data["rows"].([]model.SysJob)
// 闭包函数处理多语言
converI18n := func(language string, arr *[]model.SysJob) { converI18n := func(language string, arr *[]model.SysJob) {
for i := range *arr { for i := range *arr {
(*arr)[i].JobName = i18n.TKey(language, (*arr)[i].JobName) (*arr)[i].JobName = i18n.TKey(language, (*arr)[i].JobName)

View File

@@ -39,6 +39,7 @@ type SysJobLogController struct {
// //
// GET /list // GET /list
func (s *SysJobLogController) List(c *gin.Context) { func (s *SysJobLogController) List(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询参数转换map // 查询参数转换map
querys := ctx.QueryMap(c) querys := ctx.QueryMap(c)
// 任务ID优先级更高 // 任务ID优先级更高
@@ -47,11 +48,15 @@ func (s *SysJobLogController) List(c *gin.Context) {
querys["jobName"] = jobInfo.JobName querys["jobName"] = jobInfo.JobName
querys["jobGroup"] = jobInfo.JobGroup querys["jobGroup"] = jobInfo.JobGroup
} }
data := s.sysJobLogService.SelectJobLogPage(querys) // 多语言值转key查询
if v, ok := querys["jobName"]; ok && v != "" {
querys["jobName"] = i18n.TFindKeyPrefix(language, "job", v.(string))
}
data := s.sysJobLogService.SelectJobLogPage(querys)
rows := data["rows"].([]model.SysJobLog) rows := data["rows"].([]model.SysJobLog)
// 闭包函数处理多语言 // 闭包函数处理多语言
language := ctx.AcceptLanguage(c)
converI18n := func(language string, arr *[]model.SysJobLog) { converI18n := func(language string, arr *[]model.SysJobLog) {
for i := range *arr { for i := range *arr {
(*arr)[i].JobName = i18n.TKey(language, (*arr)[i].JobName) (*arr)[i].JobName = i18n.TKey(language, (*arr)[i].JobName)

View File

@@ -35,13 +35,13 @@ func (s *SysDeptController) List(c *gin.Context) {
language := ctx.AcceptLanguage(c) language := ctx.AcceptLanguage(c)
var querys struct { var querys struct {
// 部门ID // 部门ID
DeptID string `json:"deptId"` DeptID string `form:"deptId"`
// 父部门ID // 父部门ID
ParentID string `json:"parentId" ` ParentID string `form:"parentId" `
// 部门名称 // 部门名称
DeptName string `json:"deptName" ` DeptName string `form:"deptName" `
// 部门状态0正常 1停用 // 部门状态0正常 1停用
Status string `json:"status"` Status string `form:"status"`
} }
err := c.ShouldBindQuery(&querys) err := c.ShouldBindQuery(&querys)
if err != nil { if err != nil {

View File

@@ -33,9 +33,10 @@ type SysMenuController struct {
// //
// GET /list // GET /list
func (s *SysMenuController) List(c *gin.Context) { func (s *SysMenuController) List(c *gin.Context) {
language := ctx.AcceptLanguage(c)
query := model.SysMenu{} query := model.SysMenu{}
if v, ok := c.GetQuery("menuName"); ok && v != "" { if v, ok := c.GetQuery("menuName"); ok && v != "" {
query.MenuName = v query.MenuName = i18n.TFindKeyPrefix(language, "menu", v)
} }
if v, ok := c.GetQuery("status"); ok && v != "" { if v, ok := c.GetQuery("status"); ok && v != "" {
query.Status = v query.Status = v
@@ -48,7 +49,6 @@ func (s *SysMenuController) List(c *gin.Context) {
data := s.sysMenuService.SelectMenuList(query, userId) data := s.sysMenuService.SelectMenuList(query, userId)
// 闭包函数处理多语言 // 闭包函数处理多语言
language := ctx.AcceptLanguage(c)
var converI18n func(language string, arr *[]model.SysMenu) var converI18n func(language string, arr *[]model.SysMenu)
converI18n = func(language string, arr *[]model.SysMenu) { converI18n = func(language string, arr *[]model.SysMenu) {
for i := range *arr { for i := range *arr {

View File

@@ -1,7 +1,7 @@
# Makefile for OMC-OMC-crontask project # Makefile for OMC-OMC-crontask project
PROJECT = OMC PROJECT = OMC
VERSION = 2.2404.3 VERSION = 2.2404.4
LIBDIR = be.ems/lib LIBDIR = be.ems/lib
BINNAME = sshsvc BINNAME = sshsvc