1
0
Эх сурвалжийг харах

fix(dashboard): get the right vite __status on the starting page (#3891)

oidt 2 сар өмнө
parent
commit
521808b101

+ 6 - 1
packages/dashboard/plugin/default-page.html

@@ -148,8 +148,13 @@
         let pollInterval;
         let statusElement = document.getElementById('status');
 
+        function statusUrlForCurrentPath() {
+            const segments = location.pathname.split('/').filter(Boolean);
+            return segments.length === 0 ? '/__status' : `/${segments[0]}/__status`;
+        }
+
         function pollStatus() {
-            fetch('__status')
+            fetch(statusUrlForCurrentPath())
                 .then(response => response.json())
                 .then(data => {
                     if (data.mode === 'vite') {