Styling and debug view

This commit is contained in:
Jiiks 2019-03-08 13:57:02 +02:00
parent f6a3fb65da
commit d95592acc9
6 changed files with 97 additions and 4 deletions

View File

@ -35,6 +35,7 @@ export default new class extends Module {
this.reloadNotif = this.reloadNotif.bind(this);
this.startUpdate = this.startUpdate.bind(this);
this.setUpdateStatus = this.setUpdateStatus.bind(this);
this.testUi = this.testUi.bind(this);
}
restartNotif() {
@ -91,6 +92,7 @@ export default new class extends Module {
});
ipc.on('updater-updatesAvailable', (_, updates) => {
console.log(updates);
if (this.state.updating) return; // If for some reason we get more updates when we're already updating
updates.bd = updates.bd.map(update => {
update.text = `${update.id.charAt(0).toUpperCase()}${update.id.slice(1)}`;
@ -178,4 +180,11 @@ export default new class extends Module {
this.send('updater-startUpdate', updates);
}
testUi(updates) {
this.setState({
updates,
updatesAvailable: true
});
}
}

View File

@ -0,0 +1,9 @@
.bd-contentColumn .bd-devview {
display: grid;
grid-template-columns: 33% 33% 33%;
.bd-button {
font-size: 10px;
height: 20px;
}
}

View File

@ -10,3 +10,4 @@
@import './kvp';
@import './collection';
@import './e2ee';
@import './devview';

View File

@ -3,4 +3,22 @@
margin: 0 0 10px;
color: #fff;
}
.bd-settingSwitch {
.bd-spinner7 {
height: 24px;
}
.bd-updaterStatus {
text-align: right;
&.bd-err {
color: $colerr;
}
&.bd-ok {
color: $colok;
}
}
}
}

View File

@ -22,7 +22,7 @@
import SettingsWrapper from './SettingsWrapper.vue';
import { FormButton } from '../common';
import { Globals, Events } from 'modules';
import { Globals, Events, Updater } from 'modules';
import { ClientIPC } from 'common';
export default {
@ -42,7 +42,63 @@
console.log(Globals);
},
testUpdateUi() {
Events.emit('update-check-start');
Updater.testUi({
'bd': [
{
'id': 'update',
'version': '3.0.0',
'currentVersion': '2.0.0',
'text': 'Update test',
'hint': 'Current: 2.0.0 | Latest: 3.0.0',
'status': {
'update': true,
'updating': false,
'updated': false,
'error': null
}
},
{
'id': 'updating',
'version': '3.0.0',
'currentVersion': '2.0.0',
'text': 'Updating test',
'hint': 'Current: 2.0.0 | Latest: 3.0.0',
'status': {
'update': true,
'updating': true,
'updated': false,
'error': null
}
},
{
'id': 'updated',
'version': '3.0.0',
'currentVersion': '2.0.0',
'text': 'Updated test',
'hint': 'Current: 2.0.0 | Latest: 3.0.0',
'status': {
'update': true,
'updating': true,
'updated': true,
'error': null
}
},
{
'id': 'error',
'version': '3.0.0',
'currentVersion': '2.0.0',
'text': 'Error test',
'hint': 'Current: 2.0.0 | Latest: 3.0.0',
'status': {
'update': true,
'updating': true,
'updated': false,
'error': 'Failed to update.'
}
}
],
'haveUpdates': true
});
}
}
}

View File

@ -12,8 +12,8 @@
<div class="bd-settingSwitch">
<div class="bd-title">
<h3>{{item.text}}</h3>
<h3 class="bd-updaterStatus" v-if="item.status.error">Update Failed!</h3>
<h3 class="bd-updaterStatus" v-else-if="item.status.updated">Done</h3>
<h3 class="bd-updaterStatus bd-err" v-if="item.status.error">Update Failed!</h3>
<h3 class="bd-updaterStatus bd-ok" v-else-if="item.status.updated">Done</h3>
<div class="bd-spinner7" v-else-if="item.status.updating" />
<h3 class="bd-updaterStatus" v-else>Unknown</h3>
</div>