From 4ff52343af1818a6dcc5a555edc0ced139c28059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Palancher?= Date: Fri, 8 Nov 2024 10:52:57 +0100 Subject: [PATCH 1/3] refactor(front): iterate over array of job fields Iterate over a computed array of job fields in job view, with tiny subcomponents to represent the values. --- .../src/components/job/JobFieldComment.vue | 29 +++ .../src/components/job/JobFieldExitCode.vue | 25 +++ frontend/src/components/job/JobFieldRaw.vue | 30 +++ frontend/src/components/job/JobFieldTRES.vue | 27 +++ frontend/src/composables/GatewayAPI.ts | 8 +- frontend/src/views/JobView.vue | 205 +++++++----------- 6 files changed, 200 insertions(+), 124 deletions(-) create mode 100644 frontend/src/components/job/JobFieldComment.vue create mode 100644 frontend/src/components/job/JobFieldExitCode.vue create mode 100644 frontend/src/components/job/JobFieldRaw.vue create mode 100644 frontend/src/components/job/JobFieldTRES.vue diff --git a/frontend/src/components/job/JobFieldComment.vue b/frontend/src/components/job/JobFieldComment.vue new file mode 100644 index 00000000..9b19c7c3 --- /dev/null +++ b/frontend/src/components/job/JobFieldComment.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/frontend/src/components/job/JobFieldExitCode.vue b/frontend/src/components/job/JobFieldExitCode.vue new file mode 100644 index 00000000..8e5edd84 --- /dev/null +++ b/frontend/src/components/job/JobFieldExitCode.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/frontend/src/components/job/JobFieldRaw.vue b/frontend/src/components/job/JobFieldRaw.vue new file mode 100644 index 00000000..32496aaf --- /dev/null +++ b/frontend/src/components/job/JobFieldRaw.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/frontend/src/components/job/JobFieldTRES.vue b/frontend/src/components/job/JobFieldTRES.vue new file mode 100644 index 00000000..5da10dfd --- /dev/null +++ b/frontend/src/components/job/JobFieldTRES.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/frontend/src/composables/GatewayAPI.ts b/frontend/src/composables/GatewayAPI.ts index 51203bea..31ae7a4f 100644 --- a/frontend/src/composables/GatewayAPI.ts +++ b/frontend/src/composables/GatewayAPI.ts @@ -112,6 +112,12 @@ export interface ClusterJobStep { step: { id: { job_id: number; step_id: string }; name: string } } +export interface ClusterJobComment { + administrator: string + job: string + system: string +} + export interface ClusterJobExitCode { return_code: number status: string @@ -122,7 +128,7 @@ export interface ClusterIndividualJob { association: { account: string; cluster: string; partition: string; user: string } batch_flag: boolean command: string - comment: { administrator: string; job: string; system: string } + comment: ClusterJobComment cpus: ClusterOptionalNumber current_working_directory: string derived_exit_code: ClusterJobExitCode diff --git a/frontend/src/views/JobView.vue b/frontend/src/views/JobView.vue index d55a3069..db12573c 100644 --- a/frontend/src/views/JobView.vue +++ b/frontend/src/views/JobView.vue @@ -7,6 +7,7 @@ -->