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

47 lines
839 B
Vue
Raw Normal View History

2017-08-17 22:00:37 +05:30
<script>
2018-11-18 11:00:15 +05:30
/**
* Renders a terminal button to open a web terminal.
* Used in environments table.
*/
2020-11-24 15:15:51 +05:30
import { GlTooltipDirective, GlIcon } from '@gitlab/ui';
2019-09-30 21:07:59 +05:30
import { __ } from '~/locale';
2017-08-17 22:00:37 +05:30
2018-11-18 11:00:15 +05:30
export default {
components: {
2020-11-24 15:15:51 +05:30
GlIcon,
2018-11-18 11:00:15 +05:30
},
directives: {
2019-02-15 15:39:39 +05:30
GlTooltip: GlTooltipDirective,
2018-11-18 11:00:15 +05:30
},
props: {
terminalPath: {
type: String,
required: false,
default: '',
2018-10-15 14:42:47 +05:30
},
2019-02-15 15:39:39 +05:30
disabled: {
type: Boolean,
required: false,
default: false,
},
2018-11-18 11:00:15 +05:30
},
computed: {
title() {
2019-09-30 21:07:59 +05:30
return __('Terminal');
2017-08-17 22:00:37 +05:30
},
2018-11-18 11:00:15 +05:30
},
};
2017-08-17 22:00:37 +05:30
</script>
<template>
<a
2019-02-15 15:39:39 +05:30
v-gl-tooltip
2017-08-17 22:00:37 +05:30
:title="title"
:aria-label="title"
:href="terminalPath"
2019-02-15 15:39:39 +05:30
:class="{ disabled: disabled }"
2019-07-31 22:56:46 +05:30
class="btn terminal-button d-none d-sm-none d-md-block text-secondary"
2018-03-17 18:26:18 +05:30
>
2020-11-24 15:15:51 +05:30
<gl-icon name="terminal" />
2017-08-17 22:00:37 +05:30
</a>
</template>