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