css tweaks 2

This commit is contained in:
Andy Miller
2025-10-17 15:07:46 -06:00
parent 3b07e9a091
commit 765e760541
7 changed files with 422 additions and 7369 deletions

View File

@@ -507,7 +507,9 @@ PLUGIN_ADMIN:
SAFE_UPGRADE_PACKAGE_SIZE: "Package size: %s"
SAFE_UPGRADE_UNKNOWN_SIZE: "unknown"
SAFE_UPGRADE_WARNINGS: "Warnings"
SAFE_UPGRADE_WARNINGS_HINT: "These items may require attention before continuing."
SAFE_UPGRADE_PENDING_UPDATES: "Pending plugin or theme updates"
SAFE_UPGRADE_PENDING_INTRO: "Review the extensions that should be updated first."
SAFE_UPGRADE_PENDING_HINT: "Update all plugins and themes before proceeding."
SAFE_UPGRADE_UNKNOWN_VERSION: "unknown"
SAFE_UPGRADE_REQUIREMENTS_FAIL: "PHP %s or newer is required before continuing."
@@ -517,9 +519,12 @@ PLUGIN_ADMIN:
SAFE_UPGRADE_CONFLICTS_PSR: "Potential psr/log compatibility issues"
SAFE_UPGRADE_CONFLICTS_REQUIRES: "Requires psr/log %s"
SAFE_UPGRADE_CONFLICTS_MONOLOG: "Potential Monolog API compatibility issues"
SAFE_UPGRADE_CONFLICTS_HINT: "Choose how to handle conflicts before starting the upgrade."
SAFE_UPGRADE_DECISION_PROMPT: "When conflicts are detected:"
SAFE_UPGRADE_DECISION_DISABLE: "Disable conflicting plugins"
SAFE_UPGRADE_DECISION_CONTINUE: "Continue with plugins enabled"
SAFE_UPGRADE_BLOCKERS_TITLE: "Action required before continuing"
SAFE_UPGRADE_BLOCKERS_DESC: "Resolve the following items to enable the upgrade."
SAFE_UPGRADE_START: "Start Safe Upgrade"
SAFE_UPGRADE_STAGE_INITIALIZING: "Preparing upgrade"
SAFE_UPGRADE_STAGE_DOWNLOADING: "Downloading update"

View File

@@ -215,77 +215,124 @@ export default class SafeUpgrade {
}
const warningsList = warnings.length ? `
<div class="safe-upgrade-alert">
<strong>${t('SAFE_UPGRADE_WARNINGS', 'Warnings')}</strong>
<ul>${warnings.map((warning) => `<li>${warning}</li>`).join('')}</ul>
</div>
<section class="safe-upgrade-panel safe-upgrade-panel--alert safe-upgrade-alert">
<header class="safe-upgrade-panel__header">
<div class="safe-upgrade-panel__title-wrap">
<span class="safe-upgrade-panel__icon fa fa-exclamation-triangle" aria-hidden="true"></span>
<div>
<strong class="safe-upgrade-panel__title">${t('SAFE_UPGRADE_WARNINGS', 'Warnings')}</strong>
<span class="safe-upgrade-panel__subtitle">${t('SAFE_UPGRADE_WARNINGS_HINT', 'These items may require attention before continuing.')}</span>
</div>
</div>
</header>
<div class="safe-upgrade-panel__body">
<ul>${warnings.map((warning) => `<li>${warning}</li>`).join('')}</ul>
</div>
</section>
` : '';
const pendingList = Object.keys(pending).length ? `
<div class="safe-upgrade-pending">
<strong>${t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates')}</strong>
<ul>
${Object.keys(pending).map((slug) => {
const item = pending[slug] || {};
const type = item.type || 'plugin';
const current = item.current || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');
const next = item.available || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');
return `<li><code>${slug}</code> (${type}) ${current} &rarr; ${next}</li>`;
}).join('')}
</ul>
</div>
<section class="safe-upgrade-panel safe-upgrade-panel--info safe-upgrade-pending">
<header class="safe-upgrade-panel__header">
<div class="safe-upgrade-panel__title-wrap">
<span class="safe-upgrade-panel__icon fa fa-sync" aria-hidden="true"></span>
<div>
<strong class="safe-upgrade-panel__title">${t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates')}</strong>
<span class="safe-upgrade-panel__subtitle">${t('SAFE_UPGRADE_PENDING_INTRO', 'Review the extensions that should be updated first.')}</span>
</div>
</div>
</header>
<div class="safe-upgrade-panel__body">
<ul>
${Object.keys(pending).map((slug) => {
const item = pending[slug] || {};
const type = item.type || 'plugin';
const current = item.current || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');
const next = item.available || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');
return `<li><code>${slug}</code> (${type}) ${current} &rarr; ${next}</li>`;
}).join('')}
</ul>
</div>
</section>
` : '';
const psrList = Object.keys(psrConflicts).length ? `
<div class="safe-upgrade-conflict">
<div class="safe-upgrade-conflict-header">
<strong>${t('SAFE_UPGRADE_CONFLICTS_PSR', 'Potential psr/log compatibility issues')}</strong>
<section class="safe-upgrade-panel safe-upgrade-panel--conflict safe-upgrade-conflict">
<header class="safe-upgrade-panel__header">
<div class="safe-upgrade-panel__title-wrap">
<span class="safe-upgrade-panel__icon fa fa-code-branch" aria-hidden="true"></span>
<div>
<strong class="safe-upgrade-panel__title">${t('SAFE_UPGRADE_CONFLICTS_PSR', 'Potential psr/log compatibility issues')}</strong>
<span class="safe-upgrade-panel__subtitle">${t('SAFE_UPGRADE_CONFLICTS_HINT', 'Choose how to handle conflicts before starting the upgrade.')}</span>
</div>
</div>
${this.renderDecisionSelect('psr_log')}
</header>
<div class="safe-upgrade-panel__body">
<ul>
${Object.keys(psrConflicts).map((slug) => {
const info = psrConflicts[slug] || {};
const requires = info.requires || '*';
return `<li><code>${slug}</code> &mdash; ${r('SAFE_UPGRADE_CONFLICTS_REQUIRES', requires, 'Requires psr/log %s')}</li>`;
}).join('')}
</ul>
</div>
<ul>
${Object.keys(psrConflicts).map((slug) => {
const info = psrConflicts[slug] || {};
const requires = info.requires || '*';
return `<li><code>${slug}</code> &mdash; ${r('SAFE_UPGRADE_CONFLICTS_REQUIRES', requires, 'Requires psr/log %s')}</li>`;
}).join('')}
</ul>
</div>
</section>
` : '';
const monologList = Object.keys(monologConflicts).length ? `
<div class="safe-upgrade-conflict">
<div class="safe-upgrade-conflict-header">
<strong>${t('SAFE_UPGRADE_CONFLICTS_MONOLOG', 'Potential Monolog API compatibility issues')}</strong>
<section class="safe-upgrade-panel safe-upgrade-panel--conflict safe-upgrade-conflict">
<header class="safe-upgrade-panel__header">
<div class="safe-upgrade-panel__title-wrap">
<span class="safe-upgrade-panel__icon fa fa-wave-square" aria-hidden="true"></span>
<div>
<strong class="safe-upgrade-panel__title">${t('SAFE_UPGRADE_CONFLICTS_MONOLOG', 'Potential Monolog API compatibility issues')}</strong>
<span class="safe-upgrade-panel__subtitle">${t('SAFE_UPGRADE_CONFLICTS_HINT', 'Choose how to handle conflicts before starting the upgrade.')}</span>
</div>
</div>
${this.renderDecisionSelect('monolog')}
</div>
<ul>
${Object.keys(monologConflicts).map((slug) => {
const entries = Array.isArray(monologConflicts[slug]) ? monologConflicts[slug] : [];
const details = entries.map((entry) => {
const method = entry.method || '';
const file = entry.file ? basename(entry.file) : '';
return `<span>${method} ${file ? `<code>${file}</code>` : ''}</span>`;
}).join(', ');
</header>
<div class="safe-upgrade-panel__body">
<ul>
${Object.keys(monologConflicts).map((slug) => {
const entries = Array.isArray(monologConflicts[slug]) ? monologConflicts[slug] : [];
const details = entries.map((entry) => {
const method = entry.method || '';
const file = entry.file ? basename(entry.file) : '';
return `<span>${method} ${file ? `<code>${file}</code>` : ''}</span>`;
}).join(', ');
return `<li><code>${slug}</code> &mdash; ${details}</li>`;
}).join('')}
</ul>
</div>
return `<li><code>${slug}</code> &mdash; ${details}</li>`;
}).join('')}
</ul>
</div>
</section>
` : '';
const blockersList = blockers.length ? `
<div class="safe-upgrade-blockers">
<ul>${blockers.map((item) => `<li>${item}</li>`).join('')}</ul>
</div>
<section class="safe-upgrade-panel safe-upgrade-panel--blocker safe-upgrade-blockers">
<header class="safe-upgrade-panel__header">
<div class="safe-upgrade-panel__title-wrap">
<span class="safe-upgrade-panel__icon fa fa-ban" aria-hidden="true"></span>
<div>
<strong class="safe-upgrade-panel__title">${t('SAFE_UPGRADE_BLOCKERS_TITLE', 'Action required before continuing')}</strong>
<span class="safe-upgrade-panel__subtitle">${t('SAFE_UPGRADE_BLOCKERS_DESC', 'Resolve the following items to enable the upgrade.')}</span>
</div>
</div>
</header>
<div class="safe-upgrade-panel__body">
<ul>${blockers.map((item) => `<li>${item}</li>`).join('')}</ul>
</div>
</section>
` : '';
const summary = `
<div class="safe-upgrade-summary">
<section class="safe-upgrade-summary">
<p>${r('SAFE_UPGRADE_SUMMARY_CURRENT', version.local || '?', 'Current Grav version: <strong>v%s</strong>')}</p>
<p>${r('SAFE_UPGRADE_SUMMARY_REMOTE', version.remote || '?', 'Available Grav version: <strong>v%s</strong>')}</p>
<p>${releaseDate ? r('SAFE_UPGRADE_RELEASED_ON', releaseDate, 'Released on %s') : ''}</p>
<p>${r('SAFE_UPGRADE_PACKAGE_SIZE', packageSize, 'Package size: %s')}</p>
</div>
</section>
`;
this.steps.preflight.html(`
@@ -324,14 +371,16 @@ export default class SafeUpgrade {
}
renderDecisionSelect(type) {
const selectId = `safe-upgrade-decision-${type}`;
return `
<label class="safe-upgrade-decision">
<span>${t('SAFE_UPGRADE_DECISION_PROMPT', 'When conflicts are detected:')}</span>
<select data-safe-upgrade-decision="${type}">
<div class="safe-upgrade-panel__action safe-upgrade-decision">
<label for="${selectId}">${t('SAFE_UPGRADE_DECISION_PROMPT', 'When conflicts are detected:')}</label>
<select id="${selectId}" data-safe-upgrade-decision="${type}">
<option value="disable">${t('SAFE_UPGRADE_DECISION_DISABLE', 'Disable conflicting plugins')}</option>
<option value="continue">${t('SAFE_UPGRADE_DECISION_CONTINUE', 'Continue with plugins enabled')}</option>
</select>
</label>
</div>
`;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3665,6 +3665,10 @@ var request = function request(url) {
callback = options;
options = {};
}
var silentErrors = !!options.silentErrors;
if (options.silentErrors) {
delete options.silentErrors;
}
if (options.method && options.method === 'post') {
var data = new FormData();
options.body = Object.assign({
@@ -3688,7 +3692,14 @@ var request = function request(url) {
return response;
}).then(parseStatus).then(parseJSON).then(userFeedback).then(function (response) {
return callback(response, raw);
})["catch"](userFeedbackError);
})["catch"](function (error) {
if (silentErrors) {
console.debug('[Request] silent failure', url, error);
return undefined;
}
userFeedbackError(error);
return undefined;
});
};
/* harmony default export */ const utils_request = (request);
;// ./app/forms/fields/files.js
@@ -4755,22 +4766,22 @@ var SafeUpgrade = /*#__PURE__*/function () {
if (Object.keys(pending).length) {
blockers.push(t('SAFE_UPGRADE_PENDING_HINT', 'Update all plugins and themes before proceeding.'));
}
var warningsList = warnings.length ? "\n <div class=\"safe-upgrade-alert\">\n <strong>".concat(t('SAFE_UPGRADE_WARNINGS', 'Warnings'), "</strong>\n <ul>").concat(warnings.map(function (warning) {
var warningsList = warnings.length ? "\n <section class=\"safe-upgrade-panel safe-upgrade-panel--alert safe-upgrade-alert\">\n <header class=\"safe-upgrade-panel__header\">\n <div class=\"safe-upgrade-panel__title-wrap\">\n <span class=\"safe-upgrade-panel__icon fa fa-exclamation-triangle\" aria-hidden=\"true\"></span>\n <div>\n <strong class=\"safe-upgrade-panel__title\">".concat(t('SAFE_UPGRADE_WARNINGS', 'Warnings'), "</strong>\n <span class=\"safe-upgrade-panel__subtitle\">").concat(t('SAFE_UPGRADE_WARNINGS_HINT', 'These items may require attention before continuing.'), "</span>\n </div>\n </div>\n </header>\n <div class=\"safe-upgrade-panel__body\">\n <ul>").concat(warnings.map(function (warning) {
return "<li>".concat(warning, "</li>");
}).join(''), "</ul>\n </div>\n ") : '';
var pendingList = Object.keys(pending).length ? "\n <div class=\"safe-upgrade-pending\">\n <strong>".concat(t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates'), "</strong>\n <ul>\n ").concat(Object.keys(pending).map(function (slug) {
}).join(''), "</ul>\n </div>\n </section>\n ") : '';
var pendingList = Object.keys(pending).length ? "\n <section class=\"safe-upgrade-panel safe-upgrade-panel--info safe-upgrade-pending\">\n <header class=\"safe-upgrade-panel__header\">\n <div class=\"safe-upgrade-panel__title-wrap\">\n <span class=\"safe-upgrade-panel__icon fa fa-sync\" aria-hidden=\"true\"></span>\n <div>\n <strong class=\"safe-upgrade-panel__title\">".concat(t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates'), "</strong>\n <span class=\"safe-upgrade-panel__subtitle\">").concat(t('SAFE_UPGRADE_PENDING_INTRO', 'Review the extensions that should be updated first.'), "</span>\n </div>\n </div>\n </header>\n <div class=\"safe-upgrade-panel__body\">\n <ul>\n ").concat(Object.keys(pending).map(function (slug) {
var item = pending[slug] || {};
var type = item.type || 'plugin';
var current = item.current || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');
var next = item.available || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');
return "<li><code>".concat(slug, "</code> (").concat(type, ") ").concat(current, " &rarr; ").concat(next, "</li>");
}).join(''), "\n </ul>\n </div>\n ") : '';
var psrList = Object.keys(psrConflicts).length ? "\n <div class=\"safe-upgrade-conflict\">\n <div class=\"safe-upgrade-conflict-header\">\n <strong>".concat(t('SAFE_UPGRADE_CONFLICTS_PSR', 'Potential psr/log compatibility issues'), "</strong>\n ").concat(this.renderDecisionSelect('psr_log'), "\n </div>\n <ul>\n ").concat(Object.keys(psrConflicts).map(function (slug) {
}).join(''), "\n </ul>\n </div>\n </section>\n ") : '';
var psrList = Object.keys(psrConflicts).length ? "\n <section class=\"safe-upgrade-panel safe-upgrade-panel--conflict safe-upgrade-conflict\">\n <header class=\"safe-upgrade-panel__header\">\n <div class=\"safe-upgrade-panel__title-wrap\">\n <span class=\"safe-upgrade-panel__icon fa fa-code-branch\" aria-hidden=\"true\"></span>\n <div>\n <strong class=\"safe-upgrade-panel__title\">".concat(t('SAFE_UPGRADE_CONFLICTS_PSR', 'Potential psr/log compatibility issues'), "</strong>\n <span class=\"safe-upgrade-panel__subtitle\">").concat(t('SAFE_UPGRADE_CONFLICTS_HINT', 'Choose how to handle conflicts before starting the upgrade.'), "</span>\n </div>\n </div>\n ").concat(this.renderDecisionSelect('psr_log'), "\n </header>\n <div class=\"safe-upgrade-panel__body\">\n <ul>\n ").concat(Object.keys(psrConflicts).map(function (slug) {
var info = psrConflicts[slug] || {};
var requires = info.requires || '*';
return "<li><code>".concat(slug, "</code> &mdash; ").concat(r('SAFE_UPGRADE_CONFLICTS_REQUIRES', requires, 'Requires psr/log %s'), "</li>");
}).join(''), "\n </ul>\n </div>\n ") : '';
var monologList = Object.keys(monologConflicts).length ? "\n <div class=\"safe-upgrade-conflict\">\n <div class=\"safe-upgrade-conflict-header\">\n <strong>".concat(t('SAFE_UPGRADE_CONFLICTS_MONOLOG', 'Potential Monolog API compatibility issues'), "</strong>\n ").concat(this.renderDecisionSelect('monolog'), "\n </div>\n <ul>\n ").concat(Object.keys(monologConflicts).map(function (slug) {
}).join(''), "\n </ul>\n </div>\n </section>\n ") : '';
var monologList = Object.keys(monologConflicts).length ? "\n <section class=\"safe-upgrade-panel safe-upgrade-panel--conflict safe-upgrade-conflict\">\n <header class=\"safe-upgrade-panel__header\">\n <div class=\"safe-upgrade-panel__title-wrap\">\n <span class=\"safe-upgrade-panel__icon fa fa-wave-square\" aria-hidden=\"true\"></span>\n <div>\n <strong class=\"safe-upgrade-panel__title\">".concat(t('SAFE_UPGRADE_CONFLICTS_MONOLOG', 'Potential Monolog API compatibility issues'), "</strong>\n <span class=\"safe-upgrade-panel__subtitle\">").concat(t('SAFE_UPGRADE_CONFLICTS_HINT', 'Choose how to handle conflicts before starting the upgrade.'), "</span>\n </div>\n </div>\n ").concat(this.renderDecisionSelect('monolog'), "\n </header>\n <div class=\"safe-upgrade-panel__body\">\n <ul>\n ").concat(Object.keys(monologConflicts).map(function (slug) {
var entries = Array.isArray(monologConflicts[slug]) ? monologConflicts[slug] : [];
var details = entries.map(function (entry) {
var method = entry.method || '';
@@ -4778,11 +4789,11 @@ var SafeUpgrade = /*#__PURE__*/function () {
return "<span>".concat(method, " ").concat(file ? "<code>".concat(file, "</code>") : '', "</span>");
}).join(', ');
return "<li><code>".concat(slug, "</code> &mdash; ").concat(details, "</li>");
}).join(''), "\n </ul>\n </div>\n ") : '';
var blockersList = blockers.length ? "\n <div class=\"safe-upgrade-blockers\">\n <ul>".concat(blockers.map(function (item) {
}).join(''), "\n </ul>\n </div>\n </section>\n ") : '';
var blockersList = blockers.length ? "\n <section class=\"safe-upgrade-panel safe-upgrade-panel--blocker safe-upgrade-blockers\">\n <header class=\"safe-upgrade-panel__header\">\n <div class=\"safe-upgrade-panel__title-wrap\">\n <span class=\"safe-upgrade-panel__icon fa fa-ban\" aria-hidden=\"true\"></span>\n <div>\n <strong class=\"safe-upgrade-panel__title\">".concat(t('SAFE_UPGRADE_BLOCKERS_TITLE', 'Action required before continuing'), "</strong>\n <span class=\"safe-upgrade-panel__subtitle\">").concat(t('SAFE_UPGRADE_BLOCKERS_DESC', 'Resolve the following items to enable the upgrade.'), "</span>\n </div>\n </div>\n </header>\n <div class=\"safe-upgrade-panel__body\">\n <ul>").concat(blockers.map(function (item) {
return "<li>".concat(item, "</li>");
}).join(''), "</ul>\n </div>\n ") : '';
var summary = "\n <div class=\"safe-upgrade-summary\">\n <p>".concat(r('SAFE_UPGRADE_SUMMARY_CURRENT', version.local || '?', 'Current Grav version: <strong>v%s</strong>'), "</p>\n <p>").concat(r('SAFE_UPGRADE_SUMMARY_REMOTE', version.remote || '?', 'Available Grav version: <strong>v%s</strong>'), "</p>\n <p>").concat(releaseDate ? r('SAFE_UPGRADE_RELEASED_ON', releaseDate, 'Released on %s') : '', "</p>\n <p>").concat(r('SAFE_UPGRADE_PACKAGE_SIZE', packageSize, 'Package size: %s'), "</p>\n </div>\n ");
}).join(''), "</ul>\n </div>\n </section>\n ") : '';
var summary = "\n <section class=\"safe-upgrade-summary\">\n <p>".concat(r('SAFE_UPGRADE_SUMMARY_CURRENT', version.local || '?', 'Current Grav version: <strong>v%s</strong>'), "</p>\n <p>").concat(r('SAFE_UPGRADE_SUMMARY_REMOTE', version.remote || '?', 'Available Grav version: <strong>v%s</strong>'), "</p>\n <p>").concat(releaseDate ? r('SAFE_UPGRADE_RELEASED_ON', releaseDate, 'Released on %s') : '', "</p>\n <p>").concat(r('SAFE_UPGRADE_PACKAGE_SIZE', packageSize, 'Package size: %s'), "</p>\n </section>\n ");
this.steps.preflight.html("\n <div class=\"safe-upgrade-preflight\">\n ".concat(summary, "\n ").concat(warningsList, "\n ").concat(pendingList, "\n ").concat(psrList, "\n ").concat(monologList, "\n ").concat(blockersList, "\n <div class=\"safe-upgrade-actions inline-actions\">\n <button data-safe-upgrade-action=\"recheck\" class=\"button secondary\">").concat(t('SAFE_UPGRADE_RECHECK', 'Re-run Checks'), "</button>\n </div>\n </div>\n "));
this.switchStep('preflight');
var hasBlockingConflicts = Object.keys(psrConflicts).length && !this.decisions.psr_log || Object.keys(monologConflicts).length && !this.decisions.monolog;
@@ -4799,7 +4810,8 @@ var SafeUpgrade = /*#__PURE__*/function () {
}, {
key: "renderDecisionSelect",
value: function renderDecisionSelect(type) {
return "\n <label class=\"safe-upgrade-decision\">\n <span>".concat(t('SAFE_UPGRADE_DECISION_PROMPT', 'When conflicts are detected:'), "</span>\n <select data-safe-upgrade-decision=\"").concat(type, "\">\n <option value=\"disable\">").concat(t('SAFE_UPGRADE_DECISION_DISABLE', 'Disable conflicting plugins'), "</option>\n <option value=\"continue\">").concat(t('SAFE_UPGRADE_DECISION_CONTINUE', 'Continue with plugins enabled'), "</option>\n </select>\n </label>\n ");
var selectId = "safe-upgrade-decision-".concat(type);
return "\n <div class=\"safe-upgrade-panel__action safe-upgrade-decision\">\n <label for=\"".concat(selectId, "\">").concat(t('SAFE_UPGRADE_DECISION_PROMPT', 'When conflicts are detected:'), "</label>\n <select id=\"").concat(selectId, "\" data-safe-upgrade-decision=\"").concat(type, "\">\n <option value=\"disable\">").concat(t('SAFE_UPGRADE_DECISION_DISABLE', 'Disable conflicting plugins'), "</option>\n <option value=\"continue\">").concat(t('SAFE_UPGRADE_DECISION_CONTINUE', 'Continue with plugins enabled'), "</option>\n </select>\n </div>\n ");
}
}, {
key: "updateStartButtonState",
@@ -4913,8 +4925,8 @@ var SafeUpgrade = /*#__PURE__*/function () {
return url.replace(/([^:]\/)\/+/g, '$1');
};
var candidates = [external_GravAdmin_namespaceObject.config.base_url_simple || '', (external_GravAdmin_namespaceObject.config.base_url_relative || '').replace(/\/admin\/?$/, ''), ''];
for (var i = 0; i < candidates.length; i += 1) {
var base = candidates[i];
for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
var base = _candidates[_i];
if (typeof base !== 'string') {
continue;
}
@@ -4938,7 +4950,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
params.push("context=".concat(encodeURIComponent(this.statusContext)));
}
if (params.length) {
url += (url.indexOf('?') !== -1 ? '&' : '?') + params.join('&');
url += (url.includes('?') ? '&' : '?') + params.join('&');
}
return {
url: url,
@@ -5100,6 +5112,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
}, {
key: "renderProgress",
value: function renderProgress(data) {
var _this7 = this;
var job = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!data) {
return;
@@ -5112,7 +5125,6 @@ var SafeUpgrade = /*#__PURE__*/function () {
var titleResolver = STAGE_TITLES[stage] || STAGE_TITLES.initializing;
var title = titleResolver();
var percent = typeof data.percent === 'number' ? data.percent : null;
var self = this;
var scaledPercent = function scaledPercent() {
if (stage === 'queued') {
return 0;
@@ -5127,10 +5139,10 @@ var SafeUpgrade = /*#__PURE__*/function () {
return 12;
}
if (stage === 'installing') {
return self.computeSmoothPercent(20, 90, 28, percent);
return _this7.computeSmoothPercent(20, 90, 28, percent);
}
if (stage === 'finalizing') {
return self.computeSmoothPercent(90, 99, 6, percent);
return _this7.computeSmoothPercent(90, 99, 6, percent);
}
if (stage === 'complete') {
return 100;
@@ -5191,37 +5203,34 @@ var SafeUpgrade = /*#__PURE__*/function () {
}, {
key: "switchStep",
value: function switchStep(step) {
var _this7 = this;
var _this8 = this;
Object.keys(this.steps).forEach(function (handle) {
var isActive = handle === step;
_this7.steps[handle].toggle(isActive);
_this7.steps[handle].toggleClass('hidden', !isActive);
_this8.steps[handle].toggle(isActive);
_this8.steps[handle].toggleClass('hidden', !isActive);
});
}
}, {
key: "computeSmoothPercent",
value: function computeSmoothPercent(base, target, durationSeconds, actualPercent) {
var span = target - base;
if (span <= 0) {
if (actualPercent !== null && !Number.isNaN(actualPercent)) {
return Math.min(Math.max(actualPercent, base), target);
}
return base;
}
var elapsed = Math.max(0, (Date.now() - this.stageEnteredAt) / 1000);
var ratio = Math.min(1, elapsed / Math.max(durationSeconds, 1));
var smooth = base + ratio * span;
if (actualPercent !== null && !Number.isNaN(actualPercent)) {
smooth = Math.max(smooth, Math.min(actualPercent, target));
}
return Math.min(smooth, target);
}
}, {
key: "stopPolling",
value: function stopPolling() {
this.isPolling = false;
this.clearPollTimer();
}
}, {
key: "computeSmoothPercent",
value: function computeSmoothPercent(base, target, durationSeconds, actualPercent) {
var span = target - base;
if (span <= 0) {
return actualPercent !== null ? Math.min(Math.max(actualPercent, base), target) : base;
}
var elapsed = Math.max(0, (Date.now() - this.stageEnteredAt) / 1000);
var progressRatio = Math.min(1, elapsed / Math.max(durationSeconds, 1));
var smooth = base + progressRatio * span;
if (actualPercent !== null && !Number.isNaN(actualPercent)) {
smooth = Math.max(smooth, Math.min(actualPercent, target));
}
return Math.min(smooth, target);
}
}]);
}();
@@ -14388,4 +14397,4 @@ external_jQuery_default()(__webpack_require__.g).on('sidebar_state._grav', funct
/******/ Grav = __webpack_exports__;
/******/
/******/ })()
;
;

View File

@@ -754,47 +754,133 @@ body.sidebar-quickopen #admin-main {
}
.safe-upgrade-summary {
margin-bottom: 1rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 0.75rem 1.25rem;
background: rgba(20, 42, 68, 0.05);
border: 1px solid rgba(20, 42, 68, 0.12);
border-radius: 8px;
padding: 1rem 1.25rem;
margin-bottom: 1.35rem;
p {
margin: 0 0 0.35rem;
margin: 0;
display: flex;
flex-direction: column;
font-weight: 500;
color: #2f3b48;
strong {
font-size: 1.05rem;
margin-top: 0.2rem;
font-weight: 600;
color: #0e355a;
}
}
}
.safe-upgrade-alert,
.safe-upgrade-pending,
.safe-upgrade-conflict,
.safe-upgrade-blockers {
background: rgba(0, 0, 0, 0.04);
border-radius: 4px;
padding: 0.75rem;
margin-bottom: 0.85rem;
.safe-upgrade-panel {
--safe-upgrade-accent: #3f83d1;
background: #ffffff;
border: 1px solid rgba(20, 42, 68, 0.14);
border-left: 6px solid var(--safe-upgrade-accent);
border-radius: 8px;
padding: 1rem 1.25rem 1.15rem;
margin-bottom: 1.15rem;
box-shadow: 0 4px 14px rgba(15, 24, 44, 0.08);
ul {
margin: 0.5rem 0 0;
padding: 0 0 0 1.2rem;
&__header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: flex-start;
gap: 1rem;
}
}
.safe-upgrade-conflict-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.75rem;
margin-bottom: 0.5rem;
select {
width: auto;
&__title-wrap {
display: flex;
align-items: flex-start;
gap: 0.85rem;
}
}
.safe-upgrade-decision {
display: flex;
align-items: center;
gap: 0.5rem;
&__icon {
display: flex;
align-items: center;
justify-content: center;
width: 2.5rem;
height: 2.5rem;
border-radius: 50%;
background: var(--safe-upgrade-accent);
color: #ffffff;
font-size: 1.2rem;
box-shadow: 0 2px 6px rgba(15, 24, 44, 0.16);
}
span {
font-weight: 600;
&__title {
display: block;
font-size: 1.05rem;
line-height: 1.35;
}
&__subtitle {
display: block;
margin-top: 0.15rem;
font-size: 0.9rem;
color: rgba(47, 59, 72, 0.8);
}
&__body {
margin-top: 0.85rem;
ul {
margin: 0;
padding: 0 0 0 1.25rem;
display: flex;
flex-direction: column;
gap: 0.35rem;
color: #2f3b48;
}
}
&__action {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.3rem;
min-width: 200px;
flex: 1 1 200px;
width: 100%;
label {
margin: 0;
font-size: 0.85rem;
font-weight: 600;
color: rgba(47, 59, 72, 0.85);
}
select {
width: 100%;
}
}
&--alert {
--safe-upgrade-accent: #e67e22;
background: rgba(230, 126, 34, 0.08);
}
&--info {
--safe-upgrade-accent: #17a2b8;
background: rgba(23, 162, 184, 0.08);
}
&--conflict {
--safe-upgrade-accent: #8e44ad;
background: rgba(142, 68, 173, 0.08);
}
&--blocker {
--safe-upgrade-accent: #c0392b;
background: rgba(192, 57, 43, 0.08);
}
}
@@ -835,6 +921,18 @@ body.sidebar-quickopen #admin-main {
}
}
.safe-upgrade-actions {
display: flex;
justify-content: flex-end;
padding-top: 1rem;
margin-top: 1.5rem;
border-top: 1px solid rgba(20, 42, 68, 0.12);
.button {
min-width: 9rem;
}
}
.safe-upgrade-result {
h3 {
margin-bottom: 0.5rem;

View File

@@ -13,12 +13,146 @@
margin-bottom: 1rem;
.safe-upgrade-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 0.75rem 1.25rem;
background: rgba(20, 42, 68, 0.05);
border: 1px solid rgba(20, 42, 68, 0.12);
border-radius: 8px;
padding: 1rem 1.25rem;
margin-bottom: 1.35rem;
p {
margin: 0.25rem 0;
margin: 0;
display: flex;
flex-direction: column;
font-weight: 500;
color: #2f3b48;
strong {
font-size: 1.05rem;
margin-top: 0.2rem;
font-weight: 600;
color: #0e355a;
}
}
}
.safe-upgrade-panel {
--safe-upgrade-accent: #3f83d1;
background: #ffffff;
border: 1px solid rgba(20, 42, 68, 0.14);
border-left: 6px solid var(--safe-upgrade-accent);
border-radius: 8px;
padding: 1rem 1.25rem 1.15rem;
margin-bottom: 1.15rem;
box-shadow: 0 4px 14px rgba(15, 24, 44, 0.08);
&__header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: flex-start;
gap: 1rem;
}
&__title-wrap {
display: flex;
align-items: flex-start;
gap: 0.85rem;
}
&__icon {
display: flex;
align-items: center;
justify-content: center;
width: 2.5rem;
height: 2.5rem;
border-radius: 50%;
background: var(--safe-upgrade-accent);
color: #ffffff;
font-size: 1.2rem;
box-shadow: 0 2px 6px rgba(15, 24, 44, 0.16);
}
&__title {
display: block;
font-size: 1.05rem;
line-height: 1.35;
}
&__subtitle {
display: block;
margin-top: 0.15rem;
font-size: 0.9rem;
color: rgba(47, 59, 72, 0.8);
}
&__body {
margin-top: 0.85rem;
ul {
margin: 0;
padding: 0 0 0 1.25rem;
display: flex;
flex-direction: column;
gap: 0.35rem;
color: #2f3b48;
}
}
&__action {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.3rem;
min-width: 200px;
flex: 1 1 200px;
width: 100%;
label {
margin: 0;
font-size: 0.85rem;
font-weight: 600;
color: rgba(47, 59, 72, 0.85);
}
select {
width: 100%;
}
}
&--alert {
--safe-upgrade-accent: #e67e22;
background: rgba(230, 126, 34, 0.08);
}
&--info {
--safe-upgrade-accent: #17a2b8;
background: rgba(23, 162, 184, 0.08);
}
&--conflict {
--safe-upgrade-accent: #8e44ad;
background: rgba(142, 68, 173, 0.08);
}
&--blocker {
--safe-upgrade-accent: #c0392b;
background: rgba(192, 57, 43, 0.08);
}
}
.safe-upgrade-actions {
display: flex;
justify-content: flex-end;
padding-top: 1rem;
margin-top: 1.5rem;
border-top: 1px solid rgba(20, 42, 68, 0.12);
.button {
min-width: 9rem;
}
}
.safe-upgrade-loading {
@@ -78,28 +212,6 @@
margin-bottom: 0.5rem;
}
}
.safe-upgrade-conflict-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
strong {
flex: 0 1 auto;
}
.safe-upgrade-decision {
flex: 0 0 auto;
min-width: 220px;
max-width: 100%;
select {
width: 100%;
}
}
}
}
}