6 Commits

Author SHA1 Message Date
dependabot[bot]
8a03660123 Bump certifi from 2018.11.29 to 2022.12.7
Bumps [certifi](https://github.com/certifi/python-certifi) from 2018.11.29 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2018.11.29...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 01:40:03 +00:00
何全
bfb0dfa8b8 Update README.md 2019-09-17 14:18:08 +08:00
何全
3ed598a975 Update README.md 2019-09-17 14:17:22 +08:00
何全
3ff0a9e787 Update README.md 2019-09-16 17:01:27 +08:00
何全
b4ee175111 v0.5.2 修改k8s 容器webssh bug 2019-08-28 15:51:39 +08:00
何全
9a15bac824 v0.5.1 增加API文档 2019-08-09 11:00:55 +08:00
5 changed files with 41 additions and 4 deletions

View File

@@ -14,8 +14,6 @@
> 支持 RESTful 和 GraphQL
> vue 前端地址 <https://github.com/hequan2017/seal-vue> 持续开发中
> 作者会在周末进行开发、更新。
> 支持 k8s webssh 管理 pod! sql执行 !
@@ -40,7 +38,7 @@
* pod webssh (已完成, 通过调用 k8s api 进行执行命令)
* 三期: mysql sql语句审核(已完成)
* sql检测执行
* 四期:正在开发中  重构前端 https://github.com/hequan2017/seal-d2-admin
## DEMO
@@ -51,6 +49,7 @@
> api文档地址 : http://129.28.156.219:8001/api/docs/
> vue 前端地址1 <https://github.com/hequan2017/seal-vue> 持续开发中
![列表](document/demo/1.jpg)
![添加](document/demo/2.jpg)

View File

@@ -67,6 +67,7 @@ class EchoConsumer(WebsocketConsumer):
def disconnect(self, close_code):
try:
async_to_sync(self.channel_layer.group_discard)(self.scope['user'].username, self.channel_name)
self.container_stream.write_stdin('exit\r') ## 必须加这个,防止 网页关闭,但是 容器没有退出
except Exception as e:
# 这里是为了配合 seal-vue 使用,实际项目,请删除下面这一行
async_to_sync(self.channel_layer.group_discard)("admin", self.channel_name)

View File

@@ -18,7 +18,7 @@ bcrypt==3.1.6
billiard==3.5.0.5
cachetools==3.1.1
celery==4.1.1
certifi==2018.11.29
certifi==2022.12.7
cffi==1.12.3
channels==2.2.0
channels-redis==2.4.0
@@ -151,3 +151,4 @@ Werkzeug==0.14.1
WTForms==2.2.1
zope.deprecation==4.4.0
zope.interface==4.6.0
django-rest-swagger

View File

@@ -50,6 +50,7 @@ INSTALLED_APPS = [
'django_filters',
'graphene_django',
'channels',
'rest_framework_swagger',
]
GRAPHENE = {
@@ -267,3 +268,34 @@ CHANNEL_LAYERS = {
# 配置ASGI
ASGI_APPLICATION = "seal.routing.application"
SWAGGER_SETTINGS = {
# 基础样式
# 'SECURITY_DEFINITIONS': {
# "basic": {
# 'type': 'basic'
# }
# },
'USE_SESSION_AUTH': True,
'SECURITY_DEFINITIONS': {
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'authorization'
}
},
# 如果需要登录才能够查看接口文档, 登录的链接使用restframework自带的.
# 'LOGIN_URL': '/api/v1/login/',
# 'LOGOUT_URL': 'rest_framework:logout',
# 'DOC_EXPANSION': None,
# 'SHOW_REQUEST_HEADERS':True,
# 'USE_SESSION_AUTH': True,
# 'DOC_EXPANSION': 'list',
# 接口文档中方法列表以首字母升序排列
'APIS_SORTER': 'alpha',
# 如果支持json提交, 则接口文档中包含json输入框
'JSON_EDITOR': True,
# 方法列表字母排序
'OPERATIONS_SORTER': 'alpha',
'VALIDATOR_URL': None,
}

View File

@@ -6,6 +6,9 @@ from rest_framework.authtoken import views
from rest_framework.documentation import include_docs_urls
from graphene_django.views import GraphQLView
from seal.schema import schema
from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='海豹 API 文档')
API_TITLE = '海豹 API 文档'
API_DESCRIPTION = '海豹 API 文档'
@@ -20,6 +23,7 @@ urlpatterns = [
path('api/token', views.obtain_auth_token),
path('api/docs/', include_docs_urls(title=API_TITLE, description=API_DESCRIPTION, authentication_classes=[],
permission_classes=[])),
path('api/docs2/', schema_view, name="docs"),
path('graphql/', GraphQLView.as_view(graphiql=True, schema=schema)),
path('sql/', include('sql.urls', namespace='sql')),