mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
refactor(core): Move push message types to a new shared package (no-changelog) (#10742)
This commit is contained in:
committed by
GitHub
parent
7f1c131b72
commit
2f8c8448d3
@@ -1,17 +1,18 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { mapStores } from 'pinia';
|
||||
import type { WorkerStatus } from '@n8n/api-types';
|
||||
import type { ExecutionStatus } from 'n8n-workflow';
|
||||
|
||||
import PushConnectionTracker from '@/components/PushConnectionTracker.vue';
|
||||
import { useI18n } from '@/composables/useI18n';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import type { IPushDataWorkerStatusPayload } from '@/Interface';
|
||||
import type { ExecutionStatus } from 'n8n-workflow';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useOrchestrationStore } from '@/stores/orchestration.store';
|
||||
import { setPageTitle } from '@/utils/htmlUtils';
|
||||
import WorkerCard from './Workers/WorkerCard.ee.vue';
|
||||
import { usePushConnection } from '@/composables/usePushConnection';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { usePushConnectionStore } from '@/stores/pushConnection.store';
|
||||
import { useRootStore } from '@/stores/root.store';
|
||||
|
||||
@@ -39,8 +40,8 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useRootStore, useUIStore, usePushConnectionStore, useOrchestrationStore),
|
||||
combinedWorkers(): IPushDataWorkerStatusPayload[] {
|
||||
const returnData: IPushDataWorkerStatusPayload[] = [];
|
||||
combinedWorkers(): WorkerStatus[] {
|
||||
const returnData: WorkerStatus[] = [];
|
||||
for (const workerId in this.orchestrationManagerStore.workers) {
|
||||
returnData.push(this.orchestrationManagerStore.workers[workerId]);
|
||||
}
|
||||
@@ -85,14 +86,14 @@ export default defineComponent({
|
||||
averageLoadAvg(loads: number[]) {
|
||||
return (loads.reduce((prev, curr) => prev + curr, 0) / loads.length).toFixed(2);
|
||||
},
|
||||
getStatus(payload: IPushDataWorkerStatusPayload): ExecutionStatus {
|
||||
getStatus(payload: WorkerStatus): ExecutionStatus {
|
||||
if (payload.runningJobsSummary.length > 0) {
|
||||
return 'running';
|
||||
} else {
|
||||
return 'success';
|
||||
}
|
||||
},
|
||||
getRowClass(payload: IPushDataWorkerStatusPayload): string {
|
||||
getRowClass(payload: WorkerStatus): string {
|
||||
return [this.$style.execRow, this.$style[this.getStatus(payload)]].join(' ');
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user