Improve server selectize on setup wizard

This commit is contained in:
JonnyWong16 2018-02-12 17:33:35 -08:00
parent dc743ac378
commit 030f9d334b
3 changed files with 37 additions and 10 deletions

View file

@ -86,6 +86,9 @@ select.form-control {
margin-bottom: 4px; margin-bottom: 4px;
padding-left: 5px; padding-left: 5px;
} }
.selectize-control.form-control.wizard-pms-ip .selectize-input {
padding: 6px 12px !important;
}
.react-selectize.root-node .react-selectize-control .react-selectize-placeholder { .react-selectize.root-node .react-selectize-control .react-selectize-placeholder {
color: #fff !important; color: #fff !important;
} }

View file

@ -91,13 +91,13 @@
<div class="wizard-input-section"> <div class="wizard-input-section">
<label for="pms_ip">Plex IP or Hostname</label> <label for="pms_ip">Plex IP or Hostname</label>
<div class="row"> <div class="row">
<div class="col-xs-8"> <div class="col-xs-12">
<select id="pms_ip" name="pms_ip"></select> <select class="form-control wizard-pms-ip" id="pms_ip" name="pms_ip"></select>
</div> </div>
</div> </div>
</div> </div>
<div class="wizard-input-section"> <div class="wizard-input-section">
<label for="pms_port">Port Number</label> <label for="pms_port">Plex Port</label>
<div class="row"> <div class="row">
<div class="col-xs-3"> <div class="col-xs-3">
<input type="text" class="form-control pms_settings" name="pms_port" id="pms_port" placeholder="32400" value="${config['pms_port']}" required> <input type="text" class="form-control pms_settings" name="pms_port" id="pms_port" placeholder="32400" value="${config['pms_port']}" required>
@ -244,20 +244,41 @@
}, },
render: { render: {
option: function (item, escape) {
return '<div data-use_ssl="' + item.httpsRequired + '" data-local="' + item.local + '" data-ci="' + item.clientIdentifier + '" data-ip="' + item.ip + '" data-port="' + item.port + '" data-label="' + item.label + '">' + item.value + ' (' + item.label + ')</div>';
},
item: function (item, escape) { item: function (item, escape) {
// first item is rendered before initialization bug? // first item is rendered before initialization bug?
if (!item.ci) { if (!item.ci) {
$.extend(item, $.extend(item, $(this.revertSettings.$children)
$(this.revertSettings.$children)
.filter('[value="' + item.value + '"]').data()); .filter('[value="' + item.value + '"]').data());
} }
return '<div data-use_ssl="' + item.httpsRequired + '" data-local="' + item.local + '" data-ci="' + item.clientIdentifier + '" data-ip="' + item.ip + '" data-port="' + item.port + '" data-label="' + item.label + '">' + item.value + ' (' + item.label + ')</div>'; var label = item.label || item.value;
var caption = item.label ? item.value : null;
return '<div data-use_ssl="' + item.httpsRequired +
'" data-local="' + item.local +
'" data-ci="' + item.clientIdentifier +
'" data-ip="' + item.ip +
'" data-port="' + item.port +
'" data-label="' + item.label + '">' +
'<span class="item-text">' + escape(label) + '</span>' +
(caption ? '<span class="item-value">' + escape(caption) + '</span>' : '') +
'</div>';
},
option: function (item, escape) {
var label = item.label || item.value;
var caption = item.label ? item.value : null;
return '<div data-use_ssl="' + item.httpsRequired +
'" data-local="' + item.local +
'" data-ci="' + item.clientIdentifier +
'" data-ip="' + item.ip +
'" data-port="' + item.port +
'" data-label="' + item.label + '">' +
escape(label) +
(caption ? '<span class="caption">' + escape(caption) + '</span>' : '') +
'</div>';
} }
}, },
create: function(input) {
return {label: '', value: input};
},
onChange: function (item) { onChange: function (item) {
var ci = $('.selectize-input').find('div').attr('data-ci'); var ci = $('.selectize-input').find('div').attr('data-ci');
var port = $('.selectize-input').find('div').attr('data-port') var port = $('.selectize-input').find('div').attr('data-port')

View file

@ -826,6 +826,9 @@ class DataFactory(object):
if session.get_session_shared_libraries(): if session.get_session_shared_libraries():
library_cards = session.get_session_shared_libraries() library_cards = session.get_session_shared_libraries()
if 'first_run_wizard' in library_cards:
return None
library_stats = [] library_stats = []
try: try: