diff --git a/build/code.quality.props b/build/code.quality.props index bdb6e183..4ceae2fd 100644 --- a/build/code.quality.props +++ b/build/code.quality.props @@ -19,11 +19,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/package.json b/package.json index ba87080b..23d0e7ad 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "version": "1.1.1", "devDependencies": { - "cz-git": "^1.9.1", + "cz-git": "^1.9.2", "commitizen": "^4.3.0", - "prettier": "^3.2.5", + "prettier": "^3.3.0", "standard-version": "^9.5.0" }, "config": { @@ -11,4 +11,4 @@ "path": "node_modules/cz-git" } } -} +} \ No newline at end of file diff --git a/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs b/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs index 5bad6d10..a86d0b7f 100644 --- a/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs +++ b/src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_Job.cs @@ -37,6 +37,13 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary [JsonIgnore] public virtual string JobName { get; init; } + /// + /// 上次执行耗时 + /// + [Column] + [JsonIgnore] + public virtual long? LastDuration { get; init; } + /// /// 上次执行时间 /// diff --git a/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs b/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs index 265043a1..7f40593a 100644 --- a/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs +++ b/src/backend/NetAdmin.Domain/Dto/Sys/Job/QueryJobRsp.cs @@ -43,6 +43,10 @@ public sealed record QueryJobRsp : Sys_Job [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public override string JobName { get; init; } + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public override long? LastDuration { get; init; } + /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public override DateTime? LastExecTime { get; init; } diff --git a/src/backend/NetAdmin.SysComponent.Host/Jobs/ScheduledJob.cs b/src/backend/NetAdmin.SysComponent.Host/Jobs/ScheduledJob.cs index 9f0e2217..2d804c54 100644 --- a/src/backend/NetAdmin.SysComponent.Host/Jobs/ScheduledJob.cs +++ b/src/backend/NetAdmin.SysComponent.Host/Jobs/ScheduledJob.cs @@ -68,7 +68,7 @@ public sealed class ScheduledJob : WorkBase, IJob var request = BuildRequest(job); var sw = new Stopwatch(); sw.Start(); - var rsp = await request.SendAsync(cancelToken).ConfigureAwait(false); + var rsp = await request.SendAsync(CancellationToken.None).ConfigureAwait(false); if (rsp.StatusCode == HttpStatusCode.Unauthorized) { var loginRsp = await _userService.LoginByUserIdAsync(job.UserId).ConfigureAwait(false); #pragma warning disable S2696 @@ -76,12 +76,13 @@ public sealed class ScheduledJob : WorkBase, IJob _refreshToken = loginRsp.RefreshToken; #pragma warning restore S2696 request = BuildRequest(job); - rsp = await request.SendAsync(cancelToken).ConfigureAwait(false); + rsp = await request.SendAsync(CancellationToken.None).ConfigureAwait(false); } sw.Stop(); await UowManager.AtomicOperateAsync(async () => { - var rspBody = await rsp.Content.ReadAsStringAsync(cancelToken).ConfigureAwait(false); + var rspBody = await rsp.Content.ReadAsStringAsync(CancellationToken.None) + .ConfigureAwait(false); var jobRecord = new CreateJobRecordReq // { Duration = sw.ElapsedMilliseconds @@ -97,7 +98,10 @@ public sealed class ScheduledJob : WorkBase, IJob }; _ = await _jobRecordService.CreateAsync(jobRecord).ConfigureAwait(false); await _jobService - .FinishJobAsync(job.Adapt() with { LastStatusCode = rsp.StatusCode }) + .FinishJobAsync(job.Adapt() with { + LastStatusCode = rsp.StatusCode + , LastDuration = jobRecord.Duration + }) .ConfigureAwait(false); }) .ConfigureAwait(false); diff --git a/src/frontend/admin/package.json b/src/frontend/admin/package.json index 9bd2a78a..8248eff9 100644 --- a/src/frontend/admin/package.json +++ b/src/frontend/admin/package.json @@ -11,14 +11,14 @@ "dependencies": { "@element-plus/icons-vue": "^2.3.1", "@tinymce/tinymce-vue": "^5.1.1", - "ace-builds": "^1.33.2", - "axios": "^1.6.8", + "ace-builds": "^1.34.2", + "axios": "^1.7.2", "clipboard": "^2.0.11", "core-js": "^3.37.1", "cropperjs": "^1.6.2", "crypto-js": "^4.2.0", "echarts": "^5.5.0", - "element-plus": "^2.7.3", + "element-plus": "^2.7.4", "json-bigint": "^1.0.0", "json5-to-table": "^0.1.8", "markdown-it": "^14.1.0", @@ -36,16 +36,16 @@ "vue3-json-viewer": "^2.2.2", "vuedraggable": "^4.0.3", "vuex": "^4.1.0", - "xgplayer": "^3.0.17", - "xgplayer-hls": "^3.0.17" + "xgplayer": "^3.0.18", + "xgplayer-hls": "^3.0.18" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.0.4", - "prettier": "^3.2.5", + "@vitejs/plugin-vue": "^5.0.5", + "prettier": "^3.3.0", "prettier-plugin-organize-attributes": "^1.0.0", - "sass": "^1.77.2", + "sass": "^1.77.4", "terser": "^5.31.0", - "vite": "^5.2.11" + "vite": "^5.2.12" }, "browserslist": [ "> 1%", diff --git a/src/frontend/admin/src/style/fix.scss b/src/frontend/admin/src/style/fix.scss index 6b598dd6..28e29fce 100644 --- a/src/frontend/admin/src/style/fix.scss +++ b/src/frontend/admin/src/style/fix.scss @@ -209,18 +209,14 @@ border-left: 0; } -.el-table.el-table--large { +.el-table * { + font-size: 0.9rem; +} + +.el-table.el-table--large * { font-size: 1rem; } -.el-table.el-table--small { - font-size: 0.9rem; -} - -.el-table { - font-size: 0.9rem; -} - .el-radio-button__inner { font-size: 0.9rem; } diff --git a/src/frontend/admin/src/views/sys/job/index.vue b/src/frontend/admin/src/views/sys/job/index.vue index 06f4160e..7f9ce6bf 100644 --- a/src/frontend/admin/src/views/sys/job/index.vue +++ b/src/frontend/admin/src/views/sys/job/index.vue @@ -109,20 +109,33 @@ " prop="httpMethod" width="100" /> - - - - + + + + + + {{ + this.$GLOBAL.enums.httpStatusCodes[scope.row.lastStatusCode] + ? this.$GLOBAL.enums.httpStatusCodes[scope.row.lastStatusCode][1] + : scope.row.lastStatusCode + }} + + + + + + + + + + - @@ -151,7 +164,8 @@ }, ) " - :vue="this" /> + :vue="this" + width="180" /> @@ -168,6 +182,7 @@ import saveDialog from './save' import table from '@/config/table' import naColOperation from '@/config/naColOperation' import ScSelectFilter from '@/components/scSelectFilter/index.vue' +import tool from '@/utils/tool' export default { components: { @@ -199,6 +214,9 @@ export default { }, watch: {}, computed: { + tool() { + return tool + }, naColOperation() { return naColOperation }, diff --git a/src/frontend/admin/src/views/sys/job/save.vue b/src/frontend/admin/src/views/sys/job/save.vue index 43249db1..a203fdfa 100644 --- a/src/frontend/admin/src/views/sys/job/save.vue +++ b/src/frontend/admin/src/views/sys/job/save.vue @@ -27,6 +27,9 @@ + + +