Parcourir la source

:bug: remove invalid requests during boot (#10227)

Reverier Xu il y a 1 an
Parent
commit
beefd871e9
1 fichiers modifiés avec 0 ajouts et 31 suppressions
  1. 0 31
      app/electron/boot.html

+ 0 - 31
app/electron/boot.html

@@ -30,10 +30,6 @@
          style="color: #9aa0a6;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;padding: 8px;height: 16px;line-height: 16px;"></div>
          style="color: #9aa0a6;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;padding: 8px;height: 16px;line-height: 16px;"></div>
 </div>
 </div>
 <script>
 <script>
-    const sleep = (ms) => {
-        return new Promise(resolve => setTimeout(resolve, ms))
-    }
-
     const getSearch = (key) => {
     const getSearch = (key) => {
         if (window.location.search.indexOf('?') === -1) {
         if (window.location.search.indexOf('?') === -1) {
             return ''
             return ''
@@ -49,36 +45,9 @@
         })
         })
         return value
         return value
     }
     }
-
-    const redirect = () => {
-        const uri = 'http://127.0.0.1:' + location.port
-        if (navigator.userAgent.match(/Android/i))
-            document.location = uri
-        else
-            window.location.replace(uri)
-    }
     (async () => {
     (async () => {
         const v = getSearch('v')
         const v = getSearch('v')
         document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
         document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
-        let progressing = false
-        while (!progressing) {
-            try {
-                const progressResult = await fetch('http://127.0.0.1:' + location.port + '/api/system/bootProgress')
-                const progressData = await progressResult.json()
-                document.getElementById('progress').style.width = progressData.data.progress + '%'
-                document.getElementById('details').textContent = progressData.data.details
-                if (progressData.data.progress >= 100) {
-                    progressing = true
-                    if (navigator.userAgent.indexOf('Electron') === -1) {
-                        redirect()
-                    }
-                } else {
-                    await sleep(100)
-                }
-            } catch (e) {
-                await sleep(100)
-            }
-        }
     })()
     })()
 </script>
 </script>
 </body>
 </body>