diff --git a/VideoAnalysis/Expand/CoravelExpand.cs b/VideoAnalysis/Expand/CoravelExpand.cs index b82db7a..9b7999e 100644 --- a/VideoAnalysis/Expand/CoravelExpand.cs +++ b/VideoAnalysis/Expand/CoravelExpand.cs @@ -23,6 +23,8 @@ namespace Learn.VideoAnalysis.Expand #endif service.AddTransient(); service.AddTransient(); + // 注册心跳 Job + service.AddTransient(); } public static void UseCoravelExpand(this IApplicationBuilder provider) { @@ -30,6 +32,8 @@ namespace Learn.VideoAnalysis.Expand { //任务缓存清理 scheduler.Schedule().HourlyAt(10); + //在线心跳 30秒一次 + scheduler.Schedule().EveryThirtySeconds(); //强制清理所有缓存内容 //scheduler.Schedule().Hourly(); //scheduler.Schedule().EverySeconds(40); diff --git a/VideoAnalysis/WebUI/.env.development b/VideoAnalysis/WebUI/.env.development index 9e64136..d05d4de 100644 --- a/VideoAnalysis/WebUI/.env.development +++ b/VideoAnalysis/WebUI/.env.development @@ -8,7 +8,7 @@ VITE_PUBLIC_PATH = / VITE_ROUTER_HISTORY = "hash" # 接口地址 -VITE_API_BASEURL = "http://192.168.2.33:5238" +VITE_API_BASEURL = "http://192.168.2.33:7532" # # 接口地址 diff --git a/VideoAnalysis/WebUI/src/api/videoTask.ts b/VideoAnalysis/WebUI/src/api/videoTask.ts index 293756b..89d3cca 100644 --- a/VideoAnalysis/WebUI/src/api/videoTask.ts +++ b/VideoAnalysis/WebUI/src/api/videoTask.ts @@ -28,11 +28,22 @@ export interface ShowTaskInfoRes { videoKnows: VideoKnowRes[]; mediaUrl: string; } +export interface VideoTaskWorkflow { + id: number; + videoTaskId: number; + workflowName: string; + currentStep: string; + currentStepValue: number; + message?: string; + updateTime: string; +} + export interface RowRloadResult { progress: string; lastEnum: string; startTime: string; errorMessage: string; + workflows: VideoTaskWorkflow[]; // 新增字段 } /** 刷新任务实时数据 */ @@ -42,21 +53,35 @@ export const RowRload = (id: any) => { }); }; -/** 重试任务 */ +/** 重试任务 (VideoSliceWorkflow) */ export const ReStart = (id: any, selectEnum: number) => { return http.request("get", "/api/VideoTask/ReStart", { params: { id, selectEnum } }); }; +/** 重试任务 (TidySlideWorkflow) */ +export const ReStartTidySlide = (id: any, selectEnum: number) => { + return http.request("get", "/api/VideoTask/ReStartTidySlide", { + params: { id, selectEnum } + }); +}; -/** 展示数据 */ + +/** 展示数据 (VideoSliceWorkflow) */ export const ShowTaskInfo = (id: any) => { return http.request("get", "/api/VideoTask/ShowTaskInfo", { params: { id } }); }; +/** 展示数据 (TidySlideWorkflow) */ +export const ShowTidySlideTaskInfo = (id: any) => { + return http.request("get", "/api/VideoTask/ShowTidySlideTaskInfo", { + params: { id } + }); +}; + /** 展示数据 */ @@ -66,6 +91,11 @@ export const RunningTaskList = (data: any) => { }); }; +/** 获取在线设备列表 */ +export const GetOnlineDevices = () => { + return http.request("get", "/api/VideoTask/OnlineDevices"); +}; + /** 展示数据 */ export const ErrorTaskList = (data: any) => { diff --git a/VideoAnalysis/WebUI/src/layout/components/lay-navbar/index.vue b/VideoAnalysis/WebUI/src/layout/components/lay-navbar/index.vue index 787c5b1..4c385c5 100644 --- a/VideoAnalysis/WebUI/src/layout/components/lay-navbar/index.vue +++ b/VideoAnalysis/WebUI/src/layout/components/lay-navbar/index.vue @@ -6,6 +6,7 @@ import LayNavMix from "../lay-sidebar/NavMix.vue"; import LaySidebarFullScreen from "../lay-sidebar/components/SidebarFullScreen.vue"; import LaySidebarBreadCrumb from "../lay-sidebar/components/SidebarBreadCrumb.vue"; import LaySidebarTopCollapse from "../lay-sidebar/components/SidebarTopCollapse.vue"; +import LinkIcon from "~icons/ri/links-fill"; // 引入链接图标 import LogoutCircleRLine from "~icons/ri/logout-circle-r-line"; import Setting from "~icons/ri/settings-3-line"; @@ -21,6 +22,11 @@ const { avatarsStyle, toggleSideBar, } = useNav(); + +function openSwagger() { + const swaggerUrl = `${window.location.protocol}//${window.location.hostname}:7532/swagger/index.html`; + window.open(swaggerUrl, "_blank"); +}