diff --git a/instance/views/settings.ejs b/instance/views/settings.ejs index a6695c5f1195fe20515e2498c0892b9eb4e3da7a..226735c508bb1f7400b716f2317eb6640f942d6b 100644 --- a/instance/views/settings.ejs +++ b/instance/views/settings.ejs @@ -13,74 +13,41 @@ <form> <h3>Running processes</h3> <p>Here is a list of related processes that may run. The box is checked when the process is running.</p> - <%- include('settingsCheckBox.ejs', {id: 'running-lektord', name: 'Lektord', disable: true}); %> - <%- include('settingsCheckBox.ejs', {id: 'running-klkt', name: 'Klkt', disable: true}); %> + <%- include('settings/checkBox.ejs', {id: 'running-lektord', name: 'Lektord', disable: true}); %> + <%- include('settings/checkBox.ejs', {id: 'running-klkt', name: 'Klkt', disable: true}); %> <hr /> <h3>Lektord settings</h3> <p>Configure which lektord to use or if 'attach' mode is enabled.</p> - <%- include('settingsInput.ejs', {id: 'inputHost', name: 'Host', type: 'text'}); %> - <%- include('settingsInput.ejs', {id: 'inputPort', name: 'Port', type: 'int'}); %> - <%- include('settingsCheckBox.ejs', {id: 'inputAttachMode', name: 'Attach mode', label: 'Enable attach mode'}); %> + <%- include('settings/input.ejs', {id: 'inputHost', name: 'Host', type: 'text'}); %> + <%- include('settings/input.ejs', {id: 'inputPort', name: 'Port', type: 'int'}); %> + <%- include('settings/checkBox.ejs', {id: 'inputAttachMode', name: 'Attach mode', label: 'Enable attach mode'}); %> <hr /> <h3>Client interface settings</h3> <p>Express server settings for the client interface.</p> - <%- include('settingsInput.ejs', {id: 'inputClientPort', name: 'Port', type: 'int'}); %> + <%- include('settings/input.ejs', {id: 'inputClientPort', name: 'Port', type: 'int'}); %> <hr /> <h3>Database settings</h3> <p>Which database to use, and other options.</p> - <%- include('settingsInput.ejs', {id: 'inputDbPath', name: 'Database', type: 'text'}); %> + <%- include('settings/input.ejs', {id: 'inputDbPath', name: 'Database', type: 'text'}); %> <hr /> <h3>Kurisu settings</h3> <p>Where to find Kurisu.</p> - <%- include('settingsInput.ejs', {id: 'inputKurisuUrl', name: 'URL', type: 'text'}); %> + <%- include('settings/input.ejs', {id: 'inputKurisuUrl', name: 'URL', type: 'text'}); %> <hr /> <h3>Log settings</h3> <p>Log options, this is a developper section.</p> - <fieldset class="form-group"> - <div class="row"> - <legend class="col-form-label col-sm-2 pt-0">Log level</legend> - <div class="col-sm-10" id="inputLogLevel"> - <div class="form-check"> - <input class="form-check-input" type="radio" name="gridRadios" id="logERROR" value="ERROR" checked /> - <label class="form-check-label" for="logERROR">Error</label> - </div> - <div class="form-check"> - <input - class="form-check-input" - type="radio" - name="gridRadios" - id="logWARNING" - value="WARNING" - /> - <label class="form-check-label" for="logWARNING">Warning</label> - </div> - <div class="form-check"> - <input class="form-check-input" type="radio" name="gridRadios" id="logINFO" value="INFO" /> - <label class="form-check-label" for="logINFO">Info</label> - </div> - <div class="form-check"> - <input class="form-check-input" type="radio" name="gridRadios" id="logDEBUG" value="DEBUG" /> - <label class="form-check-label" for="logDEBUG">Debug</label> - </div> - </div> - </div> - </fieldset> - <div class="form-group row"> - <div class="col-sm-2">Lektord logs</div> - <div class="col-sm-10"> - <div class="form-check"> - <input class="form-check-input" type="checkbox" id="inputLogLektord" /> - <label class="form-check-label" for="inputLogLektord"> - Enable lektord logs when possible - </label> - </div> - </div> - </div> + <%- include('settings/radioButtons.ejs', {id: 'inputLogLevel', name: 'Log level', buttons: [ + {name: 'Error', value: 'ERROR', id: 'logERROR', checked: true}, + {name: 'Warning', value: 'WARNING', id: 'logWARNING'}, + {name: 'Info', value: 'INFO', id: 'logINFO'}, + {name: 'Debug', value: 'DEBUG', id: 'logDEBUG'} + ]}); %> + <%- include('settings/checkBox.ejs', {id: 'inputLogLektord', name: 'Lektord logs', label: 'Enable lektord logs when possible'}); %> </form> </div> <div class="modal-footer"> For changes to be applied you need to restart Amadeus. </div> diff --git a/instance/views/settingsCheckBox.ejs b/instance/views/settings/checkBox.ejs similarity index 100% rename from instance/views/settingsCheckBox.ejs rename to instance/views/settings/checkBox.ejs diff --git a/instance/views/settingsInput.ejs b/instance/views/settings/input.ejs similarity index 100% rename from instance/views/settingsInput.ejs rename to instance/views/settings/input.ejs diff --git a/instance/views/settings/radioButtons.ejs b/instance/views/settings/radioButtons.ejs new file mode 100644 index 0000000000000000000000000000000000000000..1dbab580594d402202eb000a60cf6f8c9c3821a0 --- /dev/null +++ b/instance/views/settings/radioButtons.ejs @@ -0,0 +1,15 @@ +<%# vim: ts=4 syntax=html + The template for radio settings %> +<fieldset class="form-group"> + <div class="row"> + <legend class="col-form-label col-sm-2 pt-0"><%= name %></legend> + <div class="col-sm-10" id="<%= id %>"> + <% buttons.forEach(function(btn) { %> + <div class="form-check"> + <input class="form-check-input" type="radio" name="gridRadios" id="<%= btn.id %>" value="<%= btn.value %>" <% if (typeof btn.checked != 'undefined' && btn.checked) { %> checked <% } %> /> + <label class="form-check-label" for="<%= btn.id %>"><%= btn.name %></label> + </div> + <% }); %> + </div> + </div> +</fieldset> diff --git a/main.js b/main.js index 0008f92a0d11f1df75574f246c306ba4c024fa4e..332e62283b00c17a98fda73749c1750f44404290 100644 --- a/main.js +++ b/main.js @@ -78,7 +78,7 @@ function createInstanceWindow() { win = new BrowserWindow({ width: 1280, height: 720, - minWidth: 1200, + minWidth: 1000, minHeight: 360, hasShadow: false, frame: false,