define(['datetime', 'jQuery', 'cardStyle'], function (datetime, $) { function renderNoHealthAlertsMessage(page) { var html = '
';
html += '
';
html += task.Name + "
";
if (task.State == "Running") {
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
html += '';
html += "" + progress + "%";
html += '';
}
else if (task.State == "Cancelling") {
html += '' + Globalize.translate('LabelStopping') + '';
}
html += '
' + Globalize.translate('NewVersionOfSomethingAvailable').replace('{0}', update.name) + '
'; html += ''; } elem.html(html); }); }, installPluginUpdate: function (button) { $(button).buttonEnabled(false); var name = button.getAttribute('data-name'); var guid = button.getAttribute('data-guid'); var version = button.getAttribute('data-version'); var classification = button.getAttribute('data-classification'); Dashboard.showLoadingMsg(); ApiClient.installPlugin(name, guid, classification, version).then(function () { Dashboard.hideLoadingMsg(); }); }, updateApplication: function () { var page = $.mobile.activePage; $('#btnUpdateApplication', page).buttonEnabled(false); Dashboard.showLoadingMsg(); ApiClient.getScheduledTasks().then(function (tasks) { var task = tasks.filter(function (t) { return t.Key == DashboardPage.systemUpdateTaskKey; })[0]; ApiClient.startScheduledTask(task.Id).then(function () { DashboardPage.pollForInfo(page); Dashboard.hideLoadingMsg(); }); }); }, stopTask: function (id) { var page = $.mobile.activePage; ApiClient.stopScheduledTask(id).then(function () { DashboardPage.pollForInfo(page); }); }, restart: function () { require(['confirm'], function (confirm) { confirm(Globalize.translate('MessageConfirmRestart'), Globalize.translate('HeaderRestart')).then(function () { $('#btnRestartServer').buttonEnabled(false); $('#btnShutdown').buttonEnabled(false); Dashboard.restartServer(); }); }); }, shutdown: function () { require(['confirm'], function (confirm) { confirm(Globalize.translate('MessageConfirmShutdown'), Globalize.translate('HeaderShutdown')).then(function () { $('#btnRestartServer').buttonEnabled(false); $('#btnShutdown').buttonEnabled(false); ApiClient.shutdownServer(); }); }); } }; $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pagebeforehide', "#dashboardPage", DashboardPage.onPageHide); (function ($, document, window) { function getEntryHtml(entry) { var html = ''; html += '