-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
6 changed files
with
200 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- | ||
Copyright (c) 2024 Rackslab | ||
This file is part of Slurm-web. | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
--> | ||
|
||
<script setup lang="ts"> | ||
import type { PropType } from 'vue' | ||
import type { ClusterJobComment } from '@/composables/GatewayAPI' | ||
const props = defineProps({ | ||
comment: { | ||
type: Object as PropType<ClusterJobComment>, | ||
required: true | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> | ||
<p v-if="comment.administrator"> | ||
<span class="italic">(administrator)</span> {{ comment.administrator }} | ||
</p> | ||
<p v-if="comment.system"><span class="italic">(system)</span> {{ comment.system }}</p> | ||
<p v-if="comment.job"><span class="italic">(job)</span> {{ comment.job }}</p> | ||
</dd> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
Copyright (c) 2024 Rackslab | ||
This file is part of Slurm-web. | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
--> | ||
|
||
<script setup lang="ts"> | ||
import type { PropType } from 'vue' | ||
import type { ClusterJobExitCode } from '@/composables/GatewayAPI' | ||
defineProps({ | ||
exit_code: { | ||
type: Object as PropType<ClusterJobExitCode>, | ||
required: true | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> | ||
{{ exit_code.status }} ({{ exit_code.return_code }}) | ||
</dd> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- | ||
Copyright (c) 2024 Rackslab | ||
This file is part of Slurm-web. | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
--> | ||
|
||
<script setup lang="ts"> | ||
const props = defineProps({ | ||
field: { | ||
required: true | ||
}, | ||
monospace: { | ||
type: Boolean, | ||
def: false | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<dd | ||
:class="[ | ||
monospace ? 'font-mono' : '', | ||
'mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0' | ||
]" | ||
> | ||
{{ field }} | ||
</dd> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
Copyright (c) 2024 Rackslab | ||
This file is part of Slurm-web. | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
--> | ||
|
||
<script setup lang="ts"> | ||
import type { PropType } from 'vue' | ||
import type { ClusterTRES } from '@/composables/GatewayAPI' | ||
defineProps({ | ||
tres: { | ||
type: Object as PropType<ClusterTRES[]>, | ||
required: true | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> | ||
<ul> | ||
<li v-for="resource in tres" :key="resource.id">{{ resource.type }}: {{ resource.count }}</li> | ||
</ul> | ||
</dd> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters