diff --git a/plugins/eos/main.js b/plugins/eos/main.js index 57e01fb..f16b406 100644 --- a/plugins/eos/main.js +++ b/plugins/eos/main.js @@ -18,6 +18,19 @@ exports.config = { return msg.toString().includes('/eos/out'); }, }, + fields: [ + { + key: 'cueListFilter', + label: 'Q List', + type: 'numberinput', + value: '', + action(_device) { + const device = _device; + device.data.cueListFilter = device.fields.cueListFilter; + device.draw(); + }, + }, + ], }; exports.ready = function ready(_device) { @@ -26,6 +39,8 @@ exports.ready = function ready(_device) { device.templates = { cue: _.template(fs.readFileSync(path.join(__dirname, `cue.ejs`))), }; + device.data.cueListFilter = device.fields.cueListFilter; + device.send('/eos/get/cuelist/count'); device.send('/eos/get/version'); device.send('/eos/subscribe', [{ type: 'i', value: 1 }]); diff --git a/plugins/eos/template.ejs b/plugins/eos/template.ejs index 751cce9..ab6873e 100644 --- a/plugins/eos/template.ejs +++ b/plugins/eos/template.ejs @@ -1,9 +1,10 @@

<%= listName %>

-

Eos <%= data.version %>

+

Eos <%= data.EOS.version %>

<% for(var i in data.EOS.cueLists){ %> + <% if(data.cueListFilter == i || data.cueListFilter.length==0){ %>
List <%= i %>
@@ -38,5 +39,6 @@ <% } %>
+ <% } %> <% } %> diff --git a/src/view.js b/src/view.js index 003bfc0..d04d993 100644 --- a/src/view.js +++ b/src/view.js @@ -253,6 +253,14 @@ function updateFields() { const rowHTML = `${field.label}:`; document.getElementById('device-settings-fields').insertAdjacentHTML('beforeend', rowHTML); document.getElementById(field.key).appendChild($elem); + } else if (field.type === 'numberinput') { + $elem.type = 'number'; + $elem.min = 1; + $elem.max = 99; + $elem.step = 1; + const rowHTML = `${field.label}:`; + document.getElementById('device-settings-fields').insertAdjacentHTML('beforeend', rowHTML); + document.getElementById(field.key).appendChild($elem); } }); }