2019-04-16 10:56:07 -04:00
|
|
|
<script>
|
|
|
|
import LoadingButton from '~/vue_shared/components/loading_button.vue';
|
2019-05-02 10:17:03 -04:00
|
|
|
import { APPLICATION_STATUS } from '~/clusters/constants';
|
2019-07-02 01:11:47 -04:00
|
|
|
import { __ } from '~/locale';
|
2019-05-02 10:17:03 -04:00
|
|
|
|
|
|
|
const { UPDATING, UNINSTALLING } = APPLICATION_STATUS;
|
2019-04-16 10:56:07 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
LoadingButton,
|
|
|
|
},
|
2019-05-02 10:17:03 -04:00
|
|
|
props: {
|
|
|
|
status: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
disabled() {
|
|
|
|
return [UNINSTALLING, UPDATING].includes(this.status);
|
|
|
|
},
|
|
|
|
loading() {
|
|
|
|
return this.status === UNINSTALLING;
|
|
|
|
},
|
|
|
|
label() {
|
2019-07-02 01:11:47 -04:00
|
|
|
return this.loading ? __('Uninstalling') : __('Uninstall');
|
2019-05-02 10:17:03 -04:00
|
|
|
},
|
|
|
|
},
|
2019-04-16 10:56:07 -04:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2019-05-02 10:17:03 -04:00
|
|
|
<loading-button :label="label" :disabled="disabled" :loading="loading" />
|
2019-04-16 10:56:07 -04:00
|
|
|
</template>
|