2018-03-17 18:26:18 +05:30
|
|
|
<script>
|
2019-02-13 22:33:31 +05:30
|
|
|
import { GlLoadingIcon } from '@gitlab/ui';
|
2018-12-13 13:39:08 +05:30
|
|
|
import tablePagination from '../../vue_shared/components/table_pagination.vue';
|
|
|
|
import environmentTable from '../components/environments_table.vue';
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
environmentTable,
|
|
|
|
tablePagination,
|
|
|
|
GlLoadingIcon,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
isLoading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
environments: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
pagination: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
canCreateDeployment: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
canReadEnvironment: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChangePage(page) {
|
|
|
|
this.$emit('onChangePage', page);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-03-17 18:26:18 +05:30
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="environments-container">
|
2018-12-05 23:21:45 +05:30
|
|
|
<gl-loading-icon
|
2018-11-08 19:23:39 +05:30
|
|
|
v-if="isLoading"
|
2018-12-05 23:21:45 +05:30
|
|
|
:size="3"
|
2018-10-15 14:42:47 +05:30
|
|
|
class="prepend-top-default"
|
2018-03-17 18:26:18 +05:30
|
|
|
label="Loading environments"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<slot name="emptyState"></slot>
|
|
|
|
|
2019-02-13 22:33:31 +05:30
|
|
|
<div v-if="!isLoading && environments.length > 0" class="table-holder">
|
2018-03-17 18:26:18 +05:30
|
|
|
<environment-table
|
|
|
|
:environments="environments"
|
|
|
|
:can-create-deployment="canCreateDeployment"
|
|
|
|
:can-read-environment="canReadEnvironment"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<table-pagination
|
|
|
|
v-if="pagination && pagination.totalPages > 1"
|
|
|
|
:change="onChangePage"
|
|
|
|
:page-info="pagination"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|