Skip to content

Commit ed95275

Browse files
authored
Merge branch 'develop' into TAP-11431
2 parents 4e3f44c + b2b31f6 commit ed95275

24 files changed

Lines changed: 871 additions & 561 deletions

File tree

apps/daas/src/i18n/langs/en.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ export default {
472472
connection_reload_schema_confirm_msg:
473473
'If there are too many schemas in this library, it may take a long time. Make sure to refresh the schema of the data source',
474474
connection_reload_schema_fail: 'Schema load failed',
475-
apiaudit_time_line:"Time Line",
476-
apiaudit_req_start_point: "Request start",
477-
apiaudit_req_end_point: "Request to end",
478-
apiaudit_db_start_point: "Database response starts",
479-
apiaudit_db_end_point: "Database response completed",
475+
apiaudit_time_line: 'Time Line',
476+
apiaudit_req_start_point: 'Request start',
477+
apiaudit_req_end_point: 'Request to end',
478+
apiaudit_db_start_point: 'Database response starts',
479+
apiaudit_db_end_point: 'Database response completed',
480480
//Dag
481481
//Task edit缓存节点提示
482482
task_list_status_all: 'All status',

apps/daas/src/i18n/langs/zh-CN.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,11 @@ export default {
449449
apiaudit_success: '成功',
450450
apiaudit_placeholder: '请输入名称/ID',
451451
apiaudit_client_name_placeholder: '请输入客户端名称',
452-
apiaudit_time_line:"时间线",
453-
apiaudit_req_start_point: "请求开始",
454-
apiaudit_req_end_point: "请求结束",
455-
apiaudit_db_start_point: "数据库响应开始",
456-
apiaudit_db_end_point: "数据库响应结束",
452+
apiaudit_time_line: '时间线',
453+
apiaudit_req_start_point: '请求开始',
454+
apiaudit_req_end_point: '请求结束',
455+
apiaudit_db_start_point: '数据库响应开始',
456+
apiaudit_db_end_point: '数据库响应结束',
457457

458458
// 连接
459459
connection_list_form_database_type: '数据库类型',

apps/daas/src/views/cluster/Cluster.vue

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
import { getConnectors, getSupervisor } from '@tap/api/src/core/proxy'
2323
import {
2424
fetchWorkers,
25+
getProcessInfo,
2526
queryAllBindWorker,
2627
unbindByProcessId,
2728
} from '@tap/api/src/core/workers'
@@ -80,10 +81,6 @@ interface SearchParams {
8081
keyword: string
8182
}
8283
83-
interface ApiResponse<T> {
84-
items: T[]
85-
}
86-
8784
interface ClusterData {
8885
uuid: string
8986
id?: string
@@ -144,33 +141,21 @@ const childRules = ref()
144141
const tree = ref()
145142
const engineTable = ref()
146143
const tagForm = ref()
147-
const editAgentForm = ref()
148144
149145
// State
150146
const hideDownload = ref(import.meta.env.VUE_APP_HIDE_CLUSTER_DOWNLOAD)
151147
const waterfallData = ref([])
152148
const currentData = ref<ClusterData | null>(null)
153149
const dialogForm = ref(false)
154-
const activeIndex = ref('1')
155-
const serveStatus = ref('')
156-
const isStop = ref(false)
157-
const engineState = ref('')
158-
const managementState = ref('')
159-
const apiServerState = ref('')
160150
const editItem = ref({})
161151
const timer = ref(null)
162-
const downLoadAgetntdialog = ref(false)
163152
const editAgentDialog = ref(false)
164-
const deleteDialogVisible = ref(false)
165-
const downLoadNum = ref(0)
166153
const version = ref(null)
167154
const ips = ref([])
168155
const custIP = ref('')
169156
const custId = ref('')
170157
const agentName = ref('')
171158
const currentNde = ref({})
172-
const delData = ref('')
173-
const processIdData = ref([])
174159
const searchParams = ref<SearchParams>({
175160
keyword: '',
176161
})
@@ -562,6 +547,25 @@ const getDataApi = async (noFilter?: boolean) => {
562547
}, 0)
563548
}
564549
}
550+
// Fetch running task counts
551+
if (processId.length > 0) {
552+
try {
553+
const processData = await getProcessInfo(processId)
554+
if (processData) {
555+
for (const item of clusterData) {
556+
const pid = item.systemInfo?.process_id
557+
if (pid && (processData as any)[pid]) {
558+
;(item as any).runningTaskNum = (processData as any)[
559+
pid
560+
].runningTaskNum
561+
}
562+
}
563+
}
564+
} catch {
565+
/* ignore */
566+
}
567+
}
568+
565569
waterfallData.value = clusterData
566570
567571
apiServerData.value = _apiServerData
@@ -626,6 +630,16 @@ const getStatus = (type: string) => {
626630
return STATUS_MAP[type] || '-'
627631
}
628632
633+
const navigateToTaskList = (item: any, syncType: 'migrate' | 'sync') => {
634+
const processId = item.systemInfo?.process_id
635+
if (!processId) return
636+
const routeName = syncType === 'migrate' ? 'migrateList' : 'dataflowList'
637+
router.push({
638+
name: routeName,
639+
query: { agentId: processId, status: 'running' },
640+
})
641+
}
642+
629643
const openNetStatDialog = (row: any) => {
630644
netStatDialog.visible = true
631645
netStatDialog.data = row.engine.netStat || []
@@ -1389,7 +1403,7 @@ const onUpdateLicenseSuccess = () => {
13891403
<div class="flex-1 border rounded-xl p-4">
13901404
<div class="flex align-center justify-content-between mb-3">
13911405
<span class="section-title font-color-dark fs-6 fw-sub"
1392-
>API server</span
1406+
>API Server</span
13931407
>
13941408
</div>
13951409
<ElTable :data="apiServerData">
@@ -1488,12 +1502,38 @@ const onUpdateLicenseSuccess = () => {
14881502
<h2 class="name fs-6">
14891503
{{ item.agentName || item.systemInfo.hostname }}
14901504
</h2>
1491-
<div class="uuid fs-8 my-1">
1505+
<div class="uuid fs-8 my-2">
14921506
{{ item.systemInfo.uuid }}
14931507
</div>
1494-
<span class="ip">{{
1495-
item.custIP ? item.custIP : item.systemInfo.ip
1496-
}}</span>
1508+
<div class="flex gap-2">
1509+
<span class="ip">{{
1510+
item.custIP ? item.custIP : item.systemInfo.ip
1511+
}}</span>
1512+
<el-tag
1513+
v-if="item.runningTaskNum?.migrate > 0"
1514+
type="primary"
1515+
size="small"
1516+
class="cursor-pointer"
1517+
@click.stop="navigateToTaskList(item, 'migrate')"
1518+
>
1519+
{{ $t('public_task_type_migrate')
1520+
}}<span class="ml-1 fw-bold">{{
1521+
item.runningTaskNum?.migrate || 0
1522+
}}</span>
1523+
</el-tag>
1524+
<el-tag
1525+
v-if="item.runningTaskNum?.sync > 0"
1526+
type="primary"
1527+
size="small"
1528+
class="cursor-pointer"
1529+
@click.stop="navigateToTaskList(item, 'sync')"
1530+
>
1531+
{{ $t('public_task_type_sync')
1532+
}}<span class="ml-1 fw-bold">{{
1533+
item.runningTaskNum?.sync || 0
1534+
}}</span>
1535+
</el-tag>
1536+
</div>
14971537
</div>
14981538
</div>
14991539
<div
@@ -1749,7 +1789,7 @@ const onUpdateLicenseSuccess = () => {
17491789
</el-row>
17501790
<el-row :gutter="16" class="data-list">
17511791
<el-col :span="6">
1752-
<span class="txt fw-normal">API server</span>
1792+
<span class="txt fw-normal">API Server</span>
17531793
</el-col>
17541794
<el-col :span="4">
17551795
<span
@@ -1763,7 +1803,7 @@ const onUpdateLicenseSuccess = () => {
17631803
`status-${item.apiServer.serviceStatus}`,
17641804
'status',
17651805
]"
1766-
>{{ getStatus(item.apiServer.status) }}</span
1806+
>{{ getStatus(item.apiServer.serviceStatus) }}</span
17671807
>
17681808
</el-col>
17691809
<el-col :span="10">
@@ -2133,7 +2173,6 @@ const onUpdateLicenseSuccess = () => {
21332173
@close="editAgentDialog = false"
21342174
>
21352175
<el-form
2136-
ref="editAgentForm"
21372176
label-width="100px"
21382177
class="edit-agent-form"
21392178
label-position="top"
@@ -2174,11 +2213,9 @@ const onUpdateLicenseSuccess = () => {
21742213
<ElButton @click="editAgentDialog = false">{{
21752214
$t('public_button_cancel')
21762215
}}</ElButton>
2177-
<ElButton
2178-
type="primary"
2179-
@click="submitEditAgent('editAgentForm')"
2180-
>{{ $t('public_button_confirm') }}</ElButton
2181-
>
2216+
<ElButton type="primary" @click="submitEditAgent">{{
2217+
$t('public_button_confirm')
2218+
}}</ElButton>
21822219
</div>
21832220
</template>
21842221
</el-dialog>

0 commit comments

Comments
 (0)