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.
|
|
|
|
*/
|
2019-02-13 22:33:31 +05:30
|
|
|
import { GlTooltipDirective } from '@gitlab/ui';
|
2018-11-18 11:00:15 +05:30
|
|
|
import Icon from '~/vue_shared/components/icon.vue';
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Icon,
|
|
|
|
},
|
|
|
|
directives: {
|
2019-02-13 22:33:31 +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-13 22:33:31 +05:30
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
2018-11-18 11:00:15 +05:30
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
title() {
|
|
|
|
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-13 22:33:31 +05:30
|
|
|
v-gl-tooltip
|
2017-08-17 22:00:37 +05:30
|
|
|
:title="title"
|
|
|
|
:aria-label="title"
|
|
|
|
:href="terminalPath"
|
2019-02-13 22:33:31 +05:30
|
|
|
:class="{ disabled: disabled }"
|
2018-11-08 19:23:39 +05:30
|
|
|
class="btn terminal-button d-none d-sm-none d-md-block"
|
2018-03-17 18:26:18 +05:30
|
|
|
>
|
2018-11-18 11:00:15 +05:30
|
|
|
<icon name="terminal" />
|
2017-08-17 22:00:37 +05:30
|
|
|
</a>
|
|
|
|
</template>
|