gitlab-org--gitlab-foss/app/assets/javascripts/environments/components/environment_terminal_button.vue

47 lines
829 B
Vue
Raw Normal View History

2017-04-20 05:04:06 -04:00
<script>
/**
* Renders a terminal button to open a web terminal.
* Used in environments table.
*/
import { GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { __ } from '~/locale';
2016-12-14 19:59:04 -05:00
export default {
components: {
GlIcon,
},
directives: {
GlTooltip: GlTooltipDirective,
},
props: {
terminalPath: {
type: String,
required: false,
default: '',
},
disabled: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
title() {
return __('Terminal');
2017-02-09 06:52:22 -05:00
},
},
};
2017-04-20 05:04:06 -04:00
</script>
<template>
<a
v-gl-tooltip
2017-04-20 05:04:06 -04:00
:title="title"
:aria-label="title"
:href="terminalPath"
:class="{ disabled: disabled }"
class="btn terminal-button d-none d-md-block text-secondary"
2018-01-06 13:59:49 -05:00
>
<gl-icon name="terminal" />
2017-04-20 05:04:06 -04:00
</a>
</template>