mirror of https://github.com/Requarks/wiki.git
11 changed files with 238 additions and 83 deletions
Split View
Diff Options
-
83client/components/admin/admin-logging-console.vue
-
19client/components/admin/admin-logging.vue
-
22client/components/common/nav-footer.vue
-
54client/components/common/nav-header.vue
-
33client/components/editor.vue
-
98client/components/editor/editor-code.vue
-
2client/components/login.vue
-
1client/scss/app.scss
-
3package.json
-
2server/modules/authentication/cas/definition.yml
-
4yarn.lock
@ -0,0 +1,83 @@ |
|||
<template lang='pug'> |
|||
v-dialog(v-model='isShown', width='90vw', max-width='1200') |
|||
.dialog-header |
|||
span Live Console |
|||
v-spacer |
|||
.caption.blue--text.text--lighten-3.mr-3 Streaming... |
|||
v-progress-circular( |
|||
indeterminate |
|||
color='blue lighten-3' |
|||
:size='20' |
|||
:width='2' |
|||
) |
|||
.consoleTerm(ref='consoleContainer') |
|||
v-toolbar(flat, color='grey darken-3', dark) |
|||
v-spacer |
|||
v-btn(outline, @click='clear') |
|||
v-icon(left) cancel_presentation |
|||
span Clear |
|||
v-btn(outline, @click='close') |
|||
v-icon(left) close |
|||
span Close |
|||
</template> |
|||
|
|||
<script> |
|||
import _ from 'lodash' |
|||
import { Terminal } from 'xterm' |
|||
import * as fit from 'xterm/lib/addons/fit/fit' |
|||
|
|||
Terminal.applyAddon(fit) |
|||
|
|||
export default { |
|||
term: null, |
|||
props: { |
|||
value: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}, |
|||
computed: { |
|||
isShown: { |
|||
get() { return this.value }, |
|||
set(val) { this.$emit('input', val) } |
|||
} |
|||
}, |
|||
watch: { |
|||
value(newValue, oldValue) { |
|||
if (newValue) { |
|||
_.delay(() => { |
|||
this.term = new Terminal() |
|||
this.term.open(this.$refs.consoleContainer) |
|||
this.term.writeln('Connecting to \x1B[1;3;31mconsole output\x1B[0m...') |
|||
}, 100) |
|||
} else { |
|||
this.term.dispose() |
|||
this.term = null |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.term = new Terminal() |
|||
this.term.open(this.$refs.consoleContainer) |
|||
}, |
|||
methods: { |
|||
clear() { |
|||
this.term.clear() |
|||
}, |
|||
close() { |
|||
this.isShown = false |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang='scss'> |
|||
|
|||
.consoleTerm { |
|||
background-color: #000; |
|||
padding: 16px; |
|||
width: 100%; |
|||
height: 415px; |
|||
} |
|||
|
|||
</style> |
Write
Preview
Loading…
Cancel
Save