2017-11-23 07:04:03 -05:00
|
|
|
<script>
|
2018-11-16 14:29:11 -05:00
|
|
|
import { GlLoadingIcon } from '@gitlab/ui';
|
2019-12-09 07:07:58 -05:00
|
|
|
import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue';
|
2020-05-19 05:08:12 -04:00
|
|
|
import EnvironmentTable from './environments_table.vue';
|
2017-11-23 07:04:03 -05:00
|
|
|
|
2018-10-10 02:18:49 -04:00
|
|
|
export default {
|
|
|
|
components: {
|
2019-03-11 06:22:32 -04:00
|
|
|
EnvironmentTable,
|
|
|
|
TablePagination,
|
2018-11-07 05:06:15 -05:00
|
|
|
GlLoadingIcon,
|
2018-10-10 02:18:49 -04:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
isLoading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2018-01-05 09:31:01 -05:00
|
|
|
},
|
2018-10-10 02:18:49 -04:00
|
|
|
environments: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
2017-11-23 07:04:03 -05:00
|
|
|
},
|
2018-10-10 02:18:49 -04:00
|
|
|
pagination: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2017-11-23 07:04:03 -05:00
|
|
|
},
|
2018-10-10 02:18:49 -04:00
|
|
|
canReadEnvironment: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChangePage(page) {
|
|
|
|
this.$emit('onChangePage', page);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2017-11-23 07:04:03 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="environments-container">
|
2020-06-26 02:09:03 -04:00
|
|
|
<gl-loading-icon v-if="isLoading" size="md" class="gl-mt-3" label="Loading environments" />
|
2017-11-23 07:04:03 -05:00
|
|
|
|
2020-11-13 16:09:31 -05:00
|
|
|
<slot name="empty-state"></slot>
|
2017-11-23 07:04:03 -05:00
|
|
|
|
2018-11-16 15:07:38 -05:00
|
|
|
<div v-if="!isLoading && environments.length > 0" class="table-holder">
|
2021-02-02 07:10:15 -05:00
|
|
|
<environment-table :environments="environments" :can-read-environment="canReadEnvironment" />
|
2017-11-23 07:04:03 -05:00
|
|
|
|
|
|
|
<table-pagination
|
|
|
|
v-if="pagination && pagination.totalPages > 1"
|
|
|
|
:change="onChangePage"
|
2018-01-05 09:31:01 -05:00
|
|
|
:page-info="pagination"
|
|
|
|
/>
|
2017-11-23 07:04:03 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|