feature(web): 增加队列查询页面

This commit is contained in:
2023-05-07 23:52:24 +08:00
parent 494c8e7412
commit 8c1967bdf0
3 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package com.lanyuanxiaoyao.service.web.controller;
import com.eshore.odcp.hudi.connector.entity.compaction.ScheduleJob;
import com.lanyuanxiaoyao.micro.service.entity.queue.QueueItem;
import com.lanyuanxiaoyao.service.configuration.entity.AmisResponse;
import com.lanyuanxiaoyao.service.forest.service.QueueService;
import java.util.Comparator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 队列接口
*
* @author lanyuanxiaoyao
* @date 2023-05-07
*/
@RestController
@RequestMapping("queue")
public class QueueController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(QueueController.class);
private final QueueService queueService;
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
public QueueController(QueueService queueService) {
this.queueService = queueService;
}
@GetMapping("all")
public AmisResponse all(@RequestParam("name") String name) {
return responseCrudData(queueService.all(name).toSortedList(QueueItem::compareTo));
}
}

View File

@@ -0,0 +1,38 @@
function queueCrud(name) {
return {
type: 'crud',
title: name,
api: `\${base}/queue/all?name=${name}`,
interval: 10000,
syncLocation: false,
silentPolling: true,
headerToolbar: ['reload'],
loadDataOnce: true,
affixHeader: false,
perPage: 100,
columns: [
{name: 'id', label: 'ID'},
{
name: 'priority',
label: '优先级',
align: 'center',
},
{
name: 'createTime',
label: '启动时间',
...time('createTime'),
align: 'center',
width: 140,
},
]
}
}
function queueTab() {
return {
title: '压缩队列',
tab: [
queueCrud('compaction-queue')
],
}
}

View File

@@ -38,6 +38,7 @@
<script src="components/table-tab.js"></script>
<script src="components/yarn-tab.js"></script>
<script src="components/cloud-tab.js"></script>
<script src="components/queue-tab.js"></script>
<script type="text/javascript">
(function () {
let amis = amisRequire('amis/embed')
@@ -51,6 +52,7 @@
unmountOnExit: true,
tabsMode: 'strong',
tabs: [
queueTab(),
tableTab(),
yarnTab('b5-sync', '同步 b5', undefined, 'Sync'),
yarnTab('b1', '压缩 b1', 'datalake,tyly', 'Compaction'),