2017-09-19 11:38:55 -04:00
|
|
|
<script>
|
|
|
|
/* globals Flash */
|
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
|
|
|
import '../../flash';
|
|
|
|
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
|
|
|
|
import store from '../stores';
|
|
|
|
import collapsibleContainer from './collapsible_container.vue';
|
|
|
|
import { errorMessages, errorMessagesTypes } from '../constants';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'registryListApp',
|
|
|
|
props: {
|
|
|
|
endpoint: {
|
|
|
|
type: String,
|
2017-09-22 06:46:55 -04:00
|
|
|
required: true,
|
2017-09-19 11:38:55 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
store,
|
|
|
|
components: {
|
|
|
|
collapsibleContainer,
|
|
|
|
loadingIcon,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters([
|
|
|
|
'isLoading',
|
|
|
|
'repos',
|
|
|
|
]),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions([
|
|
|
|
'setMainEndpoint',
|
|
|
|
'fetchRepos',
|
|
|
|
]),
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.setMainEndpoint(this.endpoint);
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetchRepos()
|
2017-09-26 07:02:03 -04:00
|
|
|
.catch(() => Flash(errorMessages[errorMessagesTypes.FETCH_REPOS]));
|
2017-09-22 06:46:55 -04:00
|
|
|
},
|
2017-09-19 11:38:55 -04:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<loading-icon
|
|
|
|
v-if="isLoading"
|
|
|
|
size="3"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<collapsible-container
|
|
|
|
v-else-if="!isLoading && repos.length"
|
|
|
|
v-for="(item, index) in repos"
|
|
|
|
:key="index"
|
|
|
|
:repo="item"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p v-else-if="!isLoading && !repos.length">
|
2017-09-22 06:46:55 -04:00
|
|
|
{{__("No container images stored for this project. Add one by following the instructions above.")}}
|
2017-09-19 11:38:55 -04:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</template>
|