mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add confirm dialog when deleting server
This commit is contained in:
parent
cb05b5eaf2
commit
c9ade820ed
2 changed files with 17 additions and 4 deletions
|
@ -7,6 +7,7 @@ import appSettings from '../../../scripts/settings/appSettings';
|
|||
import focusManager from '../../../components/focusManager';
|
||||
import globalize from '../../../lib/globalize';
|
||||
import actionSheet from '../../../components/actionSheet/actionSheet';
|
||||
import confirm from '../../../components/confirm/confirm';
|
||||
import dom from '../../../scripts/dom';
|
||||
import browser from '../../../scripts/browser';
|
||||
import 'material-design-icons-iconfont';
|
||||
|
@ -136,10 +137,21 @@ export default function (view, params) {
|
|||
}
|
||||
|
||||
function deleteServer(server) {
|
||||
confirm({
|
||||
title: globalize.translate('DeleteName', server.Name),
|
||||
text: globalize.translate('DeleteServerConfirmation'),
|
||||
confirmText: globalize.translate('Delete'),
|
||||
primary: 'delete'
|
||||
}).then(function () {
|
||||
loading.show();
|
||||
ServerConnections.deleteServer(server.Id).then(function () {
|
||||
loading.hide();
|
||||
loadServers();
|
||||
}).catch(err => {
|
||||
console.error('[selectServer] failed to delete server', err);
|
||||
});
|
||||
}).catch(() => {
|
||||
// confirm dialog closed
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -218,6 +218,7 @@
|
|||
"DeleteName": "Delete {0}",
|
||||
"DeleteUser": "Delete User",
|
||||
"DeleteUserConfirmation": "Are you sure you wish to delete this user?",
|
||||
"DeleteServerConfirmation": "Are you sure you wish to delete this server?",
|
||||
"Depressed": "Depressed",
|
||||
"Descending": "Descending",
|
||||
"Desktop": "Desktop",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue