瀏覽代碼

code review

Falko Schindler 1 年之前
父節點
當前提交
af4cd78b69
共有 3 個文件被更改,包括 8 次插入8 次删除
  1. 2 2
      nicegui/run.py
  2. 1 1
      nicegui/templates/index.html
  3. 5 5
      website/documentation.py

+ 2 - 2
nicegui/run.py

@@ -1,4 +1,3 @@
-from .air import Air
 import logging
 import logging
 import multiprocessing
 import multiprocessing
 import os
 import os
@@ -16,6 +15,7 @@ from uvicorn.supervisors import ChangeReload, Multiprocess
 from . import globals, helpers
 from . import globals, helpers
 from . import native as native_module
 from . import native as native_module
 from . import native_mode
 from . import native_mode
+from .air import Air
 from .language import Language
 from .language import Language
 
 
 APP_IMPORT_STRING = 'nicegui:app'
 APP_IMPORT_STRING = 'nicegui:app'
@@ -70,7 +70,7 @@ def run(*,
     :param language: language for Quasar elements (default: `'en-US'`)
     :param language: language for Quasar elements (default: `'en-US'`)
     :param binding_refresh_interval: time between binding updates (default: `0.1` seconds, bigger is more CPU friendly)
     :param binding_refresh_interval: time between binding updates (default: `0.1` seconds, bigger is more CPU friendly)
     :param show: automatically open the UI in a browser tab (default: `True`)
     :param show: automatically open the UI in a browser tab (default: `True`)
-    :param on_air: Tech-Preview: `allows temporary remote access <https://nicegui.io/documentation#nicegui_on_air>`_ if set to True (default: disabled)
+    :param on_air: tech preview: `allows temporary remote access <https://nicegui.io/documentation#nicegui_on_air>`_ if set to `True` (default: disabled)
     :param native: open the UI in a native window of size 800x600 (default: `False`, deactivates `show`, automatically finds an open port)
     :param native: open the UI in a native window of size 800x600 (default: `False`, deactivates `show`, automatically finds an open port)
     :param window_size: open the UI in a native window with the provided size (e.g. `(1024, 786)`, default: `None`, also activates `native`)
     :param window_size: open the UI in a native window with the provided size (e.g. `(1024, 786)`, default: `None`, also activates `native`)
     :param fullscreen: open the UI in a fullscreen window (default: `False`, also activates `native`)
     :param fullscreen: open the UI in a fullscreen window (default: `False`, also activates `native`)

+ 1 - 1
nicegui/templates/index.html

@@ -234,7 +234,7 @@
           });
           });
           window.socket.on("try_reconnect", () => {
           window.socket.on("try_reconnect", () => {
             const checkAndReload = async () => {
             const checkAndReload = async () => {
-              await fetch(window.location.href, { headers: { 'NiceGUI-Check': 'try_reconnect' }, });
+              await fetch(window.location.href, { headers: { 'NiceGUI-Check': 'try_reconnect' } });
               window.location.reload();
               window.location.reload();
             };
             };
             setInterval(checkAndReload, 500);
             setInterval(checkAndReload, 500);

+ 5 - 5
website/documentation.py

@@ -750,18 +750,18 @@ def create_full() -> None:
 
 
     ui.markdown('''
     ui.markdown('''
         By using `ui.run(on_air=True)` you can share your local app with others over the internet 🧞.
         By using `ui.run(on_air=True)` you can share your local app with others over the internet 🧞.
-                
+
         When accessing the on-air URL, all libraries (like Vue, Quasar, ...) are loaded from our CDN.
         When accessing the on-air URL, all libraries (like Vue, Quasar, ...) are loaded from our CDN.
         Thereby only the raw content and events need to be transmitted by your local app.
         Thereby only the raw content and events need to be transmitted by your local app.
         This makes it blazing fast even if your app only has a poor internet connection (e.g. a mobile robot in the field).
         This makes it blazing fast even if your app only has a poor internet connection (e.g. a mobile robot in the field).
 
 
-        Currently "On Air" is available as tech preview and generates a random URL that is valid for 1 hour.
+        Currently "On Air" is available as a tech preview and generates a random URL that is valid for 1 hour.
         We will gradually improve stability and extend the service with password protection, custom URLs and more.
         We will gradually improve stability and extend the service with password protection, custom URLs and more.
-        Please let us know your feedback on [GitHub](https://github.com/zauberzeug/nicegui/discussions), 
+        Please let us know your feedback on [GitHub](https://github.com/zauberzeug/nicegui/discussions),
         [Reddit](https://www.reddit.com/r/nicegui/), or [Discord](https://discord.gg/3XkZVYJ).
         [Reddit](https://www.reddit.com/r/nicegui/), or [Discord](https://discord.gg/3XkZVYJ).
-        
+
         **Data Privacy:**
         **Data Privacy:**
-        We take your privacy very serious. 
+        We take your privacy very serious.
         NiceGUI On Air does not log or store any content of the relayed data.
         NiceGUI On Air does not log or store any content of the relayed data.
     ''').classes('bold-links arrow-links')
     ''').classes('bold-links arrow-links')