diff --git a/README.md b/README.md
index 2557143ad900b07e3debf7f0eec4053cbcaa543c..deb9efbb932749423a8b9a9cabb4b78ee00fbef3 100644
--- a/README.md
+++ b/README.md
@@ -29,10 +29,7 @@
```
tar xf sysomRelease-20211207022031.tar.gz
cd sysomRelease-20211207022031
- # 使用deploy.sh脚本部署项目,需要带三个参数,
- # arg1 : 部署目录,
- # arg2 : 内网IP(主要是方便内网通讯,用户需要保证内网能通)
- # arg3 : 外网IP(浏览器可以访问到的IP地址)
- bash deploy.sh /usr/local/sysom 192.168.100.100 100.100.22.22
+ # 默认部署在 /home/sysom 目录,可以接参数自定义安装目录,
+ bash deploy.sh /usr/local/sysom
```
diff --git a/package.sh b/package.sh
index 15ea3860bcc6a82e8cca06503717487f4ae20358..25ed686c0232c2f56c27585a28127be3c3d8ff7e 100644
--- a/package.sh
+++ b/package.sh
@@ -8,7 +8,7 @@ SCRIPTDIR=script
TOOLSDIR=tools
# build web
pushd sysom_web
-yarn add umi
+yarn
yarn build
popd
diff --git a/script/node/monitor/node_exporter_deploy.sh b/script/node/monitor/node_exporter_deploy.sh
index 4838acc7648fc6c496022270bd0eedcbd948e034..f5660b85471edf4d84cdfa46237464e53fae66cf 100755
--- a/script/node/monitor/node_exporter_deploy.sh
+++ b/script/node/monitor/node_exporter_deploy.sh
@@ -6,6 +6,8 @@ NODE_EXPORTER_ARCH=linux-amd64
NODE_EXPORTER_PKG=node_exporter-${NODE_EXPORTER_VER}.${NODE_EXPORTER_ARCH}
NODE_EXPORTER_TAR=${NODE_EXPORTER_PKG}.tar.gz
+
+exit 0
##设置node_exporter开机自动启动
cat << EOF > node_exporter.service
[Unit]
diff --git a/sysom_api/apps/__init__.py b/sysom_api/apps/__init__.py
index 1a6daa8007a3b3df3b0bfeb19b4d1163c6896b4a..94acac9e097fb64118b11421b1f7e5d384dbfbaf 100644
--- a/sysom_api/apps/__init__.py
+++ b/sysom_api/apps/__init__.py
@@ -3,6 +3,5 @@
@File : __init__.py.py
@Time : 2021/11/22 10:36
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
diff --git a/sysom_api/apps/accounts/authentication.py b/sysom_api/apps/accounts/authentication.py
index 81044df9a255c7d5c3b492625207158199ed6902..f6aca38aa7ac51080a66c0310a30438a788c2984 100644
--- a/sysom_api/apps/accounts/authentication.py
+++ b/sysom_api/apps/accounts/authentication.py
@@ -3,7 +3,6 @@
@File : authentication.py
@Time : 2021/10/29 11:04
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
import logging
diff --git a/sysom_api/apps/accounts/permissions.py b/sysom_api/apps/accounts/permissions.py
index 26aaa966a0b34d9dd54ba8924f8d6bb528cd8ea1..f64953d83578eb622bb3c5086f35db29cd682bf3 100644
--- a/sysom_api/apps/accounts/permissions.py
+++ b/sysom_api/apps/accounts/permissions.py
@@ -3,7 +3,6 @@
@File : permissions.py
@Time : 2021/11/9 13:53
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
import logging
diff --git a/sysom_api/apps/monitor/urls.py b/sysom_api/apps/monitor/urls.py
index 66d90633b280c03ba73ea39ab1c2603b152ca122..55dcad6f7b30a2bec8e42ecac3e411d9728facd8 100644
--- a/sysom_api/apps/monitor/urls.py
+++ b/sysom_api/apps/monitor/urls.py
@@ -3,7 +3,6 @@
@File : urls.py
@Time : 2021/11/2 11:07
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
diff --git a/sysom_api/apps/task/seriaizer.py b/sysom_api/apps/task/seriaizer.py
index cb6894d2438804f9627b919390f6350bd6a26cd7..d91dcae3c5c9c9b17a780a43b4e28aa79420b4a3 100644
--- a/sysom_api/apps/task/seriaizer.py
+++ b/sysom_api/apps/task/seriaizer.py
@@ -3,7 +3,6 @@
@File : seriaizer.py
@Time : 2021/11/22 17:41
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
from rest_framework import serializers
diff --git a/sysom_api/apps/task/urls.py b/sysom_api/apps/task/urls.py
index ba7e07125f9aa32387f1873cbfef1d6fd85e90a9..e3eda515de5db9a25a16398546de8aa0b7695e40 100644
--- a/sysom_api/apps/task/urls.py
+++ b/sysom_api/apps/task/urls.py
@@ -3,7 +3,6 @@
@File : urls.py
@Time : 2021/11/22 10:38
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
from django.urls import path, include
diff --git a/sysom_api/apps/vmcore/views.py b/sysom_api/apps/vmcore/views.py
index 0459cdfe104f8f29c81dd979c518f36c65b17f58..d29a458b23e57fa104887a25df447cef3b6b471c 100644
--- a/sysom_api/apps/vmcore/views.py
+++ b/sysom_api/apps/vmcore/views.py
@@ -1,4 +1,5 @@
import logging
+from typing import Dict
from django.shortcuts import render
from drf_yasg.utils import swagger_auto_schema
from rest_framework.request import Request
@@ -122,8 +123,12 @@ class VmcoreViewSet(GenericViewSet,
start_time=end_time + datetime.timedelta(days=-30)
host_sum = models.Panic.objects.values('hostname').distinct().count()
+ total = 0
+ if isinstance(data, Dict):
+ data = data['data']
+ total = data['total']
if host_sum == 0:
- return success(result=data['data'], total=data['total'], success=True, vmcore_30days=0, vmcore_7days=0, rate_30days=0, rate_7days=0)
+ return success(result=data, total=total, success=True, vmcore_30days=0, vmcore_7days=0, rate_30days=0, rate_7days=0)
vmcores_sum_30 = models.Panic.objects.filter(core_time__range=(start_time,end_time)).count()
hosts_sum_30 = models.Panic.objects.filter(core_time__range=(start_time,end_time)).count()
@@ -131,13 +136,11 @@ class VmcoreViewSet(GenericViewSet,
vmcores_sum_7 = models.Panic.objects.filter(core_time__range=(start_time,end_time)).values('hostname').distinct().count()
hosts_sum_7 = models.Panic.objects.filter(core_time__range=(start_time,end_time)).values('hostname').distinct().count()
- rate_30 = hosts_sum_30 / host_sum
- rate7 = hosts_sum_7 /host_sum
data['vmcore_30days'] = vmcores_sum_30
data['vmcore_7days'] = vmcores_sum_7
data['rate_30days'] = hosts_sum_30/host_sum
data['rate_7days'] = hosts_sum_7/host_sum
- return success(result=data['data'], total=data['total'], success=True, vmcore_30days=vmcores_sum_30, vmcore_7days=vmcores_sum_7, rate_30days=hosts_sum_30/host_sum, rate_7days=hosts_sum_7/host_sum)
+ return success(result=data, total=total, success=True, vmcore_30days=vmcores_sum_30, vmcore_7days=vmcores_sum_7, rate_30days=hosts_sum_30/host_sum, rate_7days=hosts_sum_7/host_sum)
return success(result=data['data'], success=True)
def update(self, request, *args, **kwargs):
diff --git a/sysom_api/conf/dev_constant.py b/sysom_api/conf/dev_constant.py
index 0e64d3da27dacaa9c12c22fd2b6cd7267475b51c..8ff9b64f70949bd50b46e23c9ae008d8f07b5cea 100644
--- a/sysom_api/conf/dev_constant.py
+++ b/sysom_api/conf/dev_constant.py
@@ -3,7 +3,6 @@
@File : dev_constant.py
@Time : 2021/11/3 14:18
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
from . import BaseConstant
diff --git a/sysom_api/conf/pro_constant.py b/sysom_api/conf/pro_constant.py
index 8c74a969486c78fcf9f8c45972c3fbebe04974a3..d59f18b30fbf1ada84fb6f1a2a576af360f9dcd4 100644
--- a/sysom_api/conf/pro_constant.py
+++ b/sysom_api/conf/pro_constant.py
@@ -3,7 +3,6 @@
@File : pro_constant.py
@Time : 2021/11/3 14:17
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
from . import BaseConstant
diff --git a/sysom_api/conf/test_constant.py b/sysom_api/conf/test_constant.py
index e96114ff5c76b224457dda011502e6326df3cd96..28b9f34a9c4101a77e1b2bca06813951b80d00b4 100644
--- a/sysom_api/conf/test_constant.py
+++ b/sysom_api/conf/test_constant.py
@@ -3,7 +3,6 @@
@File : test_constant.py
@Time : 2021/11/3 14:22
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
from . import BaseConstant
diff --git a/sysom_api/consumer/consumers.py b/sysom_api/consumer/consumers.py
index 9e7694a9404a7c67cd6b6536081c61cdf598806e..791a046e1bdaf185cb66ce2df840cb7956805f13 100644
--- a/sysom_api/consumer/consumers.py
+++ b/sysom_api/consumer/consumers.py
@@ -18,33 +18,6 @@ def get_host_instance(model, **kwargs):
return model.objects.filter(**kwargs).first()
-class ExecConsumer(WebsocketConsumer):
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
- self.rds = get_redis_connection()
-
- def connect(self):
- self.accept()
-
- def disconnect(self, code):
- self.send(text_data="disconnect")
- self.rds.close()
- self.close()
-
- def get_response(self):
- token = self.scope['url_route']['kwargs']['token']
- response = self.rds.brpop(token, timeout=5) # 移除并获取最后一个元素
- return response[1] if response else None
-
- def receive(self, **kwargs):
- response = self.get_response()
- while response:
- data = response.decode()
- self.send(text_data=data)
- response = self.get_response()
- self.send(text_data='pong')
-
-
class SshConsumer(WebsocketConsumer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
diff --git a/sysom_api/lib/paginations.py b/sysom_api/lib/paginations.py
index 203dbb0b13361d1192ab4b2262568f0a5df81879..b14639bb2a3fcd04760920db1308d1af6d614410 100644
--- a/sysom_api/lib/paginations.py
+++ b/sysom_api/lib/paginations.py
@@ -2,7 +2,6 @@
@File: paginations.py
@Time: 2021-12-14 13:46:02
@Author: DM
-@Email: wb-msm261421@alibaba-inc.com
@Desc: Local Paginations Class
'''
diff --git a/sysom_api/lib/ssh.py b/sysom_api/lib/ssh.py
index aea2f3b1253c984b11a3d700841dd38e9f2d39b4..671e74a5cdbbf52fef5f632ade15ce421fa1bcff 100644
--- a/sysom_api/lib/ssh.py
+++ b/sysom_api/lib/ssh.py
@@ -14,11 +14,9 @@ class SSH:
username='root',
pkey=None,
password=None,
- default_env=None,
connect_timeout=10
):
self.client = None
- self.default_env = self.make_env_command(default_env)
self.arguments = {
'hostname': hostname,
'port': port,
@@ -55,47 +53,12 @@ class SSH:
if exit_code != 0:
raise Exception(f'add public key error: {out}')
- def exec_command(self, command, environment=None):
+ def exec_command(self, command):
ssh_session = self.client.get_transport().open_session()
- if environment:
- ssh_session.update_environment(environment)
ssh_session.set_combine_stderr(True)
ssh_session.exec_command(command)
stdout = ssh_session.makefile("rb", -1)
- return ssh_session.recv_exit_status(), self.decode(stdout.read())
-
- def put_file(self, local_path, remote_path):
- with self as cli:
- sftp = cli.client.open_sftp()
- sftp.put(local_path, remote_path)
-
- def get_file(self, local_path, remote_path):
- with self as cli:
- sftp = cli.client.open_sftp()
- sftp.get(remote_path, local_path)
-
- def remove_file(self, path):
- sftp = self.client.open_sftp()
- sftp.remove(path)
-
- def make_env_command(self, environment):
- if not environment:
- return None
- str_envs = []
- for k, v in environment.items():
- k = k.replace('-', '_')
- if isinstance(v, str):
- v = v.replace("'", "'\"'\"'")
- str_envs.append(f"{k}='{v}'")
- str_envs = ' '.join(str_envs)
- return f'export {str_envs}'
-
- def decode(self, content):
- try:
- content = content.decode()
- except UnicodeDecodeError:
- content = content.decode(encoding='GBK', errors='ignore')
- return content
+ return ssh_session.recv_exit_status(), stdout.read().decode()
def __enter__(self):
self.get_client()
diff --git a/sysom_api/lib/utils.py b/sysom_api/lib/utils.py
index 9e0ea8bc1a9bdeab57e04a64b7a15c26e4e5bcd9..dcd3baad634e52f55f88cf883ebe19a28d0d6f9b 100644
--- a/sysom_api/lib/utils.py
+++ b/sysom_api/lib/utils.py
@@ -4,7 +4,6 @@
@File : utils.py
@Time : 2021/10/28 11:09
@Author : DM
-@Email : smmic@isoftstone.com
@Software: PyCharm
"""
import uuid as UUID
diff --git a/sysom_api/service_scripts/pingtrace b/sysom_api/service_scripts/pingtrace
new file mode 100755
index 0000000000000000000000000000000000000000..c63d392cfd75bf5d74a696c6a8e5428c6b853cf0
--- /dev/null
+++ b/sysom_api/service_scripts/pingtrace
@@ -0,0 +1,49 @@
+#!/usr/bin/python3
+# coding=utf-8
+import json
+import sys
+
+###############################################################################
+## 如前端入参是这个:
+## {
+## "源虚拟机私网IP":"192.168.1.101",
+## "目标虚拟机私网IP":"192.168.1.102",
+## "追踪包数":"100",
+## "间隔毫秒数":"10",
+## "报文协议":"ICMP"
+## }
+## 解析参数方法:
+## sysak pingtrace -s -t 6
+## -t 6 来自 “追踪包数” * "间隔毫秒数” / 1000 + 5
+## 本命令运行在“目标虚拟机私网ip”
+##
+## sysak pingtrace_raw -c 192.168.1.102 -t 2 -i 10000 -C 100 -o log
+## -c 192.168.1.102 来自 “目标虚拟机私网ip”
+## -t 2 来自 “追踪包数” * "间隔毫秒数” / 1000 + 1
+## -i 10000 来自 “间隔毫秒数”* 1000
+## -C 100 来自 “追踪包数”
+## 本命令运行在“源虚拟机私网ip”
+###############################################################################
+
+args = json.loads(sys.argv[1])
+result = {}
+result['commands'] = []
+
+cmd0_arg = int(int(args["追踪包数"]) * int(args["间隔毫秒数"]) / 1000) + 5
+cmd0 = {}
+cmd0['instance'] = args["源虚拟机私网IP"]
+cmd0['cmd'] = "sysak pingtrace -s -t "+str(cmd0_arg)
+
+cmd1 = {}
+cmd1['instance'] = args["目标虚拟机私网IP"]
+cmd1_arg_c = args["目标虚拟机私网IP"]
+cmd1_arg_t = str(cmd0_arg - 4)
+cmd1_arg_i = str(int(args["间隔毫秒数"]) * 1000)
+cmd1_arg_C = args["追踪包数"]
+cmd1['cmd'] = "sysak pingtrace_raw -c "+cmd1_arg_c+" -t "+cmd1_arg_t+" -i "+cmd1_arg_i+" -C "+cmd1_arg_C+" -o log"
+
+result['commands'].append(cmd0)
+result['commands'].append(cmd1)
+
+data = json.dumps(result)
+print(data)
diff --git a/sysom_api/sysom/asgi.py b/sysom_api/sysom/asgi.py
index 03e5ba85467a9ad00981027b190fb2ced4424839..7c029ddd34817b7a2d6dd847b613bd0119fe6c36 100644
--- a/sysom_api/sysom/asgi.py
+++ b/sysom_api/sysom/asgi.py
@@ -6,13 +6,11 @@ It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
+
import os
-from channels.routing import ProtocolTypeRouter
-from consumer import routing
+from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sysom.settings')
-application = ProtocolTypeRouter({
- "websocket": routing.ws_router,
-})
+application = get_asgi_application()
diff --git a/sysom_api/sysom/settings.py b/sysom_api/sysom/settings.py
index 8efefa3baa4a155f38bffec4948adcea8eebbdbb..5c8b5f4aa0a595ebdc49c2d6e4ab172cc9aa7dfb 100644
--- a/sysom_api/sysom/settings.py
+++ b/sysom_api/sysom/settings.py
@@ -20,13 +20,6 @@ SECRET_KEY = 'django-insecure-^d8b9di9w&-mmsbpt@)o#e+2^z+^m4nhf+z8304%9@8y#ko46l
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.staticfiles',
- 'django.contrib.sessions',
- 'django.contrib.messages',
-
'apps.accounts',
'apps.host',
'apps.monitor',
@@ -44,12 +37,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
- # 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
from conf import Constant as constant
@@ -81,14 +69,6 @@ TEMPLATES = [
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- },
},
]
@@ -105,22 +85,6 @@ CHANNEL_LAYERS = {
}
}
-
-AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
-]
-
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LANGUAGE_CODE = constant.LANGUAGE_CODE
@@ -139,6 +103,7 @@ REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'apps.accounts.authentication.Authentication'
],
+ 'UNAUTHENTICATED_USER': None,
'DEFAULT_VERSIONING_CLASS': "rest_framework.versioning.URLPathVersioning",
'DEFAULT_VERSION': 'v1', # 默认版本
'ALLOWED_VERSIONS': ['v1', 'v2'], # 允许的版本
diff --git a/sysom_api/sysom/urls.py b/sysom_api/sysom/urls.py
index 75061f1ac273d36c97dd151c701a3b382250365e..e267cc7b46499f0a64730d8e8541a8176c1a0bf0 100644
--- a/sysom_api/sysom/urls.py
+++ b/sysom_api/sysom/urls.py
@@ -13,14 +13,12 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
-from django.contrib import admin
from django.urls import path, re_path
from django.urls.conf import include
from django.conf import settings
urlpatterns = [
- path('admin/', admin.site.urls),
path('', include("apps.host.urls")),
path('', include("apps.accounts.urls")),
path('', include("apps.monitor.urls")),
diff --git a/sysom_api/uwsgi.ini b/sysom_api/uwsgi.ini
index c15b516f1026825d81dbcf83999bf1ad08ae855c..9cfa0387e1006d02bdc81409549668633c07c020 100644
--- a/sysom_api/uwsgi.ini
+++ b/sysom_api/uwsgi.ini
@@ -1,30 +1,10 @@
[uwsgi]
-
-# 配置和nginx链接的socket链接
-# socket=0.0.0.0:8080
-# 也可以使用http
-http=0.0.0.0:8080
-
-# 配置项目路径,项目的所在目录
-chdir=/home
-
-# 配置wsgi接口模块文件路劲
-wsgi-file=/home/sysom/wsgi.py
-
-# 配置启动的进程数
-processes=4
-
-# 配置每个进程的线程数
-threads=20
-
-# 配置启动管理主进程
+socket=0.0.0.0:7001
+chdir=/home/sysom/target/sysom_api
+module=sysom.wsgi:application
+processes=10
master=True
-
-# 配置存放主进程的进程号文件
-pidfile=uwsgi.pid
-
-# 配置dump日志记录
-daemonize=/home/logs/uwsgi.log
-
-# 配置静态资源
-static-map=/static=/home/index/static
+vacuum=True
+pidfile=/var/run/uwsgi.pid
+enable-threads=true
+daemonize=/home/sysom/logs/uwsgi.log
diff --git a/sysom_web/src/pages/vmcore/Detail/index.jsx b/sysom_web/src/pages/vmcore/Detail/index.jsx
index d0b36ba074ca57a13b863721d880e60d389c0303..923dbbbb6ccab13c32ee6c3ca8b7ee3cbd273387 100644
--- a/sysom_web/src/pages/vmcore/Detail/index.jsx
+++ b/sysom_web/src/pages/vmcore/Detail/index.jsx
@@ -1,6 +1,6 @@
import React, { useState, useRef } from "react";
-import { Button, message } from "antd";
-import { useIntl } from "umi";
+import { Button, message, Descriptions } from "antd";
+import { useIntl, useRequest } from "umi";
import moment from "moment";
import ProCard from "@ant-design/pro-card";
import ProDescriptions from "@ant-design/pro-descriptions";
@@ -30,6 +30,10 @@ const VmcoreDetail = (props) => {
const [createModalIssue, handleModalIssue] = useState(false);
const actionRef = useRef();
const intl = useIntl();
+ const { data, error, loading } = useRequest(() => {
+ return getVmcoreDetail({vmcore_id: props.match.params.id})
+ })
+
return (
@@ -119,15 +123,15 @@ const VmcoreDetail = (props) => {
/>
-
-
-
-
-
-
- {moment().valueOf()}
-
-
+
+ {data?.hostname}
+ {data?.ip}
+ {data?.func_name}
+ {data?.comm}
+ {data?.ver}
+ {data?.core_time}
+ {data?.dmesg}
+
);
diff --git a/sysom_web/src/pages/vmcore/components/VmcoreTableList.jsx b/sysom_web/src/pages/vmcore/components/VmcoreTableList.jsx
index 7f39c87c27dbc47a360c4e5f14fef52de84c4dbf..5cde464a33695f8dedf11246aa6bae336e655869 100644
--- a/sysom_web/src/pages/vmcore/components/VmcoreTableList.jsx
+++ b/sysom_web/src/pages/vmcore/components/VmcoreTableList.jsx
@@ -1,6 +1,5 @@
import { useRef } from "react";
import ProTable from "@ant-design/pro-table";
-import { getVmcore } from "../service";
const VmcoreTableList = (props) => {
const actionRef = useRef();
@@ -84,26 +83,17 @@ const VmcoreTableList = (props) => {
],
},
];
- let config = {
- request: getVmcore,
- params: props.params,
- };
- if (props.request) {
- config = {
- request: props.request,
- params: props.params,
- postData: props.postData,
- };
- }
return (
);
};
diff --git a/sysom_web/src/pages/vmcore/list/index.jsx b/sysom_web/src/pages/vmcore/list/index.jsx
index a82e484587f0f60299e170fd2af37ce60e7fa09e..03b7d3073a61636d276f3f35846d9a4dd3974a08 100644
--- a/sysom_web/src/pages/vmcore/list/index.jsx
+++ b/sysom_web/src/pages/vmcore/list/index.jsx
@@ -2,6 +2,7 @@ import { PageContainer } from '@ant-design/pro-layout';
import ProCard from '@ant-design/pro-card';
import VmcoreTableList from '../components/VmcoreTableList';
import VmcoreCard from '../components/VmcoreCard';
+import { getVmcore } from "../service";
const { Divider } = ProCard;
@@ -10,7 +11,7 @@ const VmcoreList = () => {
-
+
);
};
diff --git a/tools/deploy/deploy.sh b/tools/deploy/deploy.sh
index 88d6a2305aeb334d8d116c6d946752750bc3d71f..ede22e144c64a8a74def488601711fc124933bfa 100755
--- a/tools/deploy/deploy.sh
+++ b/tools/deploy/deploy.sh
@@ -115,6 +115,7 @@ setup_database() {
}
init_conf() {
+ mkdir -p /run/daphne
sed -i 's;"env", "testing";"env", "develop";g' ${TARGET_PATH}/${API_DIR}/conf/__init__.py
cp tools/deploy/nginx.conf /etc/nginx/
cp tools/deploy/sysom.conf /etc/nginx/conf.d/
diff --git a/tools/deploy/sysom-uwsgi.ini b/tools/deploy/sysom-uwsgi.ini
new file mode 100644
index 0000000000000000000000000000000000000000..c1597281377bbe2d0c096cec5efab8477f38f1a3
--- /dev/null
+++ b/tools/deploy/sysom-uwsgi.ini
@@ -0,0 +1,9 @@
+[program:sysom]
+directory = /home/sysom/target/sysom_api
+command=/home/sysom/virtualenv/bin/uwsgi --ini /home/sysom/target/sysom_api/uwsgi.ini --catch-exceptions --protocol=http
+autostart=true
+autorestart=true
+redirect_stderr=true
+stopasgroup=true
+stdout_logfile=/home/sysom/logs/supervisor.log
+environment=PATH="/home/sysom/virtualenv/bin"
diff --git a/tools/deploy/sysom.ini b/tools/deploy/sysom.ini
index c1597281377bbe2d0c096cec5efab8477f38f1a3..58e6d5cd7f4ffc4f5725a2cf1acbe8d9ba32ec3d 100644
--- a/tools/deploy/sysom.ini
+++ b/tools/deploy/sysom.ini
@@ -1,6 +1,9 @@
-[program:sysom]
-directory = /home/sysom/target/sysom_api
-command=/home/sysom/virtualenv/bin/uwsgi --ini /home/sysom/target/sysom_api/uwsgi.ini --catch-exceptions --protocol=http
+[fcgi-program:sysom]
+socket=tcp://localhost:7001
+directory=/home/sysom/target/sysom_api
+command=/home/sysom/virtualenv/bin/daphne -u /run/daphne/daphne%(process_num)d.sock --fd 0 --access-log - --proxy-headers sysom.asgi:application
+numprocs=4
+process_name=asgi%(process_num)d
autostart=true
autorestart=true
redirect_stderr=true