1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

added CanSelfRestart

This commit is contained in:
Luke Pulverenti 2013-10-07 10:38:31 -04:00
parent c236b53727
commit d8fdb2f5f8
3 changed files with 18 additions and 5 deletions

View file

@ -39,8 +39,10 @@
<div id="pendingInstallations">
</div>
<p>Please restart the server to finish applying updates.</p>
<div class="btnRestartContainer hide">
<button type="button" data-icon="refresh" data-theme="b" onclick="Dashboard.restartServer();">Restart Now</button>
</div>
</div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;">
<h3>Active Connections</h3>
@ -59,8 +61,10 @@
<div style="margin-top: 2em;">
<div style="display: inline-block;">
<div class="btnRestartContainer hide">
<button id="btnRestartServer" type="button" data-icon="refresh" data-mini="true" data-inline="true" onclick="DashboardPage.restart();">Restart MB Server</button>
</div>
</div>
<div style="display: inline-block;">
<button id="btnShutdown" type="button" data-icon="delete" data-mini="true" data-inline="true" onclick="DashboardPage.shutdown();">Shutdown MB Server</button>
</div>

View file

@ -345,6 +345,12 @@
$('#btnUpdateApplication', page).button('enable');
}
if (dashboardInfo.SystemInfo.CanSelfRestart) {
$('.btnRestartContainer', page).removeClass('hide');
} else {
$('.btnRestartContainer', page).addClass('hide');
}
DashboardPage.renderApplicationUpdateInfo(dashboardInfo);
DashboardPage.renderPluginUpdateInfo(dashboardInfo);
DashboardPage.renderPendingInstallations(dashboardInfo.SystemInfo);

View file

@ -158,7 +158,7 @@ var Dashboard = {
Dashboard.getCurrentUser().done(function (currentUser) {
if (currentUser.Configuration.IsAdministrator) {
Dashboard.showServerRestartWarning();
Dashboard.showServerRestartWarning(info);
}
});
@ -252,10 +252,13 @@ var Dashboard = {
},
showServerRestartWarning: function () {
showServerRestartWarning: function (systemInfo) {
var html = '<span style="margin-right: 1em;">Please restart Media Browser Server to finish updating.</span>';
if (systemInfo.CanSelfRestart) {
html += '<button type="button" data-icon="refresh" onclick="$(this).button(\'disable\');Dashboard.restartServer();" data-theme="b" data-inline="true" data-mini="true">Restart Server</button>';
}
Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false });
},