-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 改动 对部分操作类型的操作日志的详细内容进行了一部分优化 - 提交作业,创建应用,结束作业新增 clusterId - 增加作业模板,删除作业模板,更新作业模板 新增clusterId - 创建桌面新增clusterId, loginNode, 删除桌面新增clusterId - 设置作业时限增加clusterId 对历史数据的处理,利用migration给上述操作类型的操作日志数据增加默认值,统一都是空字符串,展示历史数据时,显示unknown ![image](https://github.com/PKUHPC/SCOW/assets/130351655/72f5c63d-47fa-49d1-a2f6-261fad8fef6e) ![image](https://github.com/PKUHPC/SCOW/assets/130351655/a7c1459b-977d-42d5-8960-ff75cc54ba16)
- Loading branch information
1 parent
16f4465
commit d3d891a
Showing
19 changed files
with
244 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@scow/grpc-api": patch | ||
--- | ||
|
||
门户系统部分操作类型增加 clusterId 及 loginNode 参数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@scow/audit-server": patch | ||
"@scow/portal-web": patch | ||
"@scow/mis-web": patch | ||
--- | ||
|
||
操作日志详细内容展示优化 |
97 changes: 97 additions & 0 deletions
97
apps/audit-server/src/migrations/Migration20240218000000.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { Migration } from "@mikro-orm/migrations"; | ||
|
||
export class Migration20240129000000 extends Migration { | ||
|
||
async up(): Promise<void> { | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.submitJob.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'submitJob'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.endJob.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'endJob'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.addJobTemplate.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'addJobTemplate'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.deleteJobTemplate.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'deleteJobTemplate'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.updateJobTemplate.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'updateJobTemplate'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.createDesktop.clusterId', '', '$.createDesktop.loginNode', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'createDesktop'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.deleteDesktop.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'deleteDesktop'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.createApp.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'createApp'; | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_SET(meta_data, '$.setJobTimeLimit.clusterId', '') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'setJobTimeLimit'; | ||
`); | ||
} | ||
|
||
async down(): Promise<void> { | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.submitJob.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'submitJob' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.submitJob.clusterId'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.endJob.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'endJob' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.endJob.clusterId'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.addJobTemplate.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'addJobTemplate' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.addJobTemplate.clusterId'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.deleteJobTemplate.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'deleteJobTemplate' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.deleteJobTemplate.clusterId'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.updateJobTemplate.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'updateJobTemplate' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.updateJobTemplate.clusterId'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data,'$.createDesktop.clusterId','$.createDesktop.loginNode') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'createDesktop' | ||
AND JSON_CONTAINS_PATH(meta_data, 'one', '$.createDesktop.clusterId') | ||
AND JSON_CONTAINS_PATH(meta_data, 'one', '$.createDesktop.loginNode'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.createApp.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'createApp' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.createApp.clusterId'); | ||
`); | ||
this.addSql(` | ||
UPDATE operation_log | ||
SET meta_data = JSON_REMOVE(meta_data, '$.setJobTimeLimit.clusterId') | ||
WHERE JSON_UNQUOTE(JSON_EXTRACT(meta_data, '$.$case')) = 'setJobTimeLimit' AND JSON_CONTAINS_PATH(meta_data, 'one', '$.setJobTimeLimit.clusterId'); | ||
`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.