mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update server delete function
This commit is contained in:
parent
dfd651131a
commit
2bcdb9060a
1 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
|
var serverList = [];
|
||||||
function connectToServer(page, server) {
|
function connectToServer(page, server) {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
@ -109,6 +110,8 @@
|
||||||
|
|
||||||
function renderServers(page, servers) {
|
function renderServers(page, servers) {
|
||||||
|
|
||||||
|
serverList = servers;
|
||||||
|
|
||||||
if (servers.length) {
|
if (servers.length) {
|
||||||
$('.noServersMessage', page).hide();
|
$('.noServersMessage', page).hide();
|
||||||
} else {
|
} else {
|
||||||
|
@ -178,7 +181,13 @@
|
||||||
ConnectionManager.deleteServer(id).done(function () {
|
ConnectionManager.deleteServer(id).done(function () {
|
||||||
|
|
||||||
Dashboard.hideModalLoadingMsg();
|
Dashboard.hideModalLoadingMsg();
|
||||||
loadPage(page);
|
|
||||||
|
// Just re-render the servers without discovering them again
|
||||||
|
// If we re-discover then the one they deleted may just come back
|
||||||
|
var newServerList = serverList.filter(function(s){
|
||||||
|
return s.Id != id;
|
||||||
|
});
|
||||||
|
renderServers(page, newServerList);
|
||||||
|
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
|
|
||||||
|
@ -195,6 +204,7 @@
|
||||||
ConnectionManager.rejectServer(id).done(function () {
|
ConnectionManager.rejectServer(id).done(function () {
|
||||||
|
|
||||||
Dashboard.hideModalLoadingMsg();
|
Dashboard.hideModalLoadingMsg();
|
||||||
|
|
||||||
loadPage(page);
|
loadPage(page);
|
||||||
|
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue