mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
more granular upgrade status
This commit is contained in:
12
themes/grav/js/admin.min.js
vendored
12
themes/grav/js/admin.min.js
vendored
@@ -5015,11 +5015,11 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
return;
|
||||
}
|
||||
var payload = response.data || {};
|
||||
lastPayload = payload;
|
||||
if (Object.prototype.hasOwnProperty.call(payload, 'context')) {
|
||||
_this6.statusContext = payload.context || null;
|
||||
}
|
||||
var job = payload.job || {};
|
||||
lastPayload = payload;
|
||||
var data = payload.progress || payload;
|
||||
nextStage = data.stage || null;
|
||||
if (!job || !Object.keys(job).length) {
|
||||
@@ -5065,6 +5065,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
if (usingDirect && _this6.statusFailures >= 3) {
|
||||
_this6.preferDirectStatus = false;
|
||||
_this6.statusFailures = 0;
|
||||
_this6.statusIdleCount = 0;
|
||||
_this6.schedulePoll();
|
||||
} else {
|
||||
var delay = Math.min(5000, 1200 * Math.max(1, _this6.statusFailures));
|
||||
@@ -5073,6 +5074,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
} else if ((!lastPayload || !lastPayload.job || !Object.keys(lastPayload.job).length) && usingDirect && _this6.statusIdleCount >= 5) {
|
||||
_this6.preferDirectStatus = false;
|
||||
_this6.statusFailures = 0;
|
||||
_this6.statusIdleCount = 0;
|
||||
_this6.schedulePoll();
|
||||
} else if (jobFailed) {
|
||||
_this6.stopPolling();
|
||||
@@ -5116,10 +5118,10 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
return 25;
|
||||
}
|
||||
if (stage === 'installing') {
|
||||
return percent !== null ? Math.max(percent, 80) : 80;
|
||||
return percent !== null ? Math.min(Math.max(percent, 80), 94) : 80;
|
||||
}
|
||||
if (stage === 'finalizing') {
|
||||
return percent !== null ? Math.max(percent, 95) : 95;
|
||||
return percent !== null ? Math.min(Math.max(percent, 95), 99) : 95;
|
||||
}
|
||||
if (stage === 'complete') {
|
||||
return 100;
|
||||
@@ -5132,7 +5134,9 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
percent = scaledPercent();
|
||||
var percentLabel = percent !== null ? "".concat(percent, "%") : '';
|
||||
var statusLine = job && job.status ? "<p class=\"safe-upgrade-status\">".concat(t('SAFE_UPGRADE_JOB_STATUS', 'Status'), ": <strong>").concat(job.status.toUpperCase(), "</strong>").concat(job.error ? " — ".concat(job.error) : '', "</p>") : '';
|
||||
this.steps.progress.html("\n <div class=\"safe-upgrade-progress\">\n <h3>".concat(title, "</h3>\n <p>").concat(data.message || '', "</p>\n ").concat(statusLine, "\n ").concat(percentLabel ? "<div class=\"safe-upgrade-progress-bar\"><span style=\"width:".concat(percent, "%\"></span></div><div class=\"progress-value\">").concat(percentLabel, "</div>") : '', "\n </div>\n "));
|
||||
var animateBar = stage !== 'complete' && stage !== 'error' && percent !== null;
|
||||
var barClass = "safe-upgrade-progress-bar".concat(animateBar ? ' is-active' : '');
|
||||
this.steps.progress.html("\n <div class=\"safe-upgrade-progress\">\n <h3>".concat(title, "</h3>\n <p>").concat(data.message || '', "</p>\n ").concat(statusLine, "\n ").concat(percentLabel ? "<div class=\"".concat(barClass, "\"><span style=\"width:").concat(percent, "%\"></span></div><div class=\"progress-value\">").concat(percentLabel, "</div>") : '', "\n </div>\n "));
|
||||
this.switchStep('progress');
|
||||
if (stage === 'complete') {
|
||||
this.renderResult({
|
||||
|
||||
Reference in New Issue
Block a user