From 420ac54e62f6ea2bb1611eb18e06542d87fc5b50 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 30 Jan 2023 22:53:59 +0200 Subject: [PATCH] Show platform, backend and capacity as badges in agent list (#1568) Screenshots: ![attels](https://user-images.githubusercontent.com/165205/215585911-37813edc-05fc-4be8-9bc0-5bed80b0faf2.png) ![attels](https://user-images.githubusercontent.com/165205/215586019-360d49c5-069f-4735-ad58-698e8f14780a.png) --- web/components.d.ts | 3 ++- web/src/assets/locales/en.json | 15 +++++++++--- .../admin/settings/AdminAgentsTab.vue | 19 +++++++++++---- web/src/components/atomic/Badge.vue | 24 +++++++++++++++++++ .../repo/pipeline/PipelineStepList.vue | 12 +++------- 5 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 web/src/components/atomic/Badge.vue diff --git a/web/components.d.ts b/web/components.d.ts index 375836573..0ae6cb8ec 100644 --- a/web/components.d.ts +++ b/web/components.d.ts @@ -11,6 +11,7 @@ declare module '@vue/runtime-core' { ActivePipelines: typeof import('./src/components/layout/header/ActivePipelines.vue')['default'] AdminAgentsTab: typeof import('./src/components/admin/settings/AdminAgentsTab.vue')['default'] AdminSecretsTab: typeof import('./src/components/admin/settings/AdminSecretsTab.vue')['default'] + Badge: typeof import('./src/components/atomic/Badge.vue')['default'] BadgeTab: typeof import('./src/components/repo/settings/BadgeTab.vue')['default'] Button: typeof import('./src/components/atomic/Button.vue')['default'] Checkbox: typeof import('./src/components/form/Checkbox.vue')['default'] @@ -55,10 +56,10 @@ declare module '@vue/runtime-core' { IMdiGestureTap: typeof import('~icons/mdi/gesture-tap')['default'] IMdiGithub: typeof import('~icons/mdi/github')['default'] IMdiLoading: typeof import('~icons/mdi/loading')['default'] + IMdiSync: typeof import('~icons/mdi/sync')['default'] IMdiSourceBranch: typeof import('~icons/mdi/source-branch')['default'] IMdisourceCommit: typeof import('~icons/mdi/source-commit')['default'] IMdiSourcePull: typeof import('~icons/mdi/source-pull')['default'] - IMdiSync: typeof import('~icons/mdi/sync')['default'] IMdiTagOutline: typeof import('~icons/mdi/tag-outline')['default'] InputField: typeof import('./src/components/form/InputField.vue')['default'] IPhGitlabLogoSimpleFill: typeof import('~icons/ph/gitlab-logo-simple-fill')['default'] diff --git a/web/src/assets/locales/en.json b/web/src/assets/locales/en.json index 974537171..b6b3eef9d 100644 --- a/web/src/assets/locales/en.json +++ b/web/src/assets/locales/en.json @@ -341,9 +341,18 @@ "placeholder": "Stop agent from taking new tasks" }, "token": "Token", - "platform": "Platform", - "backend": "Backend", - "capacity": "Capacity", + "platform": { + "platform": "Platform", + "badge": "platform" + }, + "backend": { + "backend": "Backend", + "badge": "backend" + }, + "capacity": { + "capacity": "Capacity", + "badge": "capacity" + }, "version": "Version", "last_contact": "Last contact", "never": "Never", diff --git a/web/src/components/admin/settings/AdminAgentsTab.vue b/web/src/components/admin/settings/AdminAgentsTab.vue index a3f5ff364..5c445bbbe 100644 --- a/web/src/components/admin/settings/AdminAgentsTab.vue +++ b/web/src/components/admin/settings/AdminAgentsTab.vue @@ -21,7 +21,14 @@
{{ agent.name || `Agent ${agent.id}` }} - {{ agent.last_contact ? timeAgo.format(agent.last_contact * 1000) : 'never' }} + + + {{ agent.last_contact ? timeAgo.format(agent.last_contact * 1000) : 'never' }} + - + - + The max amount of parallel pipelines executed by this agent. @@ -103,6 +113,7 @@ import { cloneDeep } from 'lodash'; import { computed, onMounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; +import Badge from '~/components/atomic/Badge.vue'; import Button from '~/components/atomic/Button.vue'; import ListItem from '~/components/atomic/ListItem.vue'; import Checkbox from '~/components/form/Checkbox.vue'; diff --git a/web/src/components/atomic/Badge.vue b/web/src/components/atomic/Badge.vue new file mode 100644 index 000000000..6b5372b68 --- /dev/null +++ b/web/src/components/atomic/Badge.vue @@ -0,0 +1,24 @@ + + + diff --git a/web/src/components/repo/pipeline/PipelineStepList.vue b/web/src/components/repo/pipeline/PipelineStepList.vue index 7483d44f5..948e9b830 100644 --- a/web/src/components/repo/pipeline/PipelineStepList.vue +++ b/web/src/components/repo/pipeline/PipelineStepList.vue @@ -50,16 +50,9 @@ class="p-2 md:rounded-md bg-white shadow dark:border-b-dark-gray-600 dark:bg-dark-gray-700" >
-
+
- - {{ key }} - - - {{ value }} - +