Fixed screen switching

This commit is contained in:
NI
2020-07-29 16:02:06 +08:00
parent 21fd0de2da
commit 1c018ce560
4 changed files with 39 additions and 12 deletions

View File

@@ -207,9 +207,13 @@
> .screen-console
> .console-console
> .console-loading {
text-align: center;
font-size: 1em;
font-weight: lighter;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
align-items: center;
}
#home-content
@@ -218,6 +222,22 @@
> .screen-console
> .console-console
> .console-loading
> .console-loading-frame {
text-align: center;
font-size: 1em;
font-weight: lighter;
padding: 20px;
margin: 10px auto;
flex: auto;
}
#home-content
> .screen
> .screen-screen
> .screen-console
> .console-console
> .console-loading
> .console-loading-frame
> .console-loading-icon {
background: url(./busy.svg) 50% no-repeat;
width: 100%;

View File

@@ -26,12 +26,14 @@
<h2 style="display: none;">Console</h2>
<div class="console-loading">
<div class="console-loading-frame">
<div class="console-loading-icon"></div>
<div class="console-loading-message">
Initializing console ...
</div>
</div>
</div>
</div>
<!--
Tell you this: the background transparent below is probably the most
@@ -457,8 +459,8 @@ export default {
};
},
watch: {
active() {
this.triggerActive();
active(newVal, oldVal) {
this.triggerActive(newVal);
},
change: {
handler() {
@@ -553,8 +555,8 @@ export default {
callbacks.warn(termTypeFaceLoadError, true);
});
},
triggerActive() {
this.active ? this.activate() : this.deactivate();
triggerActive(active) {
active ? this.activate() : this.deactivate();
},
async init() {
let self = this;
@@ -594,7 +596,7 @@ export default {
return;
}
self.triggerActive();
self.triggerActive(this.active);
self.runRunner();
},
async deinit() {
@@ -614,6 +616,7 @@ export default {
},
activate() {
this.term.focus();
this.fit();
},
async deactivate() {
this.term.blur();

View File

@@ -32,6 +32,10 @@
flex: auto;
}
#home-content > .screen.screen-inactive {
flex: 0 0 0;
}
#home-content > .screen > .screen-error {
display: block;
padding: 10px;

View File

@@ -24,7 +24,7 @@
<div
v-for="(screenInfo, idx) in screens"
:key="screenInfo.id"
:style="'visibility: ' + (screen === idx ? 'visible' : 'hidden')"
:class="{ 'screen-inactive': screen !== idx }"
class="screen"
>
<h1 style="display: none;">Main Interface</h1>