Device UI
This commit is contained in:
parent
0e618430ff
commit
30a070dca0
|
@ -260,6 +260,10 @@
|
|||
<option>Not Set</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="spacer">
|
||||
<input type="text" id="digital" name="digital" placeholder="Digital file" onclick="devices.digitalSelect();" readonly />
|
||||
<input type="radio" id="digital_type" name="digital_type" value="video" onclick="devices.digital();" />
|
||||
</div>
|
||||
<div>
|
||||
<h4>Camera</h4>
|
||||
<select id="camera_device">
|
||||
|
|
|
@ -5,7 +5,7 @@ const electron = require('electron');
|
|||
|
||||
const exec = require('exec');
|
||||
//const spawn = require('spawn');
|
||||
const exit = require('exit');
|
||||
//const exit = require('exit');
|
||||
|
||||
async function dependencies (platform) {
|
||||
let obj = {};
|
||||
|
@ -14,7 +14,8 @@ async function dependencies (platform) {
|
|||
await exec('ffmpeg -h');
|
||||
obj.ffmpeg = 'ffmpeg';
|
||||
} catch (err) {
|
||||
return exit('ffmpeg is not installed', 3);
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
}
|
||||
//if linux
|
||||
if (platform === 'nix') {
|
||||
|
@ -22,7 +23,8 @@ async function dependencies (platform) {
|
|||
await exec('eog -h');
|
||||
obj.eog = 'eog';
|
||||
} catch (err) {
|
||||
return exit('eog is not installed', 4);
|
||||
//return exit('eog is not installed', 4);
|
||||
return console.error('eog is not installed', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,22 +82,56 @@ devices.ready = function (event, arg) {
|
|||
|
||||
devices.intval = function () {
|
||||
'use strict';
|
||||
const url = $('#intval').val()
|
||||
let proceed = false
|
||||
const url = $('#intval').val();
|
||||
let proceed = false;
|
||||
let obj = {
|
||||
connect: true,
|
||||
url : url
|
||||
}
|
||||
};
|
||||
if ( url !== '' && typeof url !== 'undefined') {
|
||||
proceed = confirm(`Are you sure you want to connect to INTVAL3 @ ${url}?`)
|
||||
proceed = confirm(`Are you sure you want to connect to INTVAL3 @ ${url}?`);
|
||||
} else {
|
||||
alert('Cannot connect to INTVAL3 url as entered.')
|
||||
alert('Cannot connect to INTVAL3 url as entered.');
|
||||
}
|
||||
|
||||
if (proceed) {
|
||||
gui.overlay(true);
|
||||
gui.spinner(true, `Connecting to INTVAL3 @ ${url}`);
|
||||
ipcRenderer.send('intval', obj)
|
||||
ipcRenderer.send('intval', obj);
|
||||
} else {
|
||||
$('#camera_type_arduino').prop('checked', 'checked');
|
||||
$('#intval').removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
devices.digitalSelect = function () {
|
||||
const elem = $('#digital');
|
||||
dialog.showOpenDialog({
|
||||
properties: [
|
||||
'openFile',
|
||||
'openDirectory'
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
devices.digital = function () {
|
||||
'use strict';
|
||||
const elem = $('#digital');
|
||||
let proceed = false;
|
||||
let obj = {
|
||||
connect: true,
|
||||
url : url
|
||||
};
|
||||
if ( url !== '' && typeof url !== 'undefined') {
|
||||
proceed = confirm(`Are you sure you want to`);
|
||||
} else {
|
||||
alert('Cannot connect')
|
||||
}
|
||||
|
||||
if (proceed) {
|
||||
//gui.overlay(true);
|
||||
//gui.spinner(true, `Connecting to`);
|
||||
ipcRenderer.send('video', obj)
|
||||
} else {
|
||||
$('#camera_type_arduino').prop('checked', 'checked');
|
||||
$('#intval').removeClass('active');
|
||||
|
|
|
@ -18,7 +18,7 @@ const ee = new events.EventEmitter()
|
|||
//const digital = require('./lib/digital')
|
||||
//const capture = require('./lib/capture')(ee)
|
||||
const settings = require('settings')
|
||||
|
||||
const system = require('system')
|
||||
const Server = require('server')
|
||||
const Intval = require('intval')
|
||||
|
||||
|
|
Loading…
Reference in New Issue