2017-02-12 09:40:11 -05:00
|
|
|
/**
|
|
|
|
* Render environments table.
|
|
|
|
*/
|
|
|
|
const Vue = require('vue');
|
|
|
|
const EnvironmentItem = require('./environment_item');
|
|
|
|
|
|
|
|
module.exports = Vue.component('environment-table-component', {
|
|
|
|
|
|
|
|
components: {
|
|
|
|
'environment-item': EnvironmentItem,
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
environments: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
default: () => ([]),
|
|
|
|
},
|
|
|
|
|
|
|
|
canReadEnvironment: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
canCreateDeployment: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
commitIconSvg: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
playIconSvg: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
terminalIconSvg: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
template: `
|
2017-02-28 07:05:01 -05:00
|
|
|
<table class="table ci-table">
|
2017-02-12 09:40:11 -05:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="environments-name">Environment</th>
|
|
|
|
<th class="environments-deploy">Last deployment</th>
|
|
|
|
<th class="environments-build">Job</th>
|
|
|
|
<th class="environments-commit">Commit</th>
|
|
|
|
<th class="environments-date">Updated</th>
|
2017-02-28 07:05:01 -05:00
|
|
|
<th class="environments-actions"></th>
|
2017-02-12 09:40:11 -05:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<template v-for="model in environments"
|
|
|
|
v-bind:model="model">
|
|
|
|
<tr is="environment-item"
|
|
|
|
:model="model"
|
|
|
|
:can-create-deployment="canCreateDeployment"
|
|
|
|
:can-read-environment="canReadEnvironment"
|
|
|
|
:play-icon-svg="playIconSvg"
|
|
|
|
:terminal-icon-svg="terminalIconSvg"
|
|
|
|
:commit-icon-svg="commitIconSvg"></tr>
|
|
|
|
</template>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
`,
|
|
|
|
});
|