mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
extracted connectionManager from site.js
new module ServerConnections for ConnectionManager all code adapted to this new module removed Events and ConnectionManager from eslintrc
This commit is contained in:
parent
923d53bb71
commit
5071aedcea
81 changed files with 446 additions and 397 deletions
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
|||
import globalize from '../../../scripts/globalize';
|
||||
import '../../../elements/emby-button/emby-button';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import ServerConnections from '../../../components/ServerConnections';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -37,7 +38,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
function submitServer(page) {
|
||||
loading.show();
|
||||
const host = page.querySelector('#txtServerHost').value;
|
||||
window.connectionManager.connectToAddress(host, {
|
||||
ServerConnections.connectToAddress(host, {
|
||||
enableAutoLogin: appSettings.enableAutoLogin()
|
||||
}).then(function(result) {
|
||||
handleConnectionResult(page, result);
|
||||
|
|
|
@ -9,6 +9,7 @@ import globalize from '../../../scripts/globalize';
|
|||
import '../../../components/cardbuilder/card.css';
|
||||
import '../../../elements/emby-checkbox/emby-checkbox';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import ServerConnections from '../../../components/ServerConnections';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -192,7 +193,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
const serverId = params.serverid;
|
||||
|
||||
if (serverId) {
|
||||
return ConnectionManager.getOrCreateApiClient(serverId);
|
||||
return ServerConnections.getOrCreateApiClient(serverId);
|
||||
}
|
||||
|
||||
return ApiClient;
|
||||
|
|
|
@ -4,7 +4,6 @@ import layoutManager from '../../../components/layoutManager';
|
|||
import libraryMenu from '../../../scripts/libraryMenu';
|
||||
import appSettings from '../../../scripts/settings/appSettings';
|
||||
import focusManager from '../../../components/focusManager';
|
||||
import { ConnectionManager } from 'jellyfin-apiclient';
|
||||
import globalize from '../../../scripts/globalize';
|
||||
import actionSheet from '../../../components/actionSheet/actionSheet';
|
||||
import dom from '../../../scripts/dom';
|
||||
|
@ -16,6 +15,7 @@ import '../../../elements/emby-itemscontainer/emby-itemscontainer';
|
|||
import '../../../components/cardbuilder/card.css';
|
||||
import '../../../elements/emby-button/emby-button';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import ServerConnections from '../../../components/ServerConnections';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -114,7 +114,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
export default function (view, params) {
|
||||
function connectToServer(server) {
|
||||
loading.show();
|
||||
ConnectionManager.connectToServer(server, {
|
||||
ServerConnections.connectToServer(server, {
|
||||
enableAutoLogin: appSettings.enableAutoLogin()
|
||||
}).then(function (result) {
|
||||
loading.hide();
|
||||
|
@ -146,7 +146,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
|
||||
function deleteServer(server) {
|
||||
loading.show();
|
||||
ConnectionManager.deleteServer(server.Id).then(function () {
|
||||
ServerConnections.deleteServer(server.Id).then(function () {
|
||||
loading.hide();
|
||||
loadServers();
|
||||
});
|
||||
|
@ -188,7 +188,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
|
||||
function loadServers() {
|
||||
loading.show();
|
||||
ConnectionManager.getAvailableServers().then(onServersRetrieved);
|
||||
ServerConnections.getAvailableServers().then(onServersRetrieved);
|
||||
}
|
||||
|
||||
let servers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue