add state bar
This commit is contained in:
parent
dbf6168907
commit
0ff6c3f68d
26
src/ui.js
26
src/ui.js
|
@ -22,6 +22,7 @@ class UI {
|
||||||
this.layoutUsers();
|
this.layoutUsers();
|
||||||
this.layoutChannels();
|
this.layoutChannels();
|
||||||
this.layoutCmd();
|
this.layoutCmd();
|
||||||
|
this.layoutState();
|
||||||
|
|
||||||
this.screen.key(["C-c"], function () {
|
this.screen.key(["C-c"], function () {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
|
@ -74,7 +75,7 @@ class UI {
|
||||||
label: "Logs",
|
label: "Logs",
|
||||||
padding: 1,
|
padding: 1,
|
||||||
width: "73%",
|
width: "73%",
|
||||||
height: "95%",
|
height: "92%",
|
||||||
left: "7%",
|
left: "7%",
|
||||||
top: "0%",
|
top: "0%",
|
||||||
border: {
|
border: {
|
||||||
|
@ -246,6 +247,29 @@ class UI {
|
||||||
this.screen.append(this.consoleBox);
|
this.screen.append(this.consoleBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
layoutState() {
|
||||||
|
this.consoleState = blessed.box({
|
||||||
|
label: '',
|
||||||
|
tags: true,
|
||||||
|
padding: 0,
|
||||||
|
width: '73%',
|
||||||
|
height: '5%',
|
||||||
|
left: '7%',
|
||||||
|
top: '92%',
|
||||||
|
border: {
|
||||||
|
type: 'line'
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
fg: 'black',
|
||||||
|
border: {
|
||||||
|
fg: this.color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.screen.append(this.consoleState);
|
||||||
|
}
|
||||||
|
|
||||||
submitCmd(cmd) {
|
submitCmd(cmd) {
|
||||||
if (cmd !== '') {
|
if (cmd !== '') {
|
||||||
this.events.emit('cmd', cmd);
|
this.events.emit('cmd', cmd);
|
||||||
|
|
Loading…
Reference in New Issue