entari-plugin-webui 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- entari_plugin_webui-1.0.0/PKG-INFO +131 -0
- entari_plugin_webui-1.0.0/README.md +117 -0
- entari_plugin_webui-1.0.0/pyproject.toml +108 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/__init__.py +131 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/adapter.py +232 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/__init__.py +3 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/auth.py +107 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/config.py +39 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/deps.py +24 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/extensions.py +21 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/health.py +21 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/logs.py +40 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/market.py +63 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/menus.py +29 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/plugins.py +51 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/router.py +101 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/api/stats.py +13 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/config.py +16 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/__init__.py +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/audit.py +8 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/error.py +58 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/extension.py +134 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/i18n.py +21 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/log_stream.py +71 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/permissions.py +17 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/security.py +89 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/core/session.py +55 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/models/__init__.py +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/models/stats.py +13 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/services/__init__.py +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/services/config_service.py +180 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/services/market_service.py +181 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/services/package_manager.py +113 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/services/plugin_service.py +96 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/services/stats_service.py +80 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/.gitkeep +0 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Chat-CaGJsFaQ.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Chat-CtSM30GL.js +3 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Dashboard-DWOzkbJ2.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Dashboard-VhlTN5Pp.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/ExtensionPage-CqCQibPd.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/ExtensionPage-jLULI21o.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Login-DWplnA3S.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Login-Z9pRTEPM.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Logs-ZKt_DKBY.js +3 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Logs-woONf-h0.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Market-CBFEZqhH.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Market-DRJ1QS_i.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Settings-BMb0Nxa4.js +944 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/Settings-DZ6dtk9x.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/abap-DRC6TkPh.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/apex-BuapDI9Y.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/azcli-BypH-vXm.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/bat-BY6pwuIY.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/bicep-gRuQeaLk.js +7 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/c-BIGW1oBm.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/cameligo-ul-Lp4lw.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/clojure-DeYg-96x.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/codicon-DCmgc-ay.ttf +0 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/coffee-CfnpWUYo.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/cpp-C9L3yaDO.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/cpp-DIPi6g--.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/csharp-DWGz5Zuj.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/csp-DrRCxMg5.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/css-BfLuTCmN.js +8 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/css-CLj8gQPS.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/cssMode-Bb6LZ5kP.js +9 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/cypher-DoFvH58O.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/dart-DIovg4uR.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/docker-BcOcwvcX.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/dockerfile-D2PfwrvU.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/ecl-C_scCXcs.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/editor.worker-Z-F9bRfX.js +11 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/elixir-BRk-K-rg.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/flow9-DLs3tTet.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/freemarker2-C6tiMqiu.js +8 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/fsharp-D0UiDa5C.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/go-C27-OAKa.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/go-CyVeKkvQ.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/graphql-BygKL3ZF.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/handlebars-BaFdx4N6.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/hcl-D_OY6ada.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/html-kcteW3br.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/html-pp8916En.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/htmlMode-DX-hmsgL.js +9 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/index-CNTptdPF.js +178 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/index-DGqFI5c2.css +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/ini-BEwlwnbL.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/ini-BTpWsGps.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/java-3TATJI7h.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/java-CylS5w8V.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/javascript-BmsOxqGW.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/javascript-wDzz0qaB.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/json-Cp-IABpG.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/json.worker-aYIWSs1k.js +48 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/jsonMode-DKWQYMua.js +15 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/jsx-g9-lgVsj.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/julia-DDpSJMW6.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/kotlin-DVYH6Lj_.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/less-CuFlys0T.js +7 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/lexon-m09vb5r-.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/liquid-u0eWJ0Zm.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/logo-BLRhia6f.svg +71 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/lua-D2Z7JJdl.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/m3-B2Cf9XSq.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/markdown-BXYnMxBe.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/markdown-Cvjx9yec.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/mdx-2iLb9JPW.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/mips-Ckkbw-AO.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/msdax-B5uW3Zvf.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/mysql-B8ssZoUh.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/objective-c-CrrKwR0a.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/pascal-BWBTHuhh.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/pascaligo-BGLI1Hdo.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/perl-DDrv2Hr-.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/pgsql-DLPipH_Q.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/php-CTNlIIiR.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/pla-2oJWbEOo.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/postiats-DOk3G3cc.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/powerquery-Dgyr3wWZ.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/powershell-B_i9asfM.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/powershell-Dpen1YoG.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/protobuf-CV9EbfTh.js +7 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/pug-CCBS_C5_.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/python-B6aJPvgy.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/python-DRt4FMw4.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/qsharp-BLuZWbUW.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/r-CzF1MCbP.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/razor-BhGEOgFX.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/redis-C75U4IDy.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/redshift-Bc5xkKR1.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/restructuredtext-DmdQbaLT.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/ruby-DB0RB20n.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/rust-B1yitclQ.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/rust-UMmp-gVE.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/sb-DVG02705.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/scala-DvSxYeG4.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/scheme-yf5bffbF.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/scss-Bzb7OGdO.js +8 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/shell-CEILq0vU.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/shell-FNqbgIOG.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/solidity-DyKutqhl.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/sophia-B4VqtPa2.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/sparql-B7alP455.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/sql-CRqJ_cUM.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/sql-D7lU1fdU.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/st-VuadG5SK.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/swift-BYtUz8ZP.js +8 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/systemverilog-DOAuugfS.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/tcl-CXKOl_mN.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/toml-vGWfd6FD.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/tsMode-D_fzWOEs.js +16 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/tsx-COt5Ahok.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/twig-D9yiNO04.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/typescript-BPQ3VLAy.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/typescript-C809Del3.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/typespec-BupSXVCO.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/vb-ZlaFEk-P.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/vue-DMJtu8ND.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/wgsl-B-lZjTdr.js +303 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/xml-CRM7UJ29.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/xml-sdJ4AIDG.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/yaml-Buea-lGh.js +1 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/assets/yaml-C3lZ9fhp.js +6 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/favicon.ico +0 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/favicon.svg +71 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/frontend/index.html +3 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/static/marketplace.json +74 -0
- entari_plugin_webui-1.0.0/src/entari_plugin_webui/utils.py +3 -0
- entari_plugin_webui-1.0.0/tests/__init__.py +0 -0
- entari_plugin_webui-1.0.0/tests/api/test_auth.py +60 -0
- entari_plugin_webui-1.0.0/tests/api/test_config.py +33 -0
- entari_plugin_webui-1.0.0/tests/api/test_extensions.py +8 -0
- entari_plugin_webui-1.0.0/tests/api/test_logs.py +21 -0
- entari_plugin_webui-1.0.0/tests/api/test_market.py +34 -0
- entari_plugin_webui-1.0.0/tests/api/test_plugins.py +29 -0
- entari_plugin_webui-1.0.0/tests/api/test_stats.py +17 -0
- entari_plugin_webui-1.0.0/tests/conftest.py +120 -0
- entari_plugin_webui-1.0.0/tests/core/test_extension.py +46 -0
- entari_plugin_webui-1.0.0/tests/core/test_log_stream.py +41 -0
- entari_plugin_webui-1.0.0/tests/core/test_security.py +30 -0
- entari_plugin_webui-1.0.0/tests/core/test_session.py +42 -0
- entari_plugin_webui-1.0.0/tests/services/test_config_service.py +68 -0
- entari_plugin_webui-1.0.0/tests/services/test_market_service.py +93 -0
- entari_plugin_webui-1.0.0/tests/services/test_package_manager.py +102 -0
- entari_plugin_webui-1.0.0/tests/services/test_plugin_service.py +88 -0
- entari_plugin_webui-1.0.0/tests/services/test_stats_service.py +13 -0
- entari_plugin_webui-1.0.0/tests/test_health.py +11 -0
- entari_plugin_webui-1.0.0/tests/test_live_routes.py +16 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: entari-plugin-webui
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: WebUI Plugin for Entari
|
|
5
|
+
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: arclet-entari[dotenv,yaml]>=0.18.0
|
|
9
|
+
Requires-Dist: entari-plugin-server>=0.7.1
|
|
10
|
+
Requires-Dist: entari-plugin-database>=0.3.2
|
|
11
|
+
Requires-Dist: fastapi>=0.135.1
|
|
12
|
+
Requires-Dist: ansi2html>=1.9.2
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# entari-plugin-webui
|
|
16
|
+
|
|
17
|
+
基于 Vite + Vue 3 + Element Plus 的 [Entari](https://github.com/ArcletProject/arclet-entari) 可视化管理面板。
|
|
18
|
+
|
|
19
|
+
## 功能特性
|
|
20
|
+
|
|
21
|
+
- **仪表盘** — 消息统计、运行状态一览(ECharts)
|
|
22
|
+
- **配置管理** — 可视化编辑所有插件配置,支持 YAML 源码与表单双模式
|
|
23
|
+
- **插件管理** — 查看/启用/停用/重载插件
|
|
24
|
+
- **插件市场** — 浏览、安装、卸载社区插件
|
|
25
|
+
- **实时日志** — WebSocket 流式日志查看,支持 ANSI 转义渲染
|
|
26
|
+
- **在线聊天** — 基于 Satori 协议的浏览器内聊天界面
|
|
27
|
+
- **扩展机制** — 其他插件可通过 `webui_extend` 注册菜单、页面、路由、国际化、权限
|
|
28
|
+
- **主题切换** — 明暗主题一键切换
|
|
29
|
+
- **会话管理** — 基于 Cookie 的登录会话,自动过期
|
|
30
|
+
- **登录限流** — 防暴力破解
|
|
31
|
+
|
|
32
|
+
## 安装
|
|
33
|
+
|
|
34
|
+
### pip
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install entari-plugin-webui
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### pdm
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pdm add entari-plugin-webui
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 配置示例
|
|
47
|
+
|
|
48
|
+
在 `entari.yml` 中启用插件:
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
plugins:
|
|
52
|
+
server:
|
|
53
|
+
port: 8765 # WebUI 服务端口
|
|
54
|
+
path: "satori"
|
|
55
|
+
direct_adapter: true
|
|
56
|
+
database:
|
|
57
|
+
name: .entari/database.db # 统计数据用 SQLite
|
|
58
|
+
webui: {} # 启动 WebUI 面板
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
完整字段说明:
|
|
62
|
+
|
|
63
|
+
| 字段 | 默认值 | 说明 |
|
|
64
|
+
|------|--------|------|
|
|
65
|
+
| `password` | `""` | 登录密码(远程部署必填,本地可省略) |
|
|
66
|
+
| `registry_url` | `""` | 插件市场地址 |
|
|
67
|
+
| `package_manager` | `""` | 包管理器(自动探测 pip/pdm/uv/poetry/rye/pipenv) |
|
|
68
|
+
| `session_ttl` | `43200` | 会话过期时间(秒,默认 12 小时) |
|
|
69
|
+
| `log_buffer_lines` | `5000` | 日志缓冲区行数 |
|
|
70
|
+
| `login_rate_limit` | `5/60s` | 登录频率限制 |
|
|
71
|
+
|
|
72
|
+
## 认证说明
|
|
73
|
+
|
|
74
|
+
- **本地部署**(`host=127.0.0.1/localhost/::1`):自动免认证,无需密码即可登录
|
|
75
|
+
- **远程部署**:首次启动时自动生成随机 16 位密码并输出到控制台日志
|
|
76
|
+
|
|
77
|
+
## 故障恢复
|
|
78
|
+
|
|
79
|
+
忘记密码时,删除配置中的 `plugins.webui.password` 字段(或置空),重启后即重新生成新密码:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
plugins:
|
|
83
|
+
webui: {}
|
|
84
|
+
# password 字段可删除或留空
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 扩展开发
|
|
88
|
+
|
|
89
|
+
其他 Entari 插件可通过 `webui_extend` 注册前端扩展,无需修改本插件源码。
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from entari_plugin_webui.core.extension import webui_extend
|
|
93
|
+
|
|
94
|
+
ext = webui_extend("my_plugin")
|
|
95
|
+
|
|
96
|
+
# 注册侧栏菜单
|
|
97
|
+
ext.add_menu("my_plugin.name", "mdi:account", "/extension/my_plugin")
|
|
98
|
+
|
|
99
|
+
# 注册 iframe 页面
|
|
100
|
+
ext.add_page("my_plugin", "my_plugin.name", "mdi:account",
|
|
101
|
+
"http://127.0.0.1:3000/", permission="my_plugin.access")
|
|
102
|
+
|
|
103
|
+
# 注册后端 API 路由
|
|
104
|
+
ext.add_route("/api/my-plugin/hello", ["GET"], my_handler, permission="my_plugin.access")
|
|
105
|
+
|
|
106
|
+
# 注册国际化文案
|
|
107
|
+
ext.add_i18n("zh-CN", "my_plugin.name", "我的插件")
|
|
108
|
+
ext.add_i18n("en-US", "my_plugin.name", "My Plugin")
|
|
109
|
+
|
|
110
|
+
# 注册权限项
|
|
111
|
+
ext.add_permission("my_plugin.access", "my_plugin.permission.access")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`WebUIExtension` 方法总览:
|
|
115
|
+
|
|
116
|
+
| 方法 | 参数 | 说明 |
|
|
117
|
+
|------|------|------|
|
|
118
|
+
| `add_menu` | `label_key, icon, path, order, badge_key, children` | 添加侧栏菜单项 |
|
|
119
|
+
| `add_page` | `key, label_key, icon, component_url, permission` | 添加 iframe 页面 |
|
|
120
|
+
| `add_route` | `path, methods, handler, permission` | 添加后端 HTTP 路由 |
|
|
121
|
+
| `add_websocket_route` | `path, handler, permission` | 添加后端 WebSocket 路由 |
|
|
122
|
+
| `add_i18n` | `locale, key, value` | 添加国际化翻译 |
|
|
123
|
+
| `add_permission` | `key, label_key` | 添加权限定义 |
|
|
124
|
+
|
|
125
|
+
## 风险须知
|
|
126
|
+
|
|
127
|
+
> [!WARNING]
|
|
128
|
+
> - 扩展页面以 **iframe 沙箱** 加载,与主面板隔离运行
|
|
129
|
+
> - 扩展来源 **仅限本机已安装的插件**,不支持加载外部站点
|
|
130
|
+
> - 各扩展通过 `postMessage` 与主面板通信,无法直接操作 DOM 或获取全局状态
|
|
131
|
+
> - 安装插件市场中的第三方插件前,请自行评估其安全性
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# entari-plugin-webui
|
|
2
|
+
|
|
3
|
+
基于 Vite + Vue 3 + Element Plus 的 [Entari](https://github.com/ArcletProject/arclet-entari) 可视化管理面板。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- **仪表盘** — 消息统计、运行状态一览(ECharts)
|
|
8
|
+
- **配置管理** — 可视化编辑所有插件配置,支持 YAML 源码与表单双模式
|
|
9
|
+
- **插件管理** — 查看/启用/停用/重载插件
|
|
10
|
+
- **插件市场** — 浏览、安装、卸载社区插件
|
|
11
|
+
- **实时日志** — WebSocket 流式日志查看,支持 ANSI 转义渲染
|
|
12
|
+
- **在线聊天** — 基于 Satori 协议的浏览器内聊天界面
|
|
13
|
+
- **扩展机制** — 其他插件可通过 `webui_extend` 注册菜单、页面、路由、国际化、权限
|
|
14
|
+
- **主题切换** — 明暗主题一键切换
|
|
15
|
+
- **会话管理** — 基于 Cookie 的登录会话,自动过期
|
|
16
|
+
- **登录限流** — 防暴力破解
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
### pip
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install entari-plugin-webui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### pdm
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pdm add entari-plugin-webui
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 配置示例
|
|
33
|
+
|
|
34
|
+
在 `entari.yml` 中启用插件:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
plugins:
|
|
38
|
+
server:
|
|
39
|
+
port: 8765 # WebUI 服务端口
|
|
40
|
+
path: "satori"
|
|
41
|
+
direct_adapter: true
|
|
42
|
+
database:
|
|
43
|
+
name: .entari/database.db # 统计数据用 SQLite
|
|
44
|
+
webui: {} # 启动 WebUI 面板
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
完整字段说明:
|
|
48
|
+
|
|
49
|
+
| 字段 | 默认值 | 说明 |
|
|
50
|
+
|------|--------|------|
|
|
51
|
+
| `password` | `""` | 登录密码(远程部署必填,本地可省略) |
|
|
52
|
+
| `registry_url` | `""` | 插件市场地址 |
|
|
53
|
+
| `package_manager` | `""` | 包管理器(自动探测 pip/pdm/uv/poetry/rye/pipenv) |
|
|
54
|
+
| `session_ttl` | `43200` | 会话过期时间(秒,默认 12 小时) |
|
|
55
|
+
| `log_buffer_lines` | `5000` | 日志缓冲区行数 |
|
|
56
|
+
| `login_rate_limit` | `5/60s` | 登录频率限制 |
|
|
57
|
+
|
|
58
|
+
## 认证说明
|
|
59
|
+
|
|
60
|
+
- **本地部署**(`host=127.0.0.1/localhost/::1`):自动免认证,无需密码即可登录
|
|
61
|
+
- **远程部署**:首次启动时自动生成随机 16 位密码并输出到控制台日志
|
|
62
|
+
|
|
63
|
+
## 故障恢复
|
|
64
|
+
|
|
65
|
+
忘记密码时,删除配置中的 `plugins.webui.password` 字段(或置空),重启后即重新生成新密码:
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
plugins:
|
|
69
|
+
webui: {}
|
|
70
|
+
# password 字段可删除或留空
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 扩展开发
|
|
74
|
+
|
|
75
|
+
其他 Entari 插件可通过 `webui_extend` 注册前端扩展,无需修改本插件源码。
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from entari_plugin_webui.core.extension import webui_extend
|
|
79
|
+
|
|
80
|
+
ext = webui_extend("my_plugin")
|
|
81
|
+
|
|
82
|
+
# 注册侧栏菜单
|
|
83
|
+
ext.add_menu("my_plugin.name", "mdi:account", "/extension/my_plugin")
|
|
84
|
+
|
|
85
|
+
# 注册 iframe 页面
|
|
86
|
+
ext.add_page("my_plugin", "my_plugin.name", "mdi:account",
|
|
87
|
+
"http://127.0.0.1:3000/", permission="my_plugin.access")
|
|
88
|
+
|
|
89
|
+
# 注册后端 API 路由
|
|
90
|
+
ext.add_route("/api/my-plugin/hello", ["GET"], my_handler, permission="my_plugin.access")
|
|
91
|
+
|
|
92
|
+
# 注册国际化文案
|
|
93
|
+
ext.add_i18n("zh-CN", "my_plugin.name", "我的插件")
|
|
94
|
+
ext.add_i18n("en-US", "my_plugin.name", "My Plugin")
|
|
95
|
+
|
|
96
|
+
# 注册权限项
|
|
97
|
+
ext.add_permission("my_plugin.access", "my_plugin.permission.access")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`WebUIExtension` 方法总览:
|
|
101
|
+
|
|
102
|
+
| 方法 | 参数 | 说明 |
|
|
103
|
+
|------|------|------|
|
|
104
|
+
| `add_menu` | `label_key, icon, path, order, badge_key, children` | 添加侧栏菜单项 |
|
|
105
|
+
| `add_page` | `key, label_key, icon, component_url, permission` | 添加 iframe 页面 |
|
|
106
|
+
| `add_route` | `path, methods, handler, permission` | 添加后端 HTTP 路由 |
|
|
107
|
+
| `add_websocket_route` | `path, handler, permission` | 添加后端 WebSocket 路由 |
|
|
108
|
+
| `add_i18n` | `locale, key, value` | 添加国际化翻译 |
|
|
109
|
+
| `add_permission` | `key, label_key` | 添加权限定义 |
|
|
110
|
+
|
|
111
|
+
## 风险须知
|
|
112
|
+
|
|
113
|
+
> [!WARNING]
|
|
114
|
+
> - 扩展页面以 **iframe 沙箱** 加载,与主面板隔离运行
|
|
115
|
+
> - 扩展来源 **仅限本机已安装的插件**,不支持加载外部站点
|
|
116
|
+
> - 各扩展通过 `postMessage` 与主面板通信,无法直接操作 DOM 或获取全局状态
|
|
117
|
+
> - 安装插件市场中的第三方插件前,请自行评估其安全性
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "entari-plugin-webui"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "WebUI Plugin for Entari"
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "RF-Tar-Railt", email = "rf_tar_railt@qq.com" },
|
|
7
|
+
]
|
|
8
|
+
dependencies = [
|
|
9
|
+
"arclet-entari[dotenv,yaml]>=0.18.0",
|
|
10
|
+
"entari-plugin-server>=0.7.1",
|
|
11
|
+
"entari-plugin-database>=0.3.2",
|
|
12
|
+
"fastapi>=0.135.1",
|
|
13
|
+
"ansi2html>=1.9.2",
|
|
14
|
+
]
|
|
15
|
+
requires-python = ">=3.10"
|
|
16
|
+
readme = "README.md"
|
|
17
|
+
|
|
18
|
+
[project.license]
|
|
19
|
+
text = "MIT"
|
|
20
|
+
|
|
21
|
+
[dependency-groups]
|
|
22
|
+
dev = [
|
|
23
|
+
"arclet-entari[reload]>=0.18.0",
|
|
24
|
+
"pytest>=8",
|
|
25
|
+
"pytest-asyncio>=0.23",
|
|
26
|
+
"ruff>=0.15",
|
|
27
|
+
"pyright>=1.1",
|
|
28
|
+
"anyio>=4",
|
|
29
|
+
"httpx>=0.28.1",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = [
|
|
34
|
+
"pdm-backend",
|
|
35
|
+
]
|
|
36
|
+
build-backend = "pdm.backend"
|
|
37
|
+
|
|
38
|
+
[tool.pdm]
|
|
39
|
+
distribution = true
|
|
40
|
+
|
|
41
|
+
[tool.pdm.build]
|
|
42
|
+
includes = [
|
|
43
|
+
"src/entari_plugin_webui",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[tool.pdm.scripts]
|
|
47
|
+
build-frontend = "npm --prefix frontend run build"
|
|
48
|
+
dev = "cd frontend && npm run dev"
|
|
49
|
+
format = "ruff format src/ tests/"
|
|
50
|
+
lint = "ruff check src/ tests/ --fix"
|
|
51
|
+
typecheck = "pyright src/entari_plugin_webui"
|
|
52
|
+
test = "pytest -v -s -W ignore"
|
|
53
|
+
|
|
54
|
+
[tool.pdm.scripts.build-all]
|
|
55
|
+
composite = [
|
|
56
|
+
"build-frontend",
|
|
57
|
+
"pdm build",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
asyncio_mode = "auto"
|
|
62
|
+
|
|
63
|
+
[tool.ruff]
|
|
64
|
+
line-length = 120
|
|
65
|
+
target-version = "py310"
|
|
66
|
+
include = [
|
|
67
|
+
"src/**.py",
|
|
68
|
+
"tests/**.py",
|
|
69
|
+
]
|
|
70
|
+
respect-gitignore = true
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint]
|
|
73
|
+
select = [
|
|
74
|
+
"E",
|
|
75
|
+
"F",
|
|
76
|
+
"I",
|
|
77
|
+
"UP",
|
|
78
|
+
"B",
|
|
79
|
+
"SIM",
|
|
80
|
+
"W",
|
|
81
|
+
"C",
|
|
82
|
+
"T",
|
|
83
|
+
"PYI",
|
|
84
|
+
"PT",
|
|
85
|
+
"Q",
|
|
86
|
+
]
|
|
87
|
+
ignore = [
|
|
88
|
+
"C901",
|
|
89
|
+
"T201",
|
|
90
|
+
"E731",
|
|
91
|
+
"E402",
|
|
92
|
+
"PYI055",
|
|
93
|
+
"B008",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[tool.ruff.lint.isort]
|
|
97
|
+
force-sort-within-sections = false
|
|
98
|
+
extra-standard-library = [
|
|
99
|
+
"typing_extensions",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.pyright]
|
|
103
|
+
pythonVersion = "3.10"
|
|
104
|
+
pythonPlatform = "All"
|
|
105
|
+
typeCheckingMode = "basic"
|
|
106
|
+
venvPath = "."
|
|
107
|
+
venv = ".venv"
|
|
108
|
+
reportMissingImports = true
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Entari Plugin: WebUI 服务(重设计版)"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from arclet.entari import plugin
|
|
8
|
+
from arclet.entari.event.lifespan import Startup
|
|
9
|
+
from arclet.entari.event.send import SendResponse
|
|
10
|
+
from arclet.entari.plugin import PluginRole, plugin_config
|
|
11
|
+
from entari_plugin_server import add_route, add_websocket_route, replace_asgi, server
|
|
12
|
+
from fastapi import Request
|
|
13
|
+
from fastapi.staticfiles import StaticFiles
|
|
14
|
+
from starlette.responses import FileResponse, Response
|
|
15
|
+
|
|
16
|
+
from .config import Config
|
|
17
|
+
from .core.extension import MenuItem as MenuItem
|
|
18
|
+
from .core.extension import WebUIExtension as WebUIExtension
|
|
19
|
+
from .core.extension import get_all_extension_routes
|
|
20
|
+
from .core.extension import webui_extend as webui_extend
|
|
21
|
+
from .core.security import (
|
|
22
|
+
LoginThrottle,
|
|
23
|
+
generate_random_password,
|
|
24
|
+
hash_password,
|
|
25
|
+
is_local_deployment,
|
|
26
|
+
parse_rate_limit,
|
|
27
|
+
set_local_mode,
|
|
28
|
+
)
|
|
29
|
+
from .core.session import SessionStore
|
|
30
|
+
from .utils import logger
|
|
31
|
+
|
|
32
|
+
__version__ = "1.0.0"
|
|
33
|
+
_STATIC_DIR = Path(__file__).parent / "static"
|
|
34
|
+
_FRONTEND_DIR = _STATIC_DIR / "frontend"
|
|
35
|
+
|
|
36
|
+
webui_config = plugin_config(Config, bind=True)
|
|
37
|
+
|
|
38
|
+
from .adapter import WebUIAdapter
|
|
39
|
+
from .api import create_app as _create_app # noqa: E402
|
|
40
|
+
from .api import logs # noqa: F401
|
|
41
|
+
from .models.stats import MessageStat # noqa: F401
|
|
42
|
+
from .services.stats_service import increment # noqa: PLC0415
|
|
43
|
+
|
|
44
|
+
_session_store: SessionStore = SessionStore(ttl=webui_config.session_ttl)
|
|
45
|
+
_login_throttle = LoginThrottle(*parse_rate_limit(webui_config.login_rate_limit))
|
|
46
|
+
|
|
47
|
+
if not server.path:
|
|
48
|
+
logger.warning("未检测到 Server 插件的 path 配置,WebUI 可能无法正常工作")
|
|
49
|
+
logger.warning("已自动设置 Server 插件的 path 为 /satori")
|
|
50
|
+
server.path = "/satori"
|
|
51
|
+
|
|
52
|
+
server.apply(WebUIAdapter())
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
plugin.metadata(
|
|
56
|
+
"WebUI 服务",
|
|
57
|
+
PluginRole.UTILITY,
|
|
58
|
+
[{"name": "RF-Tar-Railt", "email": "rf_tar_railt@qq.com"}],
|
|
59
|
+
__version__,
|
|
60
|
+
description="基于 Vite + Vue 3 + Element Plus 的可视化管理面板",
|
|
61
|
+
urls={"homepage": "https://github.com/ArcletProject/entari-plugin-webui"},
|
|
62
|
+
config=Config,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# ---------- SPA fallback handlers ----------
|
|
67
|
+
async def _root(request: Request) -> Response:
|
|
68
|
+
if not _FRONTEND_DIR.exists():
|
|
69
|
+
return Response(
|
|
70
|
+
content="Frontend not built. Run 'pdm run build-frontend'.",
|
|
71
|
+
status_code=503,
|
|
72
|
+
)
|
|
73
|
+
path = request.url.path.lstrip("/")
|
|
74
|
+
file = _FRONTEND_DIR / (path or "index.html")
|
|
75
|
+
if file.exists():
|
|
76
|
+
return FileResponse(file)
|
|
77
|
+
return Response(status_code=404)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
replace_asgi(app := _create_app())
|
|
81
|
+
|
|
82
|
+
if _FRONTEND_DIR.exists() and (_FRONTEND_DIR / "assets").exists():
|
|
83
|
+
app.mount("/assets", StaticFiles(directory=_FRONTEND_DIR / "assets", html=True))
|
|
84
|
+
|
|
85
|
+
add_route("/", methods=["GET"], include_in_schema=False)(_root)
|
|
86
|
+
add_route("/favicon.ico", methods=["GET"], include_in_schema=False)(_root)
|
|
87
|
+
add_route("/favicon.svg", methods=["GET"], include_in_schema=False)(_root)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# ---------- SendResponse listener (message counting) ----------
|
|
91
|
+
@plugin.listen(SendResponse)
|
|
92
|
+
async def _on_message_sent(event: SendResponse) -> None:
|
|
93
|
+
platform = event.account.platform
|
|
94
|
+
try:
|
|
95
|
+
await increment(platform)
|
|
96
|
+
except Exception: # noqa: BLE001
|
|
97
|
+
logger.debug("消息计数失败")
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# ---------- Startup listener ----------
|
|
101
|
+
@plugin.listen(Startup, priority=100)
|
|
102
|
+
async def _on_startup() -> None:
|
|
103
|
+
is_local = is_local_deployment(server.host)
|
|
104
|
+
set_local_mode(is_local)
|
|
105
|
+
if is_local:
|
|
106
|
+
logger.info("本地部署模式,无需认证")
|
|
107
|
+
else:
|
|
108
|
+
logger.info("远程部署模式,需要认证")
|
|
109
|
+
if not webui_config.password:
|
|
110
|
+
raw = generate_random_password(16)
|
|
111
|
+
webui_config.password = hash_password(raw)
|
|
112
|
+
logger.warning("已生成管理员密码:" + raw)
|
|
113
|
+
|
|
114
|
+
import arclet.entari.logger as entari_log
|
|
115
|
+
from loguru import logger as loguru_logger
|
|
116
|
+
|
|
117
|
+
from .core.log_stream import LogWriter, get_log_buffer
|
|
118
|
+
|
|
119
|
+
log_buffer = get_log_buffer()
|
|
120
|
+
loguru_logger.add(
|
|
121
|
+
LogWriter(log_buffer), level=0, diagnose=True, backtrace=True, colorize=True, filter=entari_log.default_filter
|
|
122
|
+
) # type: ignore[call-overload]
|
|
123
|
+
|
|
124
|
+
routes, ws_routes = get_all_extension_routes()
|
|
125
|
+
for r in routes:
|
|
126
|
+
add_route(r.path, methods=r.methods)(r.handler)
|
|
127
|
+
for w in ws_routes:
|
|
128
|
+
add_websocket_route(w.path)(w.handler)
|
|
129
|
+
|
|
130
|
+
host = server.host or "127.0.0.1"
|
|
131
|
+
logger.info(f"管理面板已启动: http://{host}:{server.port}/")
|