mirror of
https://github.com/hequan2017/seal.git
synced 2026-11-03 05:45:36 +08:00
Compare commits
6 Commits
v0.5.1
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a03660123 | ||
|
|
bfb0dfa8b8 | ||
|
|
3ed598a975 | ||
|
|
3ff0a9e787 | ||
|
|
b4ee175111 | ||
|
|
9a15bac824 |
@@ -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> 持续开发中
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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')),
|
||||
|
||||
Reference in New Issue
Block a user