Răsfoiți Sursa

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

oidt 2 luni în urmă
părinte
comite
521808b101
1 a modificat fișierele cu 6 adăugiri și 1 ștergeri
  1. 6 1
      packages/dashboard/plugin/default-page.html

+ 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') {