mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Store the console output in a buffer for easier display
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
name: 'ServerConsole',
|
||||
mixins: [Socketio],
|
||||
computed: {
|
||||
...mapState('socket', ['connected']),
|
||||
...mapState('socket', ['connected', 'outputBuffer']),
|
||||
},
|
||||
|
||||
watch: {
|
||||
@@ -65,7 +65,7 @@
|
||||
*/
|
||||
sockets: {
|
||||
'console output': function (line: string) {
|
||||
this.terminal && this.terminal.writeln(line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m');
|
||||
this.writeLineToConsole(line);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -101,6 +101,8 @@
|
||||
// @ts-ignore
|
||||
this.terminal.fit();
|
||||
this.terminal.clear();
|
||||
|
||||
this.outputBuffer.forEach(this.writeLineToConsole);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -113,6 +115,10 @@
|
||||
this.command = '';
|
||||
},
|
||||
|
||||
writeLineToConsole: function (line: string) {
|
||||
this.terminal && this.terminal.writeln(line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m');
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a user pressing up/down arrows when in the command field to scroll through thier
|
||||
* command history for this server.
|
||||
|
||||
Reference in New Issue
Block a user