mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-01 16:44:54 +00:00
Rename build to pipeline in code (#1224)
Ref: #745 Co-authored-by: Anbraten <anton@ju60.de> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
60
web/src/views/repo/pipeline/PipelineConfig.vue
Normal file
60
web/src/views/repo/pipeline/PipelineConfig.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<FluidContainer v-if="pipelineConfigs" class="flex flex-col gap-y-6 text-color justify-between !pt-0">
|
||||
<Panel v-for="pipelineConfig in pipelineConfigs" :key="pipelineConfig.hash" :title="pipelineConfig.name">
|
||||
<SyntaxHighlight class="font-mono whitespace-pre overflow-auto" language="yaml" :code="pipelineConfig.data" />
|
||||
</Panel>
|
||||
</FluidContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, inject, onMounted, Ref, ref, watch } from 'vue';
|
||||
|
||||
import SyntaxHighlight from '~/components/atomic/SyntaxHighlight';
|
||||
import FluidContainer from '~/components/layout/FluidContainer.vue';
|
||||
import Panel from '~/components/layout/Panel.vue';
|
||||
import useApiClient from '~/compositions/useApiClient';
|
||||
import { Pipeline, PipelineConfig, Repo } from '~/lib/api/types';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PipelineConfig',
|
||||
|
||||
components: {
|
||||
FluidContainer,
|
||||
Panel,
|
||||
SyntaxHighlight,
|
||||
},
|
||||
|
||||
setup() {
|
||||
const pipeline = inject<Ref<Pipeline>>('pipeline');
|
||||
const apiClient = useApiClient();
|
||||
const repo = inject<Ref<Repo>>('repo');
|
||||
if (!repo || !pipeline) {
|
||||
throw new Error('Unexpected: "repo" & "pipeline" should be provided at this place');
|
||||
}
|
||||
|
||||
const pipelineConfigs = ref<PipelineConfig[]>();
|
||||
async function loadPipelineConfig() {
|
||||
if (!repo || !pipeline) {
|
||||
throw new Error('Unexpected: "repo" & "pipeline" should be provided at this place');
|
||||
}
|
||||
|
||||
pipelineConfigs.value = (
|
||||
await apiClient.getPipelineConfig(repo.value.owner, repo.value.name, pipeline.value.number)
|
||||
).map((i) => ({
|
||||
...i,
|
||||
data: atob(i.data),
|
||||
}));
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadPipelineConfig();
|
||||
});
|
||||
|
||||
watch(pipeline, () => {
|
||||
loadPipelineConfig();
|
||||
});
|
||||
|
||||
return { pipelineConfigs };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user