mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add images table
This commit is contained in:
parent
417821cb5a
commit
2ebcfe8642
6 changed files with 12 additions and 141 deletions
|
@ -309,6 +309,7 @@
|
||||||
existingServer.DateLastAccessed = new Date().getTime();
|
existingServer.DateLastAccessed = new Date().getTime();
|
||||||
existingServer.LastConnectionMode = ConnectionMode.Manual;
|
existingServer.LastConnectionMode = ConnectionMode.Manual;
|
||||||
existingServer.ManualAddress = apiClient.serverAddress();
|
existingServer.ManualAddress = apiClient.serverAddress();
|
||||||
|
existingServer.PreferredConnectionMode = ConnectionMode.Manual;
|
||||||
apiClient.serverInfo(existingServer);
|
apiClient.serverInfo(existingServer);
|
||||||
|
|
||||||
apiClient.onAuthenticated = function (instance, result) {
|
apiClient.onAuthenticated = function (instance, result) {
|
||||||
|
@ -997,6 +998,9 @@
|
||||||
if (server.LastConnectionMode != null) {
|
if (server.LastConnectionMode != null) {
|
||||||
//tests.push(server.LastConnectionMode);
|
//tests.push(server.LastConnectionMode);
|
||||||
}
|
}
|
||||||
|
if (server.PreferredConnectionMode != null) {
|
||||||
|
tests.push(server.PreferredConnectionMode);
|
||||||
|
}
|
||||||
if (tests.indexOf(ConnectionMode.Manual) == -1) { tests.push(ConnectionMode.Manual); }
|
if (tests.indexOf(ConnectionMode.Manual) == -1) { tests.push(ConnectionMode.Manual); }
|
||||||
if (tests.indexOf(ConnectionMode.Local) == -1) { tests.push(ConnectionMode.Local); }
|
if (tests.indexOf(ConnectionMode.Local) == -1) { tests.push(ConnectionMode.Local); }
|
||||||
if (tests.indexOf(ConnectionMode.Remote) == -1) { tests.push(ConnectionMode.Remote); }
|
if (tests.indexOf(ConnectionMode.Remote) == -1) { tests.push(ConnectionMode.Remote); }
|
||||||
|
|
|
@ -7,16 +7,8 @@
|
||||||
|
|
||||||
<p>${HeaderCameraUploadHelp}</p>
|
<p>${HeaderCameraUploadHelp}</p>
|
||||||
|
|
||||||
<p class="noDevices" style="display:none;color:red;">${MessageNoDevicesSupportCameraUpload}</p>
|
<form class="devicesUploadForm">
|
||||||
|
|
||||||
<br />
|
|
||||||
<form class="devicesUploadForm" style="display:none;">
|
|
||||||
|
|
||||||
<div class="devicesList">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<ul data-role="listview" class="ulForm">
|
<ul data-role="listview" class="ulForm">
|
||||||
<li>
|
<li>
|
||||||
<paper-input id="txtUploadPath" label="${LabelCameraUploadPath}" style="width:84%;display:inline-block;"></paper-input>
|
<paper-input id="txtUploadPath" label="${LabelCameraUploadPath}" style="width:84%;display:inline-block;"></paper-input>
|
||||||
|
|
|
@ -95,19 +95,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="detailSection viewStylesSection" style="display:none;">
|
|
||||||
<h1>
|
|
||||||
${HeaderViewStyles}
|
|
||||||
</h1>
|
|
||||||
<div class="detailSectionContent">
|
|
||||||
<p>${LabelSelectViewStyles}</p>
|
|
||||||
<div class="viewStylesList">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="fieldDescription paperCheckboxFieldDescription">${LabelSelectViewStylesHelp}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="detailSection">
|
<div class="detailSection">
|
||||||
<h1>
|
<h1>
|
||||||
${HeaderViewOrder}
|
${HeaderViewOrder}
|
||||||
|
|
|
@ -1,78 +1,18 @@
|
||||||
define(['jQuery'], function ($) {
|
define(['jQuery'], function ($) {
|
||||||
|
|
||||||
function load(page, devices, config) {
|
function load(page, config) {
|
||||||
|
|
||||||
if (devices.length) {
|
|
||||||
$('.noDevices', page).hide();
|
|
||||||
$('.devicesUploadForm', page).show();
|
|
||||||
} else {
|
|
||||||
$('.noDevices', page).show();
|
|
||||||
$('.devicesUploadForm', page).hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#txtUploadPath', page).val(config.CameraUploadPath || '');
|
$('#txtUploadPath', page).val(config.CameraUploadPath || '');
|
||||||
|
|
||||||
$('#chkSubfolder', page).checked(config.EnableCameraUploadSubfolders);
|
$('#chkSubfolder', page).checked(config.EnableCameraUploadSubfolders);
|
||||||
|
|
||||||
loadDeviceList(page, devices, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadDeviceList(page, devices, config) {
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
html += '<div class="paperListLabel">';
|
|
||||||
html += Globalize.translate('LabelEnableCameraUploadFor');
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '<div class="paperCheckboxList paperList">';
|
|
||||||
|
|
||||||
var index = 0;
|
|
||||||
html += devices.map(function (d) {
|
|
||||||
|
|
||||||
var deviceHtml = '';
|
|
||||||
|
|
||||||
var isChecked = config.EnabledCameraUploadDevices.indexOf(d.Id) != -1;
|
|
||||||
var checkedHtml = isChecked ? ' checked="checked"' : '';
|
|
||||||
|
|
||||||
var label = d.Name;
|
|
||||||
|
|
||||||
if (d.AppName) {
|
|
||||||
label += ' - ' + d.AppName;
|
|
||||||
}
|
|
||||||
|
|
||||||
deviceHtml += '<paper-checkbox class="chkDevice" data-id="' + d.Id + '"' + checkedHtml + '>' + label + '</paper-checkbox>';
|
|
||||||
|
|
||||||
index++;
|
|
||||||
|
|
||||||
return deviceHtml;
|
|
||||||
|
|
||||||
}).join('');
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '<div class="fieldDescription">';
|
|
||||||
html += Globalize.translate('LabelEnableCameraUploadForHelp');
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
$('.devicesList', page).html(html).trigger('create');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadData(page) {
|
function loadData(page) {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
var promise1 = ApiClient.getNamedConfiguration("devices");
|
ApiClient.getNamedConfiguration("devices").then(function (config) {
|
||||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Devices', {
|
load(page, config);
|
||||||
|
|
||||||
SupportsContentUploading: true
|
|
||||||
|
|
||||||
}));
|
|
||||||
|
|
||||||
Promise.all([promise1, promise2]).then(function (responses) {
|
|
||||||
|
|
||||||
|
|
||||||
load(page, responses[1].Items, responses[0]);
|
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
|
@ -84,16 +24,6 @@
|
||||||
|
|
||||||
config.CameraUploadPath = $('#txtUploadPath', page).val();
|
config.CameraUploadPath = $('#txtUploadPath', page).val();
|
||||||
|
|
||||||
config.EnabledCameraUploadDevices = $('.chkDevice', page).get().filter(function (c) {
|
|
||||||
|
|
||||||
return c.checked;
|
|
||||||
|
|
||||||
}).map(function (c) {
|
|
||||||
|
|
||||||
return c.getAttribute('data-id');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
config.EnableCameraUploadSubfolders = $('#chkSubfolder', page).checked();
|
config.EnableCameraUploadSubfolders = $('#chkSubfolder', page).checked();
|
||||||
|
|
||||||
ApiClient.updateNamedConfiguration("devices", config).then(Dashboard.processServerConfigurationUpdateResult);
|
ApiClient.updateNamedConfiguration("devices", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||||
|
|
|
@ -27,37 +27,6 @@
|
||||||
$('.folderGroupList', page).html(folderHtml);
|
$('.folderGroupList', page).html(folderHtml);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderViewStyles(page, user, result) {
|
|
||||||
|
|
||||||
var folderHtml = '';
|
|
||||||
|
|
||||||
folderHtml += '<div class="paperCheckboxList">';
|
|
||||||
folderHtml += result.map(function (i) {
|
|
||||||
|
|
||||||
var currentHtml = '';
|
|
||||||
|
|
||||||
var id = 'chkPlainFolder' + i.Id;
|
|
||||||
|
|
||||||
var isChecked = user.Configuration.PlainFolderViews.indexOf(i.Id) == -1;
|
|
||||||
var checkedHtml = isChecked ? ' checked="checked"' : '';
|
|
||||||
|
|
||||||
currentHtml += '<paper-checkbox class="chkPlainFolder" data-folderid="' + i.Id + '" id="' + id + '"' + checkedHtml + '>' + i.Name + '</paper-checkbox>';
|
|
||||||
|
|
||||||
return currentHtml;
|
|
||||||
|
|
||||||
}).join('');
|
|
||||||
|
|
||||||
folderHtml += '</div>';
|
|
||||||
|
|
||||||
$('.viewStylesList', page).html(folderHtml);
|
|
||||||
|
|
||||||
if (result.length) {
|
|
||||||
$('.viewStylesSection', page).show();
|
|
||||||
} else {
|
|
||||||
$('.viewStylesSection', page).hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderLatestItems(page, user, result) {
|
function renderLatestItems(page, user, result) {
|
||||||
|
|
||||||
var folderHtml = '';
|
var folderHtml = '';
|
||||||
|
@ -140,15 +109,13 @@
|
||||||
sortBy: "SortName"
|
sortBy: "SortName"
|
||||||
});
|
});
|
||||||
var promise2 = ApiClient.getUserViews({}, user.Id);
|
var promise2 = ApiClient.getUserViews({}, user.Id);
|
||||||
var promise3 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/SpecialViewOptions"));
|
var promise3 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/GroupingOptions"));
|
||||||
var promise4 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/GroupingOptions"));
|
|
||||||
|
|
||||||
Promise.all([promise1, promise2, promise3, promise4]).then(function (responses) {
|
Promise.all([promise1, promise2, promise3]).then(function (responses) {
|
||||||
|
|
||||||
renderViews(page, user, responses[3]);
|
renderViews(page, user, responses[2]);
|
||||||
renderLatestItems(page, user, responses[0]);
|
renderLatestItems(page, user, responses[0]);
|
||||||
renderViewOrder(page, user, responses[1]);
|
renderViewOrder(page, user, responses[1]);
|
||||||
renderViewStyles(page, user, responses[2]);
|
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
|
@ -188,15 +155,6 @@
|
||||||
return i.getAttribute('data-folderid');
|
return i.getAttribute('data-folderid');
|
||||||
});
|
});
|
||||||
|
|
||||||
user.Configuration.PlainFolderViews = $(".chkPlainFolder", page).get().filter(function (i) {
|
|
||||||
|
|
||||||
return !i.checked;
|
|
||||||
|
|
||||||
}).map(function (i) {
|
|
||||||
|
|
||||||
return i.getAttribute('data-folderid');
|
|
||||||
});
|
|
||||||
|
|
||||||
user.Configuration.OrderedViews = $(".viewItem", page).get().map(function (i) {
|
user.Configuration.OrderedViews = $(".viewItem", page).get().map(function (i) {
|
||||||
|
|
||||||
return i.getAttribute('data-viewid');
|
return i.getAttribute('data-viewid');
|
||||||
|
|
|
@ -1588,7 +1588,7 @@ var AppInfo = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
//localStorage.clear();
|
//localStorage.clear();
|
||||||
function createConnectionManager(credentialProviderFactory, capabilities) {
|
function createConnectionManager() {
|
||||||
|
|
||||||
return getSyncProfile().then(function (deviceProfile) {
|
return getSyncProfile().then(function (deviceProfile) {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue