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">
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabDevices}</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 class="readOnlyContent">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="devices.html" data-role="button">${TabDevices}</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 class="readOnlyContent">
|
||||
|
|
|
@ -18,32 +18,10 @@
|
|||
}
|
||||
|
||||
function getBaseRemoteOptions() {
|
||||
|
||||
var options = {};
|
||||
|
||||
if (currentItem.Type == "Year") {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
msg += "<br/>";
|
||||
msg += result.PinFile;
|
||||
msg += "<br/>";
|
||||
msg += "<br/>";
|
||||
msg += Globalize.translate('MessageForgotPasswordFileExpiration', parseISO8601Date(result.PinExpirationDate, { toLocal: true }).toLocaleString());
|
||||
|
||||
Dashboard.alert({
|
||||
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
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 = '';
|
||||
|
||||
|
@ -12,9 +14,12 @@
|
|||
|
||||
html += logs.map(function (log) {
|
||||
|
||||
var logUrl = ApiClient.getUrl('System/Logs/Log', {
|
||||
var logUrl = apiClient.getUrl('System/Logs/Log', {
|
||||
name: log.Name
|
||||
});
|
||||
|
||||
logUrl += "&api_key=" + apiClient.accessToken();
|
||||
|
||||
var logHtml = '<li><a href="' + logUrl + '" target="_blank">';
|
||||
|
||||
logHtml += '<h3>';
|
||||
|
|
|
@ -345,9 +345,11 @@ var WizardLibraryPage = {
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.ajax({
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('System/Configuration/MetadataPlugins/Autoset')
|
||||
url: apiClient.getUrl('System/Configuration/MetadataPlugins/Autoset')
|
||||
|
||||
}).done(function () {
|
||||
|
||||
|
@ -440,14 +442,16 @@ var WizardLibraryPage = {
|
|||
|
||||
pollTasks(page);
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
||||
var apiClient = ApiClient;
|
||||
|
||||
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()) {
|
||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
||||
if (apiClient.isWebSocketOpen()) {
|
||||
apiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -455,11 +459,13 @@ var WizardLibraryPage = {
|
|||
|
||||
var page = this;
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
|
||||
var apiClient = ApiClient;
|
||||
|
||||
if (apiClient.isWebSocketOpen()) {
|
||||
apiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
|
||||
}
|
||||
|
||||
$(ApiClient).off("websocketmessage", onWebSocketMessage);
|
||||
$(apiClient).off("websocketmessage", onWebSocketMessage);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -1120,7 +1120,7 @@
|
|||
}
|
||||
|
||||
// Live streams seem to function better with mp4
|
||||
var mp4BeforeWebm = self.getVideoTranscodingExtension() != '.webm' || !mediaSource.RunTimeTicks;
|
||||
var mp4BeforeWebm = self.getVideoTranscodingExtension() != '.webm';
|
||||
|
||||
if (mp4BeforeWebm) {
|
||||
html += '<source type="video/mp4" src="' + mp4VideoUrl + '" />';
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
cache: false
|
||||
});
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
// TODO: Deprecated in 1.9
|
||||
|
@ -21,6 +20,7 @@ $.support.cors = true;
|
|||
$(document).one('click', WebNotifications.requestPermission);
|
||||
|
||||
var Dashboard = {
|
||||
|
||||
jQueryMobileInit: function () {
|
||||
|
||||
// Page
|
||||
|
|
|
@ -110,6 +110,7 @@
|
|||
|
||||
function isAvailable(item, user) {
|
||||
|
||||
return false;
|
||||
return item.SupportsSync;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
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');
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
|
@ -4,16 +4,23 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
// 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.MetadataCountryCode = $('#selectCountry', page).val();
|
||||
config.SaveLocalMeta = $('#chkSaveLocalMetadata', 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();
|
||||
|
||||
|
@ -37,9 +44,11 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
var promise2 = ApiClient.getCultures();
|
||||
var promise3 = ApiClient.getCountries();
|
||||
var apiClient = ApiClient;
|
||||
|
||||
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) {
|
||||
|
||||
|
@ -50,7 +59,9 @@
|
|||
|
||||
function navigateToNextPage() {
|
||||
|
||||
ApiClient.getSystemInfo().done(function(info) {
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||
|
||||
if (info.SupportsRunningAsService) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
|
|
|
@ -17,11 +17,17 @@
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getServerConfiguration().done(function (config) {
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
|
||||
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');
|
||||
|
||||
|
@ -37,19 +43,7 @@
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getPublicUsers().done(function (u) {
|
||||
|
||||
var user = u.filter(function (i) {
|
||||
return i.Configuration.IsAdministrator;
|
||||
})[0];
|
||||
|
||||
apiClient.authenticateUserByName(user.Name, '').done(function (result) {
|
||||
|
||||
user = result.User;
|
||||
|
||||
Dashboard.setCurrentUser(user.Id, result.AccessToken);
|
||||
|
||||
var promise1 = apiClient.getServerConfiguration();
|
||||
var promise1 = apiClient.getJSON(apiClient.getUrl('Startup/Configuration'));
|
||||
|
||||
var promise2 = apiClient.getJSON(apiClient.getUrl("Localization/Options"));
|
||||
|
||||
|
@ -58,10 +52,6 @@
|
|||
loadPage(page, response1[0], response2[0]);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
window.WizardStartPage = {
|
||||
|
|
|
@ -1,60 +1,51 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
function getUsers() {
|
||||
return ApiClient.getUsers({IsGuest: false});
|
||||
function getApiClient() {
|
||||
return ApiClient;
|
||||
}
|
||||
|
||||
function onSaveComplete(user) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
var userId = user.Id;
|
||||
|
||||
var metadataKey = "xbmcmetadata";
|
||||
function onUpdateUserComplete(result) {
|
||||
|
||||
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 () {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var callback = function() {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate(msgKey),
|
||||
title: Globalize.translate('HeaderMediaBrowserAccountAdded'),
|
||||
|
||||
callback: function () {
|
||||
Dashboard.navigate('wizardlibrary.html');
|
||||
};
|
||||
}
|
||||
|
||||
ConnectHelper.updateUserInfo(user, $('#txtConnectUserName', page).val(), callback, callback);
|
||||
});
|
||||
|
||||
} else {
|
||||
Dashboard.navigate('wizardlibrary.html');
|
||||
}
|
||||
}
|
||||
|
||||
function submit(form) {
|
||||
|
||||
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 () {
|
||||
|
||||
onSaveComplete(user);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
ApiClient.createUser($('#txtUsername', form).val()).done(onSaveComplete);
|
||||
}
|
||||
|
||||
});
|
||||
}).done(onUpdateUserComplete);
|
||||
}
|
||||
|
||||
function wizardUserPage() {
|
||||
|
@ -77,9 +68,9 @@
|
|||
|
||||
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);
|
||||
$('#txtConnectUserName', page).val(user.ConnectUserName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue