webconsole
Project description
webconsole使用
安装webconsole包
pip install webconsole==0.0.3 -i https://pypi.org/simple
具体有什么版本需要自己看 https://pypi.org/project/webconsole/ 找到目前最新的版本并替换上面的版本号
代码中需要改动的地方
引用路由
from webconsole.docker.docker_console import docker_webconsole
from webconsole.linux.linux_console import linux_webconsole
加入路由到访问路径
app.include_router(docker_webconsole, prefix='/docker_webconsole', tags=['docker_webconsole相关,使用请谨慎'], dependencies=[Depends(oauth2_schema)]) # noqa
app.include_router(linux_webconsole, prefix='/linux_webconsole', tags=['linux_webconsole相关,使用请谨慎'], dependencies=[Depends(oauth2_schema)]) # noqa
#app.include_router(docker_webconsole, prefix='/docker_webconsole', tags=['docker_webconsole相关,使用请谨慎'], dependencies=[]) # noqa
#app.include_router(linux_webconsole, prefix='/linux_webconsole', tags=['linux_webconsole相关,使用请谨慎'], dependencies=[]) # noqa
===PS: Linux服务需要在你的项目根目录下放置文件private_key文件,文件中是你的私钥,确保对应的公钥已经放到你要ssh的机器上了,不然登陆肯定是失败的===
示例接口访问路径
ws://127.0.0.1:60528/docker_webconsole/ws/f977748aabad?docker_address=localhost&port=2375 (这是docker的请求路径)
ws://127.0.0.1:60528/linux_webconsole/ws/linux?address=127.0.0.1&user=rbadmin_app1 (不带passwd表示默认使用你自己项目根目录下的private_key文件进行ssh登陆)
ws://127.0.0.1:60528/linux_webconsole/ws/linux?address=127.0.0.1&user=raypick&passwd=raypick 不带passwd表示默认使用密码进行ssh登陆)
具体使用方法,请访问我的CSDN博客,https://blog.csdn.net/weixin_44388689?type=blog
搜索webconsole使用方法,获取更全面的使用指导,非常感谢,૮(˶ᵔ ᵕ ᵔ˶)ა
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
webconsole-0.0.7.tar.gz
(492.7 kB
view hashes)
Built Distribution
webconsole-0.0.7-py3-none-any.whl
(557.4 kB
view hashes)
Close
Hashes for webconsole-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcbe7f880dff53665d441cf6cc16a69683c7dc3d50476c5ee20e6bf134274d31 |
|
MD5 | 1428893e52b63d3ec59d84d3ec6e0f87 |
|
BLAKE2b-256 | c831ede7cc606ba8fd1c194ecb3117693c30f3740d84491c7729dde4d4fc3bff |