debian-mirror-gitlab/app/assets/javascripts/environments/components/environments_table.vue

98 lines
2.4 KiB
Vue
Raw Normal View History

2017-08-17 22:00:37 +05:30
<script>
/**
* Render environments table.
*/
import EnvironmentTableRowComponent from './environment_item.vue';
2017-09-10 17:25:29 +05:30
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
2017-08-17 22:00:37 +05:30
export default {
components: {
'environment-item': EnvironmentTableRowComponent,
2017-09-10 17:25:29 +05:30
loadingIcon,
2017-08-17 22:00:37 +05:30
},
props: {
environments: {
type: Array,
required: true,
default: () => ([]),
},
canReadEnvironment: {
type: Boolean,
required: false,
default: false,
},
canCreateDeployment: {
type: Boolean,
required: false,
default: false,
},
},
methods: {
folderUrl(model) {
return `${window.location.pathname}/folders/${model.folderName}`;
},
},
};
</script>
<template>
2017-09-10 17:25:29 +05:30
<div class="ci-table" role="grid">
<div class="gl-responsive-table-row table-row-header" role="row">
<div class="table-section section-10 environments-name" role="columnheader">
Environment
</div>
<div class="table-section section-10 environments-deploy" role="columnheader">
Deployment
</div>
<div class="table-section section-15 environments-build" role="columnheader">
Job
</div>
<div class="table-section section-25 environments-commit" role="columnheader">
Commit
</div>
<div class="table-section section-10 environments-date" role="columnheader">
Updated
</div>
</div>
<template
v-for="model in environments"
v-bind:model="model">
<div
is="environment-item"
:model="model"
:can-create-deployment="canCreateDeployment"
:can-read-environment="canReadEnvironment"
/>
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
<template v-if="model.isFolder && model.isOpen && model.children && model.children.length > 0">
<div v-if="model.isLoadingFolderContent">
<loading-icon size="2" />
</div>
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
<template v-else>
<div
is="environment-item"
v-for="children in model.children"
:model="children"
:can-create-deployment="canCreateDeployment"
:can-read-environment="canReadEnvironment"
/>
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
<div>
<div class="text-center prepend-top-10">
<a
:href="folderUrl(model)"
class="btn btn-default">
Show all
</a>
</div>
</div>
2017-08-17 22:00:37 +05:30
</template>
</template>
2017-09-10 17:25:29 +05:30
</template>
</div>
2017-08-17 22:00:37 +05:30
</template>