diff --git a/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEvent.java b/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEvent.java index fe33080..5ae45f0 100644 --- a/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEvent.java +++ b/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEvent.java @@ -31,6 +31,7 @@ public class BarrageEvent { private String date; private String fileName; + private String suffix=".flv"; private List barrages; private boolean isSort = false; diff --git a/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEventCenter.java b/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEventCenter.java index c1f712f..0a86dbb 100644 --- a/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEventCenter.java +++ b/chopperbot-barrage/src/main/java/org/example/core/bgevnet/BarrageEventCenter.java @@ -11,6 +11,7 @@ import org.example.core.bgevnet.bgscore.BarragePoint; import org.example.core.bgevnet.bgscore.BarrageScoreCurvePlugin; import org.example.core.section.SectionRequest; import org.example.core.section.VideoSectionWorkShop; +import org.example.init.InitPluginRegister; import org.example.plugin.PluginCheckAndDo; import org.example.plugin.SpringBootPlugin; import org.example.bean.Barrage; @@ -83,6 +84,7 @@ public class BarrageEventCenter extends SpringBootPlugin { return ((BarragePopularRangePlugin) plugin).findRange(points); }, PluginName.BARRAGE_POPULAR_RANGE_PLUGIN, List.class ); + if(popularRanges!=null){ PluginCheckAndDo.CheckAndDo(plugin -> { for (PopularRange popularRange : popularRanges) { @@ -100,5 +102,6 @@ public class BarrageEventCenter extends SpringBootPlugin { } //TODO 弹幕标签插件 } + } } diff --git a/chopperbot-barrage/src/main/java/org/example/util/BarrageUtil.java b/chopperbot-barrage/src/main/java/org/example/util/BarrageUtil.java index fe88d19..6e89443 100644 --- a/chopperbot-barrage/src/main/java/org/example/util/BarrageUtil.java +++ b/chopperbot-barrage/src/main/java/org/example/util/BarrageUtil.java @@ -19,7 +19,7 @@ public class BarrageUtil { List list = ((JSONArray) barrages).toJavaList(Barrage.class); list = list.stream().sorted(Comparator.comparing(Barrage::getTimeReal)).collect(Collectors.toList()); if(list.isEmpty()){ - return false; + JsonFileUtil.writeJsonFile(outputFilePath,Map.of("data",list,"updateTime",TimeUtil.getNowTime_YMDHMS())); }else{ long startTime = list.get(0).getTimeReal() + start; long endTime = list.get(0).getTimeReal() + end; diff --git a/chopperbot-common/src/main/java/org/example/thread/oddjob/OddJobBoy.java b/chopperbot-common/src/main/java/org/example/thread/oddjob/OddJobBoy.java index ab628f0..ad876ef 100644 --- a/chopperbot-common/src/main/java/org/example/thread/oddjob/OddJobBoy.java +++ b/chopperbot-common/src/main/java/org/example/thread/oddjob/OddJobBoy.java @@ -15,14 +15,15 @@ import java.util.concurrent.*; /** * ChopperBot系统中专门用来处理异步事件的类 */ -public class OddJobBoy implements ChopperBotGuardianTask { +public class OddJobBoy { private static volatile OddJobBoy Instance; - private BlockingQueue oddjobs; + + private ExecutorService pool; private OddJobBoy(){ - oddjobs = new ArrayBlockingQueue<>(1024); + pool = Executors.newCachedThreadPool(new NamedThreadFactory("oddjob")); } public static OddJobBoy Boy(){ @@ -37,20 +38,6 @@ public class OddJobBoy implements ChopperBotGuardianTask { } public void addWork(OddJob job) throws InterruptedException { - oddjobs.put(job); - } - - - @Override - public void threadTask() { - while(true){ - try { - OddJob job = oddjobs.take(); - ChopperLogFactory.getLogger(LoggerType.System).info(" boy get a odd job:{},Processing...",job); - job.doJob(); - }catch (InterruptedException e){ - - } - } + pool.submit(job::doJob); } } diff --git a/chopperbot-console/src/main/java/org/example/controller/HotController.java b/chopperbot-console/src/main/java/org/example/controller/HotController.java index af872d6..f2c13a6 100644 --- a/chopperbot-console/src/main/java/org/example/controller/HotController.java +++ b/chopperbot-console/src/main/java/org/example/controller/HotController.java @@ -81,7 +81,7 @@ public class HotController { @CheckPlugin(needPlugin = {PluginName.HOT_GUARD_PLUGIN}) @GetMapping("/hotGuard/guard") public Result hotGuards(){ - List guards = hotModuleService.hotModuleGuardApi().getGuards(); + List guards = hotModuleService.hotModuleGuardApi().getGuards(); return Result.success( Map.of("list",guards) ); @@ -126,10 +126,15 @@ public class HotController { @CheckPlugin(needPlugin = {PluginName.HOT_RECOMMENDATION_PLUGIN}) @PostMapping("/hotRecommendation/add") public Result addFollowDogs(@RequestBody FollowDog dog){ + dog.setId(null); boolean success = hotModuleService.heatRecommendApi().addFollowDog(dog); - return Result.success( - Map.of("success",success) - ); + if(success){ + return Result.success( + Map.of("add",dog) + ); + }else{ + return Result.error("403","添加失败"); + } } @CheckPlugin(needPlugin = {PluginName.HOT_RECOMMENDATION_PLUGIN}) diff --git a/chopperbot-console/src/main/java/org/example/init/WorldInitMachine.java b/chopperbot-console/src/main/java/org/example/init/WorldInitMachine.java index 1dd020c..a56333b 100644 --- a/chopperbot-console/src/main/java/org/example/init/WorldInitMachine.java +++ b/chopperbot-console/src/main/java/org/example/init/WorldInitMachine.java @@ -27,7 +27,6 @@ public class WorldInitMachine extends ModuleInitMachine{ @Override public boolean init() { ChopperBotGuardPool.init(); - OddJobBoy.Boy().guardian(); try { initMachines = PluginUtil.getAllModuleInit(); return initLogger(()->{ diff --git a/chopperbot-hot/src/main/java/org/example/api/HeatRecommendApi.java b/chopperbot-hot/src/main/java/org/example/api/HeatRecommendApi.java index 7992d56..479ee4b 100644 --- a/chopperbot-hot/src/main/java/org/example/api/HeatRecommendApi.java +++ b/chopperbot-hot/src/main/java/org/example/api/HeatRecommendApi.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; +import java.util.UUID; /** * @author Genius @@ -22,6 +23,7 @@ public class HeatRecommendApi { HeatRecommendation heatRecommendation; public boolean addFollowDog(FollowDog dog){ + dog.setDogId(UUID.randomUUID().toString()); if (followDogService.addFollowDog(dog)) { return heatRecommendation.addFollowDog(dog); } diff --git a/chopperbot-hot/src/main/java/org/example/api/HotModuleGuardApi.java b/chopperbot-hot/src/main/java/org/example/api/HotModuleGuardApi.java index 6bab1eb..58e00f3 100644 --- a/chopperbot-hot/src/main/java/org/example/api/HotModuleGuardApi.java +++ b/chopperbot-hot/src/main/java/org/example/api/HotModuleGuardApi.java @@ -1,13 +1,16 @@ package org.example.api; +import org.example.bean.GuardVO; import org.example.bean.HotModuleSetting; import org.example.core.guard.Guard; import org.example.core.guard.HotModuleGuard; import org.example.service.HotModuleSettingService; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; /** * @author Genius @@ -33,7 +36,11 @@ public class HotModuleGuardApi { return false; } - public List getGuards(){ - return hotModuleGuard.getGuards(); + public List getGuards(){ + return hotModuleGuard.getGuards().stream().map(guard->{ + GuardVO guardVO = new GuardVO(); + BeanUtils.copyProperties(guard,guardVO); + return guardVO; + }).collect(Collectors.toList()); } } diff --git a/chopperbot-hot/src/main/java/org/example/bean/GuardVO.java b/chopperbot-hot/src/main/java/org/example/bean/GuardVO.java new file mode 100644 index 0000000..98c9185 --- /dev/null +++ b/chopperbot-hot/src/main/java/org/example/bean/GuardVO.java @@ -0,0 +1,21 @@ +package org.example.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @author Genius + * @date 2023/10/09 16:03 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GuardVO { + private String guardName; + private long delayTime; + private int failRetryTimes; + private LocalDateTime preGuardTime; +} diff --git a/chopperbot-hot/src/main/java/org/example/core/guard/Guard.java b/chopperbot-hot/src/main/java/org/example/core/guard/Guard.java index 2c7bbd6..07f8d0c 100644 --- a/chopperbot-hot/src/main/java/org/example/core/guard/Guard.java +++ b/chopperbot-hot/src/main/java/org/example/core/guard/Guard.java @@ -13,6 +13,7 @@ import org.example.log.ResultLogger; import org.example.plugin.PluginCheckAndDo; import org.slf4j.Logger; +import java.time.LocalDateTime; import java.util.List; /** @@ -34,11 +35,14 @@ public class Guard implements Runnable, ResultLogge private long delayTime; private int failRetryTimes; + + private LocalDateTime preGuardTime; @Override public void run() { int retryTimes = 0; Object data = task.start(); + preGuardTime = LocalDateTime.now(); if(task.isFinish() == HotModuleLoadTask.FinishFlag.FINISH){ successLog(); }else{ diff --git a/chopperbot-hot/src/main/java/org/example/core/guard/HotModuleGuard.java b/chopperbot-hot/src/main/java/org/example/core/guard/HotModuleGuard.java index 098df76..22de2d5 100644 --- a/chopperbot-hot/src/main/java/org/example/core/guard/HotModuleGuard.java +++ b/chopperbot-hot/src/main/java/org/example/core/guard/HotModuleGuard.java @@ -85,7 +85,7 @@ public class HotModuleGuard extends SpringBootPlugin { if(loadTask!=null){ addGuard(new Guard(this.logger,groupName,loadTask, hotModuleSetting.getUpdateHotModuleTimes(), - hotModuleSetting.getFailRetryTimes())); + hotModuleSetting.getFailRetryTimes(),null)); }else{ this.error(String.format("Unable to listen %s hot module,cause: invalid loadTask!", groupName)); return false; @@ -99,7 +99,7 @@ public class HotModuleGuard extends SpringBootPlugin { if(loadTask!=null){ addGuard(new Guard(this.logger,groupName,loadTask, hotModuleSetting.getUpdateHotLivesTimes(), - hotModuleSetting.getFailRetryTimes())); + hotModuleSetting.getFailRetryTimes(),null)); }else{ this.error(String.format("Unable to listen %s hot live,cause: invalid loadTask!", groupName)); return false; diff --git a/chopperbot-hot/src/main/java/org/example/core/recommend/HeatRecommendation.java b/chopperbot-hot/src/main/java/org/example/core/recommend/HeatRecommendation.java index 71b491d..90ae388 100644 --- a/chopperbot-hot/src/main/java/org/example/core/recommend/HeatRecommendation.java +++ b/chopperbot-hot/src/main/java/org/example/core/recommend/HeatRecommendation.java @@ -28,6 +28,7 @@ import org.example.plugin.SpringBootPlugin; import org.example.service.FollowDogService; import org.example.service.HotModuleSettingService; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.util.*; @@ -146,25 +147,26 @@ public class HeatRecommendation extends SpringBootPlugin { followDogs.add(dog); return true; } - return false; + return true; } public boolean removeFollowDog(String platform,String dogId){ List followDogs = platformFollowDogMap.get(platform); if(followDogs!=null){ - return followDogs.removeIf(dog -> { + followDogs.removeIf(dog -> { return dog.getDogId().equals(dogId); }); } - return false; + return true; } public boolean updateFollowDog(FollowDog dog){ List followDogs = platformFollowDogMap.get(dog.getPlatform()); if(followDogs!=null){ - return followDogs.removeIf(dog1 -> {return dog1.getDogId().equals(dog.getDogId());})&&followDogs.add(dog); + followDogs.removeIf(dog1 -> {return dog1.getDogId().equals(dog.getDogId());}); + followDogs.add(dog); } - return false; + return true; } public boolean openPlatformFollowDog(String platform,boolean isOpen){ @@ -222,12 +224,12 @@ public class HeatRecommendation extends SpringBootPlugin { } private List getBanList(String banLiver){ - if(banLiver==null){ - return new ArrayList<>(); - }else{ + if(StringUtils.hasText(banLiver)){ String s = banLiver.substring(1, banLiver.length() - 1); String[] ss = s.split(","); return List.of(ss); + }else{ + return new ArrayList<>(); } } } diff --git a/chopperbot-hot/src/main/java/org/example/service/impl/FollowDogServiceImpl.java b/chopperbot-hot/src/main/java/org/example/service/impl/FollowDogServiceImpl.java index c1633ec..7e8cbf2 100644 --- a/chopperbot-hot/src/main/java/org/example/service/impl/FollowDogServiceImpl.java +++ b/chopperbot-hot/src/main/java/org/example/service/impl/FollowDogServiceImpl.java @@ -36,7 +36,7 @@ public class FollowDogServiceImpl extends ServiceImpl{ + BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream())); + try { + while ((in.readLine()) != null) {} + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + }); + + OddJobBoy.Boy().addWork(()->{ + BufferedReader err = new BufferedReader(new InputStreamReader(process.getErrorStream())); + try { + while ((err.readLine()) != null) {} + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + err.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + }); + + int exitCode = process.waitFor(); if (exitCode == 0) { System.out.printf("in:%s 视频分割完成。 out:%s\n",inputFilePath, outputFilePath); return true; diff --git a/chopperbot-test/src/test/java/org/example/barrage/BarragePoupularRangeTest.java b/chopperbot-test/src/test/java/org/example/barrage/BarragePoupularRangeTest.java new file mode 100644 index 0000000..1dbde10 --- /dev/null +++ b/chopperbot-test/src/test/java/org/example/barrage/BarragePoupularRangeTest.java @@ -0,0 +1,35 @@ +package org.example.barrage; + +import org.example.ConsoleApplication; +import org.example.constpool.PluginName; +import org.example.core.bgevnet.BarrageEvent; +import org.example.core.bgevnet.bghot.BarragePopularRangePlugin; +import org.example.core.bgevnet.bghot.PopularRange; +import org.example.core.bgevnet.bgscore.BarragePoint; +import org.example.core.bgevnet.bgscore.BarrageScoreCurvePlugin; +import org.example.init.InitPluginRegister; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +/** + * @author Genius + * @date 2023/10/09 00:27 + **/ + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ConsoleApplication.class,webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +public class BarragePoupularRangeTest { + + @Test + public void Test(){ + BarrageEvent event = new BarrageEvent("douyu","online",null,null,"即将拥有人鱼线的PDD_2023-09-14 14_37_54.json"); + List points = InitPluginRegister.getPlugin(PluginName.BARRAGE_SCORE_CURVE_PLUGIN, BarrageScoreCurvePlugin.class).generateCurve(event); + List ranges = InitPluginRegister.getPlugin(PluginName.BARRAGE_POPULAR_RANGE_PLUGIN, BarragePopularRangePlugin.class).findRange(points); + System.out.println(ranges); + + } +} diff --git a/config/chopperBotConfig.json b/config/chopperBotConfig.json index 1205644..7854fa7 100644 --- a/config/chopperBotConfig.json +++ b/config/chopperBotConfig.json @@ -24,12 +24,12 @@ "HotRecommendation":true, "BarrageScoreCurve":true, "FileCacheManager":true, - "LiverFollower":true, + "LiverFollower":false, "TaskMonitor":true, "HotConfig":true, "TaskCenter":true, "CreeperConfig":true } }, - "updateTime":"2023-10-07 23:05:43" + "updateTime":"2023-10-09 22:41:45" } \ No newline at end of file diff --git a/console-ui/src/api/hot/heatRecommendApi.ts b/console-ui/src/api/hot/heatRecommendApi.ts index 879cf9a..90f27c5 100644 --- a/console-ui/src/api/hot/heatRecommendApi.ts +++ b/console-ui/src/api/hot/heatRecommendApi.ts @@ -1,4 +1,5 @@ import request from '@/utils/request'; +import {FollowDog} from "@/views/app/hot/heat_recommend/FollowDogTypes"; export function openFollowDog(platform:string,isOpen:boolean) { return request({ @@ -10,3 +11,29 @@ export function openFollowDog(platform:string,isOpen:boolean) { } }); } + +export function getFollowDogs(){ + return request({ + url: '/hot/hotRecommendation/list', + method: 'get', + }); +} + +export function addFollowDog(dog:FollowDog){ + return request.post("/hot/hotRecommendation/add",dog) +} + +export function updateFollowDog(dog:FollowDog){ + return request.post("/hot/hotRecommendation/update",dog) +} + +export function deleteFollowDog(dogId:string,platform:string){ + return request({ + url: '/hot/hotRecommendation/delete', + method: 'get', + params: { + dogId, + platform + } + }); +} diff --git a/console-ui/src/api/hot/hotGuardApi.ts b/console-ui/src/api/hot/hotGuardApi.ts index 0ba1869..cab9fe9 100644 --- a/console-ui/src/api/hot/hotGuardApi.ts +++ b/console-ui/src/api/hot/hotGuardApi.ts @@ -14,7 +14,7 @@ export function updateHotGuardSetting(setting:Setting) { return request.post('/hot/hotGuard/update',setting) } -export function guards() { +export function getGuards() { return request({ url: '/hot/hotGuard/guard', method: 'get', diff --git a/console-ui/src/configs/menus/apps.menu.ts b/console-ui/src/configs/menus/apps.menu.ts index abc1ef9..67f7dc7 100644 --- a/console-ui/src/configs/menus/apps.menu.ts +++ b/console-ui/src/configs/menus/apps.menu.ts @@ -27,7 +27,7 @@ export default [ icon:"mdi mdi-bird", key:"menu.heat_recommend", text:"Heat Recommend", - link: "/apps/heat_recommend" + link: "/apps/heatRecommend" }, { icon:"mdi mdi-star-face", diff --git a/console-ui/src/router/apps.routes.ts b/console-ui/src/router/apps.routes.ts index e035bb9..bb3600f 100644 --- a/console-ui/src/router/apps.routes.ts +++ b/console-ui/src/router/apps.routes.ts @@ -3,6 +3,7 @@ import todoRoutes from "@/views/app/todo/todoRoutes"; import emailRoutes from "@/views/app/email/emailRoutes"; import chatRoutes from "@/views/app/chat/chatRoutes"; import taskRoutes from "@/views/app/taskcenter/taskRoutes"; +import hotGuardRoutes from "@/views/app/hot/hot_guard/hotGuardRoutes"; export default [ { @@ -69,6 +70,7 @@ export default [ import( /* webpackChunkName: "utility-board" */ "@/views/app/hot/hot_guard/HotGuardView.vue" ), + children: [...hotGuardRoutes], meta: { requiresAuth: true, title: "Hot Guard", @@ -76,6 +78,20 @@ export default [ category: "APP", }, }, + { + path: "/apps/heatRecommend", + name: "app-heat-recommend", + component: () => + import( + /* webpackChunkName: "utility-board" */ "@/views/app/hot/heat_recommend/HeatRecommendationView.vue" + ), + meta: { + requiresAuth: true, + title: "Heat Recommend", + layout: "ui", + category: "APP", + }, + }, { path: "/apps/email", meta: { diff --git a/console-ui/src/utils/timeUtils.ts b/console-ui/src/utils/timeUtils.ts index 88da649..b8dbab8 100644 --- a/console-ui/src/utils/timeUtils.ts +++ b/console-ui/src/utils/timeUtils.ts @@ -6,3 +6,18 @@ export const nanosToHMS_CN = (milliseconds: number) => { return `${hours}小时${minutes}分钟${seconds}秒`; } + + +export function isoStrToNormal(isoString: string): string { + const date = new Date(isoString); + + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + const seconds = date.getSeconds().toString().padStart(2, '0'); + const milliseconds = date.getMilliseconds().toString().padStart(3, '0'); + + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`; +} diff --git a/console-ui/src/views/app/hot/heat_recommend/FollowDogTypes.ts b/console-ui/src/views/app/hot/heat_recommend/FollowDogTypes.ts new file mode 100644 index 0000000..63e9334 --- /dev/null +++ b/console-ui/src/views/app/hot/heat_recommend/FollowDogTypes.ts @@ -0,0 +1,8 @@ +export interface FollowDog{ + id:number; + dogId:string; + platform:string; + moduleName:string; + top:number; + banLiver:string; +} diff --git a/console-ui/src/views/app/hot/heat_recommend/HeatRecommendationView.vue b/console-ui/src/views/app/hot/heat_recommend/HeatRecommendationView.vue new file mode 100644 index 0000000..45f89ce --- /dev/null +++ b/console-ui/src/views/app/hot/heat_recommend/HeatRecommendationView.vue @@ -0,0 +1,385 @@ + + + + diff --git a/console-ui/src/views/app/hot/heat_recommend/compoments/FollowDogCard.vue b/console-ui/src/views/app/hot/heat_recommend/compoments/FollowDogCard.vue new file mode 100644 index 0000000..6fe9eaf --- /dev/null +++ b/console-ui/src/views/app/hot/heat_recommend/compoments/FollowDogCard.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/console-ui/src/views/app/hot/heat_recommend/heatRecommendationRoutes.ts b/console-ui/src/views/app/hot/heat_recommend/heatRecommendationRoutes.ts new file mode 100644 index 0000000..e69de29 diff --git a/console-ui/src/views/app/hot/heat_recommend/heatRecommendationStore.ts b/console-ui/src/views/app/hot/heat_recommend/heatRecommendationStore.ts new file mode 100644 index 0000000..0940bb1 --- /dev/null +++ b/console-ui/src/views/app/hot/heat_recommend/heatRecommendationStore.ts @@ -0,0 +1,32 @@ +import { defineStore } from "pinia"; +import {useSnackbarStore} from "@/stores/snackbarStore"; +import {FollowDog} from "@/views/app/hot/heat_recommend/FollowDogTypes"; + + +export const useHotRecommendStore = defineStore({ + id: "hotRecommend", + state:()=>({ + followDogs: ref([]), + platforms: ['douyu','huya','bilibili','douyin','tiktok','twitch'], + + }), + + getters:{ + getFollowDogs(){ + return this.followDogs + } + }, + + actions:{ + deleteFollowDog(dog:FollowDog){ + this.followDogs = this.followDogs.filter(oldDog=>oldDog.dogId!==dog.dogId) + }, + addFollowDog(dog:FollowDog){ + this.followDogs.push(dog) + }, + updateFollowDog(dog:FollowDog){ + let old = this.followDogs.find(oldDog=>dog.dogId===oldDog.dogId) + this.followDogs.splice(this.followDogs.indexOf(old), 1, dog); + } + } +}) diff --git a/console-ui/src/views/app/hot/hot_guard/HotGuardView.vue b/console-ui/src/views/app/hot/hot_guard/HotGuardView.vue index 914ab56..8d5fe7a 100644 --- a/console-ui/src/views/app/hot/hot_guard/HotGuardView.vue +++ b/console-ui/src/views/app/hot/hot_guard/HotGuardView.vue @@ -1,92 +1,26 @@ diff --git a/console-ui/src/views/app/hot/hot_guard/hotGuardRoutes.ts b/console-ui/src/views/app/hot/hot_guard/hotGuardRoutes.ts new file mode 100644 index 0000000..47cf5ff --- /dev/null +++ b/console-ui/src/views/app/hot/hot_guard/hotGuardRoutes.ts @@ -0,0 +1,22 @@ +export default [ + { + path: "", + redirect: "/apps/hotGuard/settings", + }, + { + path: "settings", + name: "hot-guard-settings", + component: () => + import( + /* webpackChunkName: "apps-todo-tasks" */ "@/views/app/hot/hot_guard/pages/HotSettingsPage.vue" + ), + }, + { + path: "guards", + name: "hot-guard-guards", + component: () => + import( + /* webpackChunkName: "apps-todo-completed" */ "@/views/app/hot/hot_guard/pages/HotGuardsPage.vue" + ), + }, +]; diff --git a/console-ui/src/views/app/hot/hot_guard/hotGuardStore.ts b/console-ui/src/views/app/hot/hot_guard/hotGuardStore.ts index acd2f49..f0696e3 100644 --- a/console-ui/src/views/app/hot/hot_guard/hotGuardStore.ts +++ b/console-ui/src/views/app/hot/hot_guard/hotGuardStore.ts @@ -9,7 +9,12 @@ export const useHotGuardStore = defineStore({ id: "hotGuard", state:()=>({ settings: ref([]), - guards:[] + guards:[], + fieldLabelList: ref([ + "设置", + "监控守卫" + ]), + }), getters:{ diff --git a/console-ui/src/views/app/hot/hot_guard/pages/HotGuardsPage.vue b/console-ui/src/views/app/hot/hot_guard/pages/HotGuardsPage.vue new file mode 100644 index 0000000..88150f1 --- /dev/null +++ b/console-ui/src/views/app/hot/hot_guard/pages/HotGuardsPage.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/console-ui/src/views/app/hot/hot_guard/pages/HotSettingsPage.vue b/console-ui/src/views/app/hot/hot_guard/pages/HotSettingsPage.vue new file mode 100644 index 0000000..bb1f89a --- /dev/null +++ b/console-ui/src/views/app/hot/hot_guard/pages/HotSettingsPage.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/database.db b/database.db index 3458bf3..7b983c5 100644 Binary files a/database.db and b/database.db differ