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 > .screen-console
> .console-console > .console-console
> .console-loading { > .console-loading {
text-align: center; width: 100%;
font-size: 1em; height: 100%;
font-weight: lighter; padding: 0;
margin: 0;
display: flex;
flex-direction: row;
align-items: center;
} }
#home-content #home-content
@@ -218,6 +222,22 @@
> .screen-console > .screen-console
> .console-console > .console-console
> .console-loading > .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 { > .console-loading-icon {
background: url(./busy.svg) 50% no-repeat; background: url(./busy.svg) 50% no-repeat;
width: 100%; width: 100%;

View File

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

View File

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

View File

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