mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
revise endpoint attributes
This commit is contained in:
parent
1d9dc3acfd
commit
b06fdda96d
13 changed files with 91 additions and 111 deletions
|
@ -12,7 +12,7 @@
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="#" data-role="button" class="ui-btn-active">${TabDevices}</a>
|
<a href="#" data-role="button" class="ui-btn-active">${TabDevices}</a>
|
||||||
<a href="devicesupload.html" data-role="button">${TabCameraUpload}</a>
|
<a href="devicesupload.html" data-role="button">${TabCameraUpload}</a>
|
||||||
<a href="dashboardsync.html" data-role="button">${TabSync}</a>
|
<!--<a href="dashboardsync.html" data-role="button">${TabSync}</a>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="readOnlyContent">
|
<div class="readOnlyContent">
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="devices.html" data-role="button">${TabDevices}</a>
|
<a href="devices.html" data-role="button">${TabDevices}</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">${TabCameraUpload}</a>
|
<a href="#" data-role="button" class="ui-btn-active">${TabCameraUpload}</a>
|
||||||
<a href="dashboardsync.html" data-role="button">${TabSync}</a>
|
<!--<a href="dashboardsync.html" data-role="button">${TabSync}</a>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="readOnlyContent">
|
<div class="readOnlyContent">
|
||||||
|
|
|
@ -18,32 +18,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBaseRemoteOptions() {
|
function getBaseRemoteOptions() {
|
||||||
|
|
||||||
var options = {};
|
var options = {};
|
||||||
|
|
||||||
if (currentItem.Type == "Year") {
|
options.itemId = currentItem.Id;
|
||||||
options.year = currentItem.Name;
|
|
||||||
}
|
|
||||||
else if (currentItem.Type == "MusicArtist") {
|
|
||||||
options.artist = currentItem.Name;
|
|
||||||
}
|
|
||||||
else if (currentItem.Type == "Person") {
|
|
||||||
options.person = currentItem.Name;
|
|
||||||
}
|
|
||||||
else if (currentItem.Type == "Genre") {
|
|
||||||
options.genre = currentItem.Name;
|
|
||||||
}
|
|
||||||
else if (currentItem.Type == "GameGenre") {
|
|
||||||
options.gameGenre = currentItem.Name;
|
|
||||||
}
|
|
||||||
else if (currentItem.Type == "MusicGenre") {
|
|
||||||
options.musicGenre = currentItem.Name;
|
|
||||||
}
|
|
||||||
else if (currentItem.Type == "Studio") {
|
|
||||||
options.studio = currentItem.Name;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
options.itemId = currentItem.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
msg += "<br/>";
|
msg += "<br/>";
|
||||||
msg += result.PinFile;
|
msg += result.PinFile;
|
||||||
msg += "<br/>";
|
msg += "<br/>";
|
||||||
msg += "<br/>";
|
|
||||||
msg += Globalize.translate('MessageForgotPasswordFileExpiration', parseISO8601Date(result.PinExpirationDate, { toLocal: true }).toLocaleString());
|
|
||||||
|
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
ApiClient.getJSON(ApiClient.getUrl('System/Logs')).done(function (logs) {
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
|
apiClient.getJSON(apiClient.getUrl('System/Logs')).done(function (logs) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
|
@ -12,9 +14,12 @@
|
||||||
|
|
||||||
html += logs.map(function (log) {
|
html += logs.map(function (log) {
|
||||||
|
|
||||||
var logUrl = ApiClient.getUrl('System/Logs/Log', {
|
var logUrl = apiClient.getUrl('System/Logs/Log', {
|
||||||
name: log.Name
|
name: log.Name
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logUrl += "&api_key=" + apiClient.accessToken();
|
||||||
|
|
||||||
var logHtml = '<li><a href="' + logUrl + '" target="_blank">';
|
var logHtml = '<li><a href="' + logUrl + '" target="_blank">';
|
||||||
|
|
||||||
logHtml += '<h3>';
|
logHtml += '<h3>';
|
||||||
|
|
|
@ -345,9 +345,11 @@ var WizardLibraryPage = {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
ApiClient.ajax({
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
|
apiClient.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ApiClient.getUrl('System/Configuration/MetadataPlugins/Autoset')
|
url: apiClient.getUrl('System/Configuration/MetadataPlugins/Autoset')
|
||||||
|
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
|
|
||||||
|
@ -440,14 +442,16 @@ var WizardLibraryPage = {
|
||||||
|
|
||||||
pollTasks(page);
|
pollTasks(page);
|
||||||
|
|
||||||
if (ApiClient.isWebSocketOpen()) {
|
var apiClient = ApiClient;
|
||||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
|
||||||
|
if (apiClient.isWebSocketOpen()) {
|
||||||
|
apiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
||||||
}
|
}
|
||||||
|
|
||||||
$(ApiClient).on("websocketmessage", onWebSocketMessage).on('websocketopen', function () {
|
$(apiClient).on("websocketmessage", onWebSocketMessage).on('websocketopen', function () {
|
||||||
|
|
||||||
if (ApiClient.isWebSocketOpen()) {
|
if (apiClient.isWebSocketOpen()) {
|
||||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
apiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -455,11 +459,13 @@ var WizardLibraryPage = {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
if (ApiClient.isWebSocketOpen()) {
|
var apiClient = ApiClient;
|
||||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
|
|
||||||
|
if (apiClient.isWebSocketOpen()) {
|
||||||
|
apiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
$(ApiClient).off("websocketmessage", onWebSocketMessage);
|
$(apiClient).off("websocketmessage", onWebSocketMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, window);
|
})(jQuery, document, window);
|
||||||
|
|
|
@ -1120,7 +1120,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Live streams seem to function better with mp4
|
// Live streams seem to function better with mp4
|
||||||
var mp4BeforeWebm = self.getVideoTranscodingExtension() != '.webm' || !mediaSource.RunTimeTicks;
|
var mp4BeforeWebm = self.getVideoTranscodingExtension() != '.webm';
|
||||||
|
|
||||||
if (mp4BeforeWebm) {
|
if (mp4BeforeWebm) {
|
||||||
html += '<source type="video/mp4" src="' + mp4VideoUrl + '" />';
|
html += '<source type="video/mp4" src="' + mp4VideoUrl + '" />';
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
cache: false
|
cache: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// TODO: Deprecated in 1.9
|
// TODO: Deprecated in 1.9
|
||||||
|
@ -21,6 +20,7 @@ $.support.cors = true;
|
||||||
$(document).one('click', WebNotifications.requestPermission);
|
$(document).one('click', WebNotifications.requestPermission);
|
||||||
|
|
||||||
var Dashboard = {
|
var Dashboard = {
|
||||||
|
|
||||||
jQueryMobileInit: function () {
|
jQueryMobileInit: function () {
|
||||||
|
|
||||||
// Page
|
// Page
|
||||||
|
|
|
@ -110,6 +110,7 @@
|
||||||
|
|
||||||
function isAvailable(item, user) {
|
function isAvailable(item, user) {
|
||||||
|
|
||||||
|
return false;
|
||||||
return item.SupportsSync;
|
return item.SupportsSync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
onFinish: function () {
|
onFinish: function () {
|
||||||
|
|
||||||
ApiClient.getServerConfiguration().done(function (config) {
|
ApiClient.ajax({
|
||||||
|
|
||||||
config.IsStartupWizardCompleted = true;
|
url: ApiClient.getUrl('Startup/Complete'),
|
||||||
|
type: 'POST'
|
||||||
|
|
||||||
ApiClient.updateServerConfiguration(config).done(function () {
|
}).done(function () {
|
||||||
|
|
||||||
Dashboard.navigate('dashboard.html');
|
Dashboard.navigate('dashboard.html');
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -4,16 +4,23 @@
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
// After saving chapter task, now save server config
|
// After saving chapter task, now save server config
|
||||||
ApiClient.getServerConfiguration().done(function (config) {
|
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||||
|
|
||||||
config.PreferredMetadataLanguage = $('#selectLanguage', page).val();
|
config.PreferredMetadataLanguage = $('#selectLanguage', page).val();
|
||||||
config.MetadataCountryCode = $('#selectCountry', page).val();
|
config.MetadataCountryCode = $('#selectCountry', page).val();
|
||||||
config.SaveLocalMeta = $('#chkSaveLocalMetadata', page).checked();
|
config.SaveLocalMeta = $('#chkSaveLocalMetadata', page).checked();
|
||||||
|
|
||||||
config.EnableInternetProviders = $('#chkEnableInternetProviders', page).checked();
|
config.EnableInternetProviders = $('#chkEnableInternetProviders', page).checked();
|
||||||
|
|
||||||
ApiClient.updateServerConfiguration(config).done(function (result) {
|
apiClient.ajax({
|
||||||
|
|
||||||
|
type: 'POST',
|
||||||
|
data: config,
|
||||||
|
url: apiClient.getUrl('Startup/Configuration')
|
||||||
|
|
||||||
|
}).done(function () {
|
||||||
|
|
||||||
navigateToNextPage();
|
navigateToNextPage();
|
||||||
|
|
||||||
|
@ -37,9 +44,11 @@
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
var promise1 = ApiClient.getServerConfiguration();
|
var apiClient = ApiClient;
|
||||||
var promise2 = ApiClient.getCultures();
|
|
||||||
var promise3 = ApiClient.getCountries();
|
var promise1 = apiClient.getJSON(apiClient.getUrl('Startup/Configuration'));
|
||||||
|
var promise2 = apiClient.getCultures();
|
||||||
|
var promise3 = apiClient.getCountries();
|
||||||
|
|
||||||
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) {
|
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) {
|
||||||
|
|
||||||
|
@ -50,7 +59,9 @@
|
||||||
|
|
||||||
function navigateToNextPage() {
|
function navigateToNextPage() {
|
||||||
|
|
||||||
ApiClient.getSystemInfo().done(function(info) {
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
|
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||||
|
|
||||||
if (info.SupportsRunningAsService) {
|
if (info.SupportsRunningAsService) {
|
||||||
Dashboard.navigate('wizardservice.html');
|
Dashboard.navigate('wizardservice.html');
|
||||||
|
|
|
@ -17,11 +17,17 @@
|
||||||
|
|
||||||
var apiClient = ApiClient;
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
apiClient.getServerConfiguration().done(function (config) {
|
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||||
|
|
||||||
config.UICulture = $('#selectLocalizationLanguage', page).val();
|
config.UICulture = $('#selectLocalizationLanguage', page).val();
|
||||||
|
|
||||||
apiClient.updateServerConfiguration(config).done(function (result) {
|
apiClient.ajax({
|
||||||
|
|
||||||
|
type: 'POST',
|
||||||
|
data: config,
|
||||||
|
url: apiClient.getUrl('Startup/Configuration')
|
||||||
|
|
||||||
|
}).done(function () {
|
||||||
|
|
||||||
Dashboard.navigate('wizarduser.html');
|
Dashboard.navigate('wizarduser.html');
|
||||||
|
|
||||||
|
@ -37,29 +43,13 @@
|
||||||
|
|
||||||
var apiClient = ApiClient;
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
apiClient.getPublicUsers().done(function (u) {
|
var promise1 = apiClient.getJSON(apiClient.getUrl('Startup/Configuration'));
|
||||||
|
|
||||||
var user = u.filter(function (i) {
|
var promise2 = apiClient.getJSON(apiClient.getUrl("Localization/Options"));
|
||||||
return i.Configuration.IsAdministrator;
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
apiClient.authenticateUserByName(user.Name, '').done(function (result) {
|
$.when(promise1, promise2).done(function (response1, response2) {
|
||||||
|
|
||||||
user = result.User;
|
loadPage(page, response1[0], response2[0]);
|
||||||
|
|
||||||
Dashboard.setCurrentUser(user.Id, result.AccessToken);
|
|
||||||
|
|
||||||
var promise1 = apiClient.getServerConfiguration();
|
|
||||||
|
|
||||||
var promise2 = apiClient.getJSON(apiClient.getUrl("Localization/Options"));
|
|
||||||
|
|
||||||
$.when(promise1, promise2).done(function (response1, response2) {
|
|
||||||
|
|
||||||
loadPage(page, response1[0], response2[0]);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,60 +1,51 @@
|
||||||
(function ($, document, window) {
|
(function ($, document, window) {
|
||||||
|
|
||||||
function getUsers() {
|
function getApiClient() {
|
||||||
return ApiClient.getUsers({IsGuest: false});
|
return ApiClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSaveComplete(user) {
|
function onUpdateUserComplete(result) {
|
||||||
|
|
||||||
var page = $.mobile.activePage;
|
|
||||||
var userId = user.Id;
|
|
||||||
|
|
||||||
var metadataKey = "xbmcmetadata";
|
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
|
|
||||||
ApiClient.getNamedConfiguration(metadataKey).done(function (config) {
|
if (result.UserLinkResult) {
|
||||||
|
|
||||||
config.UserId = userId;
|
var msgKey = result.UserLinkResult.IsPending ? 'MessagePendingMediaBrowserAccountAdded' : 'MessageMediaBrowserAccountAdded';
|
||||||
|
|
||||||
ApiClient.updateNamedConfiguration(metadataKey, config).done(function () {
|
Dashboard.alert({
|
||||||
|
message: Globalize.translate(msgKey),
|
||||||
|
title: Globalize.translate('HeaderMediaBrowserAccountAdded'),
|
||||||
|
|
||||||
|
callback: function () {
|
||||||
|
Dashboard.navigate('wizardlibrary.html');
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
var callback = function() {
|
|
||||||
|
|
||||||
|
} else {
|
||||||
Dashboard.navigate('wizardlibrary.html');
|
Dashboard.navigate('wizardlibrary.html');
|
||||||
};
|
}
|
||||||
|
|
||||||
ConnectHelper.updateUserInfo(user, $('#txtConnectUserName', page).val(), callback, callback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function submit(form) {
|
function submit(form) {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
getUsers().done(function (users) {
|
var apiClient = getApiClient();
|
||||||
|
|
||||||
var user;
|
apiClient.ajax({
|
||||||
|
|
||||||
if (users.length) {
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
|
||||||
user = users[0];
|
Name: $('#txtUsername', form).val(),
|
||||||
|
ConnectUserName: $('#txtConnectUserName', form).val()
|
||||||
|
|
||||||
user.Name = $('#txtUsername', form).val();
|
},
|
||||||
|
url: apiClient.getUrl('Startup/User'),
|
||||||
|
dataType: 'json'
|
||||||
|
|
||||||
ApiClient.updateUser(user).done(function () {
|
}).done(onUpdateUserComplete);
|
||||||
|
|
||||||
onSaveComplete(user);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
ApiClient.createUser($('#txtUsername', form).val()).done(onSaveComplete);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function wizardUserPage() {
|
function wizardUserPage() {
|
||||||
|
@ -77,9 +68,9 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
getUsers().done(function (users) {
|
var apiClient = getApiClient();
|
||||||
|
|
||||||
var user = users[0];
|
apiClient.getJSON(apiClient.getUrl('Startup/User')).done(function (user) {
|
||||||
|
|
||||||
$('#txtUsername', page).val(user.Name);
|
$('#txtUsername', page).val(user.Name);
|
||||||
$('#txtConnectUserName', page).val(user.ConnectUserName);
|
$('#txtConnectUserName', page).val(user.ConnectUserName);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue