mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added manual server form
This commit is contained in:
parent
5257e91628
commit
c710303de9
9 changed files with 265 additions and 48 deletions
|
@ -42,8 +42,22 @@ var Dashboard = {
|
|||
$.mobile.panel.prototype.options.classes.panel = "largePanel ui-panel";
|
||||
},
|
||||
|
||||
isConnectMode: function () {
|
||||
|
||||
return true;
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var url = getWindowUrl().toLowerCase();
|
||||
|
||||
return url.indexOf('mediabrowser.tv') != -1 ||
|
||||
url.indexOf('emby.media') != -1;
|
||||
},
|
||||
|
||||
isRunningInCordova: function () {
|
||||
|
||||
return true;
|
||||
return window.appMode == 'cordova';
|
||||
},
|
||||
|
||||
|
@ -185,18 +199,6 @@ var Dashboard = {
|
|||
Dashboard.getUserPromise = null;
|
||||
},
|
||||
|
||||
isConnectMode: function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var url = getWindowUrl().toLowerCase();
|
||||
|
||||
return url.indexOf('mediabrowser.tv') != -1 ||
|
||||
url.indexOf('emby.media') != -1;
|
||||
},
|
||||
|
||||
logout: function (logoutWithServer) {
|
||||
|
||||
store.removeItem("userId");
|
||||
|
@ -1648,18 +1650,6 @@ $(document).on('pagecreate', ".page", function () {
|
|||
|
||||
var page = $(this);
|
||||
|
||||
var isConnectMode = Dashboard.isConnectMode();
|
||||
|
||||
if (isConnectMode && !page.hasClass('connectLoginPage')) {
|
||||
|
||||
if (!ConnectionManager.isLoggedIntoConnect()) {
|
||||
|
||||
console.log('Not logged into connect. Redirecting to login.');
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var apiClient = ConnectionManager.currentApiClient();
|
||||
|
||||
if (Dashboard.getAccessToken() && Dashboard.getCurrentUserId()) {
|
||||
|
@ -1686,6 +1676,16 @@ $(document).on('pagecreate', ".page", function () {
|
|||
|
||||
else {
|
||||
|
||||
var isConnectMode = Dashboard.isConnectMode();
|
||||
|
||||
if (isConnectMode) {
|
||||
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.id !== "loginPage" && !page.hasClass('forgotPasswordPage') && !page.hasClass('wizardPage') && !isConnectMode) {
|
||||
|
||||
console.log('Not logged into server. Redirecting to login.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue