mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 12:59:27 +00:00
Co-authored-by: Tchoupinax <corentinfiloche@hotmail.fr> Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
35 lines
1.1 KiB
Vue
35 lines
1.1 KiB
Vue
<template>
|
|
<div class="flex flex-col gap-y-6">
|
|
<Panel
|
|
v-for="pipelineConfig in pipelineConfigsDecoded || []"
|
|
:key="pipelineConfig.hash"
|
|
:collapsable="pipelineConfigsDecoded && pipelineConfigsDecoded.length > 1"
|
|
collapsed-by-default
|
|
:title="pipelineConfigsDecoded && pipelineConfigsDecoded.length > 1 ? pipelineConfig.name : ''"
|
|
>
|
|
<SyntaxHighlight class="font-mono whitespace-pre overflow-auto" language="yaml" :code="pipelineConfig.data" />
|
|
</Panel>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { decode } from 'js-base64';
|
|
import { computed, inject, Ref } from 'vue';
|
|
|
|
import SyntaxHighlight from '~/components/atomic/SyntaxHighlight';
|
|
import Panel from '~/components/layout/Panel.vue';
|
|
import { PipelineConfig } from '~/lib/api/types';
|
|
|
|
const pipelineConfigs = inject<Ref<PipelineConfig[]>>('pipeline-configs');
|
|
if (!pipelineConfigs) {
|
|
throw new Error('Unexpected: "pipelineConfigs" should be provided at this place');
|
|
}
|
|
|
|
const pipelineConfigsDecoded = computed(() =>
|
|
pipelineConfigs.value.map((i) => ({
|
|
...i,
|
|
data: decode(i.data),
|
|
})),
|
|
);
|
|
</script>
|