mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-06-05 17:08:50 +00:00
Merge branch 'origin/main' into 'next-release/main'
This commit is contained in:
commit
160fa74d8d
6 changed files with 26 additions and 10 deletions
|
@ -191,7 +191,7 @@
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"tasks": "Tasks",
|
"tasks": "Tasks",
|
||||||
"config": "Config",
|
"config": "Config",
|
||||||
"files": "Changed files ({files})",
|
"files": "Changed files",
|
||||||
"no_pipelines": "No pipelines have been started yet.",
|
"no_pipelines": "No pipelines have been started yet.",
|
||||||
"no_pipeline_steps": "No pipeline steps available!",
|
"no_pipeline_steps": "No pipeline steps available!",
|
||||||
"step_not_started": "This step hasn't started yet.",
|
"step_not_started": "This step hasn't started yet.",
|
||||||
|
@ -248,8 +248,8 @@
|
||||||
"failure": "failure",
|
"failure": "failure",
|
||||||
"killed": "killed"
|
"killed": "killed"
|
||||||
},
|
},
|
||||||
"errors": "Errors ({count})",
|
"errors": "Errors",
|
||||||
"warnings": "Warnings ({count})",
|
"warnings": "Warnings",
|
||||||
"show_errors": "Show errors",
|
"show_errors": "Show errors",
|
||||||
"we_got_some_errors": "Oh no, we got some errors!",
|
"we_got_some_errors": "Oh no, we got some errors!",
|
||||||
"duration": "Pipeline duration",
|
"duration": "Pipeline duration",
|
||||||
|
|
13
web/src/components/atomic/CountBadge.vue
Normal file
13
web/src/components/atomic/CountBadge.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<span
|
||||||
|
class="text-xs font-bold inline-block min-w-5 leading-4 rounded-full bg-wp-background-300 dark:bg-wp-background-100 text-wp-text-100 text-center py-0.5 px-1.5"
|
||||||
|
>
|
||||||
|
{{ value }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
defineProps<{
|
||||||
|
value?: string | number;
|
||||||
|
}>();
|
||||||
|
</script>
|
|
@ -10,6 +10,7 @@ import { useTabsClient } from '~/compositions/useTabs';
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
to: RouteLocationRaw;
|
to: RouteLocationRaw;
|
||||||
title: string;
|
title: string;
|
||||||
|
count?: number;
|
||||||
icon?: IconNames;
|
icon?: IconNames;
|
||||||
iconClass?: string;
|
iconClass?: string;
|
||||||
matchChildren?: boolean;
|
matchChildren?: boolean;
|
||||||
|
@ -32,6 +33,7 @@ onMounted(() => {
|
||||||
tabs.value.push({
|
tabs.value.push({
|
||||||
to: props.to,
|
to: props.to,
|
||||||
title: props.title,
|
title: props.title,
|
||||||
|
count: props.count,
|
||||||
icon: props.icon,
|
icon: props.icon,
|
||||||
iconClass: props.iconClass,
|
iconClass: props.iconClass,
|
||||||
matchChildren: props.matchChildren,
|
matchChildren: props.matchChildren,
|
||||||
|
|
|
@ -11,15 +11,17 @@
|
||||||
>
|
>
|
||||||
<Icon v-if="isExactActive || (isActive && tab.matchChildren)" name="chevron-right" class="md:hidden" />
|
<Icon v-if="isExactActive || (isActive && tab.matchChildren)" name="chevron-right" class="md:hidden" />
|
||||||
<Icon v-else name="blank" class="md:hidden" />
|
<Icon v-else name="blank" class="md:hidden" />
|
||||||
<span class="flex gap-2 items-center flex-row-reverse md:flex-row">
|
<span class="flex gap-2 items-center flex-row">
|
||||||
<Icon v-if="tab.icon" :name="tab.icon" :class="tab.iconClass" />
|
<Icon v-if="tab.icon" :name="tab.icon" :class="tab.iconClass" />
|
||||||
<span>{{ tab.title }}</span>
|
<span>{{ tab.title }}</span>
|
||||||
|
<CountBadge v-if="tab.count" :value="tab.count" />
|
||||||
</span>
|
</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import CountBadge from '~/components/atomic/CountBadge.vue';
|
||||||
import Icon from '~/components/atomic/Icon.vue';
|
import Icon from '~/components/atomic/Icon.vue';
|
||||||
import { useTabsClient } from '~/compositions/useTabs';
|
import { useTabsClient } from '~/compositions/useTabs';
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { inject, provide } from './useInjectProvide';
|
||||||
export interface Tab {
|
export interface Tab {
|
||||||
to: RouteLocationRaw;
|
to: RouteLocationRaw;
|
||||||
title: string;
|
title: string;
|
||||||
|
count?: number;
|
||||||
icon?: IconNames;
|
icon?: IconNames;
|
||||||
iconClass?: string;
|
iconClass?: string;
|
||||||
matchChildren?: boolean;
|
matchChildren?: boolean;
|
||||||
|
|
|
@ -78,18 +78,16 @@
|
||||||
v-if="pipeline.errors && pipeline.errors.length > 0"
|
v-if="pipeline.errors && pipeline.errors.length > 0"
|
||||||
:to="{ name: 'repo-pipeline-errors' }"
|
:to="{ name: 'repo-pipeline-errors' }"
|
||||||
icon="attention"
|
icon="attention"
|
||||||
:title="
|
:title="pipeline.errors.some((e) => !e.is_warning) ? $t('repo.pipeline.errors') : $t('repo.pipeline.warnings')"
|
||||||
pipeline.errors.some((e) => !e.is_warning)
|
:count="pipeline.errors?.length"
|
||||||
? $t('repo.pipeline.errors', { count: pipeline.errors?.length })
|
|
||||||
: $t('repo.pipeline.warnings', { count: pipeline.errors?.length })
|
|
||||||
"
|
|
||||||
:icon-class="pipeline.errors.some((e) => !e.is_warning) ? 'text-wp-state-error-100' : 'text-wp-state-warn-100'"
|
:icon-class="pipeline.errors.some((e) => !e.is_warning) ? 'text-wp-state-error-100' : 'text-wp-state-warn-100'"
|
||||||
/>
|
/>
|
||||||
<Tab :to="{ name: 'repo-pipeline-config' }" :title="$t('repo.pipeline.config')" />
|
<Tab :to="{ name: 'repo-pipeline-config' }" :title="$t('repo.pipeline.config')" />
|
||||||
<Tab
|
<Tab
|
||||||
v-if="pipeline.changed_files && pipeline.changed_files.length > 0"
|
v-if="pipeline.changed_files && pipeline.changed_files.length > 0"
|
||||||
:to="{ name: 'repo-pipeline-changed-files' }"
|
:to="{ name: 'repo-pipeline-changed-files' }"
|
||||||
:title="$t('repo.pipeline.files', { files: pipeline.changed_files?.length })"
|
:title="$t('repo.pipeline.files')"
|
||||||
|
:count="pipeline.changed_files?.length"
|
||||||
/>
|
/>
|
||||||
<Tab
|
<Tab
|
||||||
v-if="repoPermissions && repoPermissions.push"
|
v-if="repoPermissions && repoPermissions.push"
|
||||||
|
|
Loading…
Reference in a new issue