feat(admin): expand exchange admin and unify admin UX
Some checks failed
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m39s
CI/CD Pipeline / Run Tests (pull_request) Successful in 3m0s
CI/CD Pipeline / Run API Inventory E2E Tests (pull_request) Successful in 35s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped

This commit is contained in:
2026-03-24 13:58:24 +01:00
parent 559b9bc5ef
commit c98ba76081
33 changed files with 2915 additions and 209 deletions

View File

@@ -0,0 +1,153 @@
(function () {
const SIDEBAR_SELECTOR = ".main-sidebar";
const CONTAINER_ID = "mx-sidebar-particles";
const DESKTOP_MEDIA_QUERY =
"(min-width: 992px) and (prefers-reduced-motion: no-preference)";
let particlesLoaderPromise = null;
function getVendorUrl() {
const currentScript = document.currentScript;
if (currentScript && currentScript.src) {
return new URL("./vendor/particles.min.js", currentScript.src).href;
}
return "/static/admin/js/vendor/particles.min.js";
}
function loadParticlesLibrary() {
if (window.particlesJS) {
return Promise.resolve();
}
if (particlesLoaderPromise) {
return particlesLoaderPromise;
}
particlesLoaderPromise = new Promise((resolve, reject) => {
const script = document.createElement("script");
script.src = getVendorUrl();
script.async = true;
script.onload = resolve;
script.onerror = reject;
document.head.appendChild(script);
});
return particlesLoaderPromise;
}
function shouldEnableParticles() {
return window.matchMedia(DESKTOP_MEDIA_QUERY).matches;
}
function ensureContainer(sidebar) {
let container = document.getElementById(CONTAINER_ID);
if (container) {
return container;
}
container = document.createElement("div");
container.id = CONTAINER_ID;
container.setAttribute("aria-hidden", "true");
sidebar.prepend(container);
return container;
}
function initSidebarParticles() {
const sidebar = document.querySelector(SIDEBAR_SELECTOR);
if (!sidebar || !shouldEnableParticles() || document.getElementById(CONTAINER_ID)) {
return;
}
loadParticlesLibrary()
.then(() => {
if (!window.particlesJS || document.getElementById(CONTAINER_ID)) {
return;
}
ensureContainer(sidebar);
window.particlesJS(CONTAINER_ID, {
particles: {
number: {
value: 52,
density: {
enable: true,
value_area: 900,
},
},
color: {
value: ["#49d0c8", "#8cefeb", "#dffdfb", "#8ba8ff"],
},
shape: {
type: "circle",
},
opacity: {
value: 0.52,
random: true,
anim: {
enable: true,
speed: 0.7,
opacity_min: 0.18,
sync: false,
},
},
size: {
value: 3.8,
random: true,
anim: {
enable: true,
speed: 2.2,
size_min: 1,
sync: false,
},
},
line_linked: {
enable: true,
distance: 142,
color: "#7be8df",
opacity: 0.2,
width: 1.15,
},
move: {
enable: true,
speed: 1.28,
direction: "none",
random: true,
straight: false,
out_mode: "out",
bounce: false,
},
},
interactivity: {
detect_on: "canvas",
events: {
onhover: {
enable: false,
},
onclick: {
enable: false,
},
resize: true,
},
},
retina_detect: true,
});
})
.catch(() => {
// Silently skip the effect if the vendor script fails to load.
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initSidebarParticles, { once: true });
} else {
initSidebarParticles();
}
})();

File diff suppressed because one or more lines are too long