-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
121 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<template> | ||
<b-container> | ||
Pipeline | ||
</b-container> | ||
</template | ||
<b-container> | ||
Pipeline | ||
</b-container> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,93 @@ | ||
<template> | ||
|
||
<b-container> | ||
PipelineList | ||
|
||
<!-- Alert shown when the API client failed. --> | ||
<template v-if="error"> | ||
<b-alert show variant="warning" class="my-3"> | ||
<h4 class="alert-heading">Search error</h4> | ||
We couldn't connect to the API server. You may want to try again in a few seconds. | ||
<hr /> | ||
<b-button @click="retryButtonClicked" class="m-1">Retry</b-button> | ||
</b-alert> | ||
</template> | ||
|
||
<!-- Search form and results. --> | ||
<template v-else> | ||
|
||
<template v-if="results.length > 0"> | ||
<table class="table table-bordered table-sm mt-4"> | ||
<thead class="thead"> | ||
<tr> | ||
<th scope="col">Name</th> | ||
<th>Capacity</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="item in results" v-bind:key="item.id"> | ||
<th scope="row">{{ item.name }}</th> | ||
<td>{{ item.current }} / {{ item.capacity }}</td> | ||
<td>N / A</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
|
||
<div v-if="results.length === 0"> | ||
<b-alert show variant="info" class="my-3"> | ||
<h4 class="alert-heading">No results</h4> | ||
We couldn’t find any collections matching your search criteria. | ||
</b-alert> | ||
</div> | ||
|
||
</template> | ||
|
||
</b-container> | ||
</template | ||
|
||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from 'vue-property-decorator'; | ||
import { namespace } from 'vuex-class'; | ||
import * as PipelineStore from '../store/pipeline'; | ||
const pipelineStoreNs = namespace('pipeline'); | ||
@Component | ||
export default class PipelineList extends Vue { | ||
@pipelineStoreNs.Getter(PipelineStore.GET_PIPELINE_ERROR) | ||
private error?: boolean; | ||
@pipelineStoreNs.Getter(PipelineStore.GET_SEARCH_RESULTS) | ||
private results: any; | ||
@pipelineStoreNs.Action(PipelineStore.SEARCH_PIPELINES) | ||
private search: any; | ||
private created() { | ||
this.search(); | ||
} | ||
/** | ||
* Perform same search re-using all existing state. | ||
*/ | ||
private retryButtonClicked() { | ||
this.search(); | ||
} | ||
/** | ||
* Forward user to the pipeline route. | ||
*/ | ||
private rowClicked(id: string) { | ||
this.$router.push({ name: 'pipeline', params: {id} }); | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters