debian-mirror-gitlab/app/assets/javascripts/clusters/components/uninstall_application_button.vue

37 lines
723 B
Vue
Raw Normal View History

2019-07-31 22:56:46 +05:30
<script>
2020-11-24 15:15:51 +05:30
import { GlButton } from '@gitlab/ui';
2019-07-31 22:56:46 +05:30
import { APPLICATION_STATUS } from '~/clusters/constants';
2019-09-30 21:07:59 +05:30
import { __ } from '~/locale';
2019-07-31 22:56:46 +05:30
const { UPDATING, UNINSTALLING } = APPLICATION_STATUS;
export default {
components: {
2020-11-24 15:15:51 +05:30
GlButton,
2019-07-31 22:56:46 +05:30
},
props: {
status: {
type: String,
required: true,
},
},
computed: {
disabled() {
return [UNINSTALLING, UPDATING].includes(this.status);
},
loading() {
return this.status === UNINSTALLING;
},
label() {
2019-09-30 21:07:59 +05:30
return this.loading ? __('Uninstalling') : __('Uninstall');
2019-07-31 22:56:46 +05:30
},
},
};
</script>
<template>
2020-11-24 15:15:51 +05:30
<gl-button :disabled="disabled" variant="default" :loading="loading">
{{ label }}
</gl-button>
2019-07-31 22:56:46 +05:30
</template>