2018-03-17 18:26:18 +05:30
|
|
|
<script>
|
2018-12-13 13:39:08 +05:30
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
2019-02-15 15:39:39 +05:30
|
|
|
import { GlLoadingIcon } from '@gitlab/ui';
|
2018-12-13 13:39:08 +05:30
|
|
|
import store from '../stores';
|
2019-02-15 15:39:39 +05:30
|
|
|
import CollapsibleContainer from './collapsible_container.vue';
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
export default {
|
|
|
|
name: 'RegistryListApp',
|
|
|
|
components: {
|
2019-02-15 15:39:39 +05:30
|
|
|
CollapsibleContainer,
|
2018-12-13 13:39:08 +05:30
|
|
|
GlLoadingIcon,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
endpoint: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
store,
|
|
|
|
computed: {
|
|
|
|
...mapGetters(['isLoading', 'repos']),
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.setMainEndpoint(this.endpoint);
|
|
|
|
},
|
|
|
|
mounted() {
|
2019-02-15 15:39:39 +05:30
|
|
|
this.fetchRepos();
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions(['setMainEndpoint', 'fetchRepos']),
|
|
|
|
},
|
|
|
|
};
|
2018-03-17 18:26:18 +05:30
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div>
|
2019-02-15 15:39:39 +05:30
|
|
|
<gl-loading-icon v-if="isLoading" :size="3" />
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
<collapsible-container
|
2019-02-15 15:39:39 +05:30
|
|
|
v-for="item in repos"
|
2018-11-08 19:23:39 +05:30
|
|
|
v-else-if="!isLoading && repos.length"
|
2019-02-15 15:39:39 +05:30
|
|
|
:key="item.id"
|
2018-03-17 18:26:18 +05:30
|
|
|
:repo="item"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p v-else-if="!isLoading && !repos.length">
|
2019-02-15 15:39:39 +05:30
|
|
|
{{
|
|
|
|
__(`No container images stored for this project.
|
|
|
|
Add one by following the instructions above.`)
|
|
|
|
}}
|
2018-03-17 18:26:18 +05:30
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</template>
|