aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/components/terminal.vue
blob: b27fce550fa135c20e0f5f8d73833de854517ee9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
  <div id="terminal">
    <div :class="{collapsed: !open}"></div>
  </div>
</template>

<script>
import { Terminal } from 'xterm'

export default {
  name: 'terminal',
  emits: ['new-message'],
  props: ['open', 'socket'],
  data() {
    return {
      _terminal: null
    }
  },
  mounted() {
    this.terminal = new Terminal({ disableStdin: true, rows: 12, cols: 104 })
    this.terminal.open(document.querySelector('#terminal > div'))
  }
}
</script>

<style>
#terminal {
	position: absolute;
	bottom: 0px;
	width: 100%;
	opacity: 0.85;
}
#terminal:hover {
	opacity: 0.98;
}

#terminal > .collapsed {
	overflow: hidden;
	height: 30px;
}
</style>