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

View file

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

View file

@ -158,7 +158,7 @@ var Dashboard = {
Dashboard.getCurrentUser().done(function (currentUser) { Dashboard.getCurrentUser().done(function (currentUser) {
if (currentUser.Configuration.IsAdministrator) { 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>'; var html = '<span style="margin-right: 1em;">Please restart Media Browser Server to finish updating.</span>';
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>';
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 }); Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false });
}, },