fix: Init task logs (#553)
diff --git a/src/views/components/profile/task-list.vue b/src/views/components/profile/task-list.vue
index 5b9b446..82abbd6 100644
--- a/src/views/components/profile/task-list.vue
+++ b/src/views/components/profile/task-list.vue
@@ -31,7 +31,7 @@
>
<div class="ell mb-5">
<span class="b">{{ i.endpointName }}</span>
- <a class="profile-btn r" @click="viewTask(i)" v-tooltip:bottom="{ content: $t('taskView') }">
+ <a class="profile-btn r" @click="viewTask($event, i)" v-tooltip:bottom="{ content: $t('taskView') }">
<rk-icon icon="library_books" />
</a>
</div>
@@ -145,6 +145,15 @@
private selectTask(item: { id: string; serviceId: string; logs: TaskLog[] }) {
this.selectedTask = item;
+ this.selectedTaskService =
+ this.headerSource.serviceSource.filter((service: any) => service.key === item.serviceId)[0] || {};
+ this.GET_SEGMENT_LIST({ taskID: item.id });
+ }
+
+ private viewTask(e: Event, item: any) {
+ this.viewDetail = true;
+ window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
+ this.instanceLogs = {};
for (const d of item.logs) {
if (this.instanceLogs[d.instanceName]) {
this.instanceLogs[d.instanceName].push({ operationType: d.operationType, operationTime: d.operationTime });
@@ -152,13 +161,6 @@
this.instanceLogs[d.instanceName] = [{ operationType: d.operationType, operationTime: d.operationTime }];
}
}
- this.selectedTaskService =
- this.headerSource.serviceSource.filter((service: any) => service.key === item.serviceId)[0] || {};
- this.GET_SEGMENT_LIST({ taskID: item.id });
- }
-
- private viewTask(item: any) {
- this.viewDetail = true;
this.selectedTask = item;
}
diff --git a/src/views/containers/profile.vue b/src/views/containers/profile.vue
index 51d27d6..f33a9f0 100644
--- a/src/views/containers/profile.vue
+++ b/src/views/containers/profile.vue
@@ -57,9 +57,6 @@
private interval: any;
private beforeMount() {
- this.GET_SERVICES({
- duration: this.durationTime,
- });
this.SET_EVENTS([
() => {
this.GET_SERVICES({ duration: this.durationTime });
@@ -69,7 +66,7 @@
this.GET_SERVICES({
duration: this.durationTime,
});
- }, 300000);
+ }, 20000);
}
private beforeDestroy() {
this.SET_EVENTS([]);