mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 19:06:16 +01:00
more improvements to safe upgrade
This commit is contained in:
15
themes/grav/js/admin.min.js
vendored
15
themes/grav/js/admin.min.js
vendored
@@ -4610,6 +4610,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
this.active = false;
|
||||
this.jobId = null;
|
||||
this.statusFailures = 0;
|
||||
this.statusContext = null;
|
||||
this.directStatusUrl = this.resolveDirectStatusUrl();
|
||||
this.preferDirectStatus = !!this.directStatusUrl;
|
||||
this.registerEvents();
|
||||
@@ -4676,6 +4677,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
this.decisions = {};
|
||||
this.statusFailures = 0;
|
||||
this.preferDirectStatus = !!this.directStatusUrl;
|
||||
this.statusContext = null;
|
||||
this.renderLoading();
|
||||
this.modal.open();
|
||||
this.fetchPreflight();
|
||||
@@ -4882,6 +4884,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
}
|
||||
_this4.statusFailures = 0;
|
||||
_this4.preferDirectStatus = !!_this4.directStatusUrl;
|
||||
_this4.statusContext = data.context || null;
|
||||
_this4.beginPolling(1200);
|
||||
} else {
|
||||
_this4.renderResult(data);
|
||||
@@ -4921,8 +4924,15 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
value: function resolveStatusEndpoint() {
|
||||
var useDirect = this.directStatusUrl && this.preferDirectStatus;
|
||||
var url = useDirect ? this.directStatusUrl : this.urls.status;
|
||||
var params = [];
|
||||
if (this.jobId) {
|
||||
url += (url.indexOf('?') !== -1 ? '&' : '?') + "job=".concat(encodeURIComponent(this.jobId));
|
||||
params.push("job=".concat(encodeURIComponent(this.jobId)));
|
||||
}
|
||||
if (this.statusContext) {
|
||||
params.push("context=".concat(encodeURIComponent(this.statusContext)));
|
||||
}
|
||||
if (params.length) {
|
||||
url += (url.indexOf('?') !== -1 ? '&' : '?') + params.join('&');
|
||||
}
|
||||
return {
|
||||
url: url,
|
||||
@@ -5002,6 +5012,9 @@ var SafeUpgrade = /*#__PURE__*/function () {
|
||||
return;
|
||||
}
|
||||
var payload = response.data || {};
|
||||
if (Object.prototype.hasOwnProperty.call(payload, 'context')) {
|
||||
_this6.statusContext = payload.context || null;
|
||||
}
|
||||
var job = payload.job || {};
|
||||
var data = payload.progress || payload;
|
||||
nextStage = data.stage || null;
|
||||
|
||||
Reference in New Issue
Block a user