From 101a8be4def5715ddee7743e85523babee65664b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Garc=C3=ADa=20Crespo?= Date: Fri, 23 Jun 2023 09:06:56 +0000 Subject: [PATCH] Add pipelines tab --- ui/src/App.vue | 2 +- ui/src/store/pipeline/index.ts | 22 ++++++++ ui/src/views/Pipeline.vue | 8 +-- ui/src/views/PipelineList.vue | 92 +++++++++++++++++++++++++++++++++- ui/vite.config.js | 4 ++ 5 files changed, 121 insertions(+), 7 deletions(-) diff --git a/ui/src/App.vue b/ui/src/App.vue index 33c98f18..af726f44 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -9,7 +9,7 @@ Collections - Pipelines + Pipelines Docs diff --git a/ui/src/store/pipeline/index.ts b/ui/src/store/pipeline/index.ts index 397dac78..37724551 100644 --- a/ui/src/store/pipeline/index.ts +++ b/ui/src/store/pipeline/index.ts @@ -6,19 +6,23 @@ import { EnduroCollectionClient, api, EnduroPipelineClient } from '@/client'; // Getter types. export const GET_PIPELINE_ERROR = 'GET_PIPELINE_ERROR'; export const GET_PIPELINE_RESULT = 'GET_PIPELINE_RESULT'; +export const GET_SEARCH_RESULTS = 'GET_SEARCH_RESULTS'; // Mutation types. export const SET_PIPELINE_RESULT = 'SET_PIPELINE_RESULT'; export const SET_PIPELINE_ERROR = 'SET_PIPELINE_ERROR'; +export const SET_SEARCH_RESULTS = 'SET_SEARCH_RESULTS'; // Action types. export const SEARCH_PIPELINE = 'SEARCH_PIPELINE'; +export const SEARCH_PIPELINES = 'SEARCH_PIPELINES'; const namespaced: boolean = true; interface State { error: boolean; result: any; + results: any; } const getters: GetterTree = { @@ -31,6 +35,10 @@ const getters: GetterTree = { return state.result; }, + [GET_SEARCH_RESULTS](state): string { + return state.results; + }, + }; const actions: ActionTree = { @@ -45,6 +53,15 @@ const actions: ActionTree = { }); }, + [SEARCH_PIPELINES]({ commit }): Promise { + return EnduroPipelineClient.pipelineList({}).then((response) => { + commit(SET_SEARCH_RESULTS, response); + commit(SET_PIPELINE_ERROR, false); + }).catch((err) => { + commit(SET_PIPELINE_ERROR, true); + }); + }, + }; const mutations: MutationTree = { @@ -57,12 +74,17 @@ const mutations: MutationTree = { state.result = result; }, + [SET_SEARCH_RESULTS](state, results: any) { + state.results = results; + }, + }; const getDefaultState = (): State => { return { error: false, result: {}, + results: [], }; }; diff --git a/ui/src/views/Pipeline.vue b/ui/src/views/Pipeline.vue index 957380ca..c456bcda 100644 --- a/ui/src/views/Pipeline.vue +++ b/ui/src/views/Pipeline.vue @@ -1,5 +1,5 @@ + Pipeline + + diff --git a/ui/src/views/PipelineList.vue b/ui/src/views/PipelineList.vue index e892c599..60387db5 100644 --- a/ui/src/views/PipelineList.vue +++ b/ui/src/views/PipelineList.vue @@ -1,5 +1,93 @@ + + + + + diff --git a/ui/vite.config.js b/ui/vite.config.js index 1f912471..07a7c301 100644 --- a/ui/vite.config.js +++ b/ui/vite.config.js @@ -34,6 +34,10 @@ export default { changeOrigin: false, ws: true, }, + "/pipeline": { + target: process.env.ENDURO_API_ADDRESS || "http://127.0.0.1:9000", + changeOrigin: true, + }, }, }, }