2017-09-19 15:38:55 +00:00
|
|
|
<script>
|
2018-10-10 06:49:24 +00:00
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
2018-11-16 19:29:11 +00:00
|
|
|
import { GlLoadingIcon } from '@gitlab/ui';
|
2018-10-10 06:49:24 +00:00
|
|
|
import Flash from '../../flash';
|
|
|
|
import store from '../stores';
|
|
|
|
import collapsibleContainer from './collapsible_container.vue';
|
|
|
|
import { errorMessages, errorMessagesTypes } from '../constants';
|
2017-09-19 15:38:55 +00:00
|
|
|
|
2018-10-10 06:49:24 +00:00
|
|
|
export default {
|
|
|
|
name: 'RegistryListApp',
|
|
|
|
components: {
|
|
|
|
collapsibleContainer,
|
2018-11-07 10:06:15 +00:00
|
|
|
GlLoadingIcon,
|
2018-10-10 06:49:24 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
endpoint: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
2018-01-05 00:18:35 +00:00
|
|
|
},
|
2018-10-10 06:49:24 +00:00
|
|
|
},
|
|
|
|
store,
|
|
|
|
computed: {
|
|
|
|
...mapGetters(['isLoading', 'repos']),
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.setMainEndpoint(this.endpoint);
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetchRepos().catch(() => Flash(errorMessages[errorMessagesTypes.FETCH_REPOS]));
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions(['setMainEndpoint', 'fetchRepos']),
|
|
|
|
},
|
|
|
|
};
|
2017-09-19 15:38:55 +00:00
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div>
|
2018-11-16 20:07:38 +00:00
|
|
|
<gl-loading-icon v-if="isLoading" :size="3" />
|
2017-09-19 15:38:55 +00:00
|
|
|
|
|
|
|
<collapsible-container
|
|
|
|
v-for="(item, index) in repos"
|
2018-06-11 09:49:47 +00:00
|
|
|
v-else-if="!isLoading && repos.length"
|
2017-09-19 15:38:55 +00:00
|
|
|
:key="index"
|
|
|
|
:repo="item"
|
2018-01-05 00:18:35 +00:00
|
|
|
/>
|
2017-09-19 15:38:55 +00:00
|
|
|
|
|
|
|
<p v-else-if="!isLoading && !repos.length">
|
2018-11-16 20:07:38 +00:00
|
|
|
{{
|
|
|
|
__(`No container images stored for this project.
|
|
|
|
Add one by following the instructions above.`)
|
|
|
|
}}
|
2017-09-19 15:38:55 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</template>
|