Skip to content

Commit

Permalink
display version
Browse files Browse the repository at this point in the history
  • Loading branch information
sui77 committed Sep 25, 2020
1 parent c05c29e commit 8271b17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions public_html/js/scann3r.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ var Scann3r = {
}
});

this.sio.on('info', (id, text) => {
$('.' + id).text(text);
});

this.sio.on('toast', (data) => {
let toast = {
heading: data.heading,
Expand Down
1 change: 1 addition & 0 deletions src/lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Config {
}
}


let file = JSON.parse(fs.readFileSync('./package.json').toString());
this.data.version = file.version;
}
Expand Down
3 changes: 2 additions & 1 deletion src/modules/WebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class WebSocket {
let options = this.config.get(slider);
socket.emit('initSlider', slider, options);
}

console.log( this.config.get('version') );
socket.emit('info', 'info-version', this.config.get('version'));
socket.emit('imgArea', this.config.get('crop.values'));
socket.emit('invert', this.config.get('rotor.invert'));
Expand Down Expand Up @@ -157,7 +159,6 @@ class WebSocket {
socket.on('abort', async () => {
console.log('ABORT');
this.registry.set('abort', true);
this.io.emit('info', 'currentAction', 'Aborting...');
});

socket.on('delete', async (id, cb) => {
Expand Down

0 comments on commit 8271b17

Please sign in to comment.