mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修复定时任务搜索api
This commit is contained in:
parent
7516acbc41
commit
b9253c8191
|
@ -57,7 +57,7 @@ https://podman.io/getting-started/installation
|
||||||
```bash
|
```bash
|
||||||
podman run -dit \
|
podman run -dit \
|
||||||
--network bridge \
|
--network bridge \
|
||||||
-v $PWD/ql:/ql/data \
|
-v $PWD/ql/data:/ql/data \
|
||||||
-p 5700:5700 \
|
-p 5700:5700 \
|
||||||
--name qinglong \
|
--name qinglong \
|
||||||
--hostname qinglong \
|
--hostname qinglong \
|
||||||
|
@ -96,7 +96,7 @@ systemctl restart docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -dit \
|
docker run -dit \
|
||||||
-v $PWD/ql:/ql/data \
|
-v $PWD/ql/data:/ql/data \
|
||||||
-p 5700:5700 \
|
-p 5700:5700 \
|
||||||
--name qinglong \
|
--name qinglong \
|
||||||
--hostname qinglong \
|
--hostname qinglong \
|
||||||
|
@ -124,6 +124,10 @@ docker-compose up -d
|
||||||
docker-compose down
|
docker-compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3. access
|
||||||
|
|
||||||
|
Open your browser and visit http://{ip}:5700
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
1. built-in commands
|
1. built-in commands
|
||||||
|
|
|
@ -57,7 +57,7 @@ https://podman.io/getting-started/installation
|
||||||
```bash
|
```bash
|
||||||
podman run -dit \
|
podman run -dit \
|
||||||
--network bridge \
|
--network bridge \
|
||||||
-v $PWD/ql:/ql/data \
|
-v $PWD/ql/data:/ql/data \
|
||||||
-p 5700:5700 \
|
-p 5700:5700 \
|
||||||
--name qinglong \
|
--name qinglong \
|
||||||
--hostname qinglong \
|
--hostname qinglong \
|
||||||
|
@ -97,7 +97,7 @@ systemctl restart docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -dit \
|
docker run -dit \
|
||||||
-v $PWD/ql:/ql/data \
|
-v $PWD/ql/data:/ql/data \
|
||||||
-p 5700:5700 \
|
-p 5700:5700 \
|
||||||
--name qinglong \
|
--name qinglong \
|
||||||
--hostname qinglong \
|
--hostname qinglong \
|
||||||
|
@ -125,6 +125,10 @@ docker-compose up -d
|
||||||
docker-compose down
|
docker-compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3. 访问
|
||||||
|
|
||||||
|
打开你的浏览器,访问 http://{ip}:5700
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
1. 内置命令
|
1. 内置命令
|
||||||
|
|
|
@ -100,30 +100,17 @@ export default (app: Router) => {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
route.get(
|
route.get('/', async (req: Request, res: Response, next: NextFunction) => {
|
||||||
'/',
|
const logger: Logger = Container.get('logger');
|
||||||
celebrate({
|
try {
|
||||||
query: Joi.object({
|
const cronService = Container.get(CronService);
|
||||||
searchText: Joi.string().required().allow(''),
|
const data = await cronService.crontabs(req.query as any);
|
||||||
page: Joi.string().required(),
|
return res.send({ code: 200, data });
|
||||||
size: Joi.string().required(),
|
} catch (e) {
|
||||||
sortField: Joi.string().optional(),
|
logger.error('🔥 error: %o', e);
|
||||||
sortType: Joi.string().optional(),
|
return next(e);
|
||||||
t: Joi.string().required(),
|
}
|
||||||
}),
|
});
|
||||||
}),
|
|
||||||
async (req: Request, res: Response, next: NextFunction) => {
|
|
||||||
const logger: Logger = Container.get('logger');
|
|
||||||
try {
|
|
||||||
const cronService = Container.get(CronService);
|
|
||||||
const data = await cronService.crontabs(req.query as any);
|
|
||||||
return res.send({ code: 200, data });
|
|
||||||
} catch (e) {
|
|
||||||
logger.error('🔥 error: %o', e);
|
|
||||||
return next(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
route.post(
|
route.post(
|
||||||
'/',
|
'/',
|
||||||
|
|
|
@ -114,13 +114,13 @@ export default class CronService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async crontabs(params?: {
|
public async crontabs(params?: {
|
||||||
searchText: string;
|
searchValue: string;
|
||||||
page: string;
|
page: string;
|
||||||
size: string;
|
size: string;
|
||||||
sortField: string;
|
sortField: string;
|
||||||
sortType: string;
|
sortType: string;
|
||||||
}): Promise<{ data: Crontab[]; total: number }> {
|
}): Promise<{ data: Crontab[]; total: number }> {
|
||||||
const searchText = params?.searchText;
|
const searchText = params?.searchValue;
|
||||||
const page = Number(params?.page || '0');
|
const page = Number(params?.page || '0');
|
||||||
const size = Number(params?.size || '0');
|
const size = Number(params?.size || '0');
|
||||||
const sortField = params?.sortField || '';
|
const sortField = params?.sortField || '';
|
||||||
|
|
|
@ -8,7 +8,7 @@ echo -e "======================1. 检测配置文件========================\n"
|
||||||
make_dir /etc/nginx/conf.d
|
make_dir /etc/nginx/conf.d
|
||||||
make_dir /run/nginx
|
make_dir /run/nginx
|
||||||
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
||||||
cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf
|
envsubst '${qlBaseUrl}' < $nginx_app_conf > /etc/nginx/conf.d/front.conf
|
||||||
pm2 l &>/dev/null
|
pm2 l &>/dev/null
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
upstream api {
|
upstream baseApi {
|
||||||
server 0.0.0.0:5600;
|
server 0.0.0.0:5600;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream public {
|
upstream publicApi {
|
||||||
server 0.0.0.0:5400;
|
server 0.0.0.0:5400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,42 +16,42 @@ server {
|
||||||
root /ql/static/dist;
|
root /ql/static/dist;
|
||||||
ssl_session_timeout 5m;
|
ssl_session_timeout 5m;
|
||||||
|
|
||||||
location /api/public {
|
location ${ql_base_url}api/public {
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass http://public;
|
proxy_pass http://publicApi/api/public/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api {
|
location ${ql_base_url}api {
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass http://api;
|
proxy_pass http://baseApi/api/;
|
||||||
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection $connection_upgrade;
|
proxy_set_header Connection $connection_upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /open {
|
location ${ql_base_url}open {
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass http://api;
|
proxy_pass http://baseApi/open/;
|
||||||
}
|
}
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_static on;
|
gzip_static on;
|
||||||
gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript;
|
gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_buffers 16 8k;
|
gzip_buffers 16 8k;
|
||||||
gzip_http_version 1.0;
|
gzip_http_version 1.0;
|
||||||
|
|
||||||
location / {
|
location ${ql_base_url} {
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ ${ql_base_url}index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ .*\.(html)$ {
|
location ~ .*\.(html)$ {
|
||||||
|
|
|
@ -5,41 +5,41 @@ error_log /var/log/nginx/error.log warn;
|
||||||
include /etc/nginx/modules/*.conf;
|
include /etc/nginx/modules/*.conf;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
|
|
||||||
client_max_body_size 20m;
|
client_max_body_size 20m;
|
||||||
client_body_buffer_size 20m;
|
client_body_buffer_size 20m;
|
||||||
|
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
|
|
||||||
tcp_nodelay on;
|
tcp_nodelay on;
|
||||||
|
|
||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
|
|
||||||
ssl_session_cache shared:SSL:2m;
|
ssl_session_cache shared:SSL:2m;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_static on;
|
gzip_static on;
|
||||||
gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript;
|
gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_buffers 16 8k;
|
gzip_buffers 16 8k;
|
||||||
gzip_http_version 1.0;
|
gzip_http_version 1.0;
|
||||||
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log main;
|
access_log /var/log/nginx/access.log main;
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ copy_dep() {
|
||||||
|
|
||||||
echo -e "---> 2. 复制nginx配置文件\n"
|
echo -e "---> 2. 复制nginx配置文件\n"
|
||||||
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
||||||
cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf
|
envsubst '${qlBaseUrl}' < $nginx_app_conf > /etc/nginx/conf.d/front.conf
|
||||||
echo -e "---> 配置文件复制完成\n"
|
echo -e "---> 配置文件复制完成\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ import_config() {
|
||||||
[[ -f $file_config_user ]] && . $file_config_user
|
[[ -f $file_config_user ]] && . $file_config_user
|
||||||
[[ -f $file_env ]] && . $file_env
|
[[ -f $file_env ]] && . $file_env
|
||||||
|
|
||||||
|
ql_base_url=${QlBaseUrl:-"/"}
|
||||||
command_timeout_time=${CommandTimeoutTime:-"1h"}
|
command_timeout_time=${CommandTimeoutTime:-"1h"}
|
||||||
proxy_url=${ProxyUrl:-""}
|
proxy_url=${ProxyUrl:-""}
|
||||||
file_extensions=${RepoFileExtensions:-"js py"}
|
file_extensions=${RepoFileExtensions:-"js py"}
|
||||||
|
|
|
@ -327,7 +327,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-layout-sider {
|
.ant-layout-sider {
|
||||||
border-right: 1px solid rgba(0, 0, 0, 0.06);
|
border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-pro-sider-logo {
|
.ant-pro-sider-logo {
|
||||||
|
|
|
@ -108,7 +108,6 @@ const CronDetailModal = ({
|
||||||
wordWrap: 'on',
|
wordWrap: 'on',
|
||||||
}}
|
}}
|
||||||
onMount={(editor, monaco) => {
|
onMount={(editor, monaco) => {
|
||||||
console.log(monaco);
|
|
||||||
editorRef.current = editor;
|
editorRef.current = editor;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -390,7 +390,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
const getCrons = () => {
|
const getCrons = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { page, size, sorter } = pageConf;
|
const { page, size, sorter } = pageConf;
|
||||||
let url = `${config.apiPrefix}crons?searchText=${searchText}&page=${page}&size=${size}`;
|
let url = `${config.apiPrefix}crons?searchValue=${searchText}&page=${page}&size=${size}`;
|
||||||
if (sorter && sorter.field) {
|
if (sorter && sorter.field) {
|
||||||
url += `&sortField=${sorter.field}&sortType=${
|
url += `&sortField=${sorter.field}&sortType=${
|
||||||
sorter.order === 'ascend' ? 'ASC' : 'DESC'
|
sorter.order === 'ascend' ? 'ASC' : 'DESC'
|
||||||
|
|
|
@ -186,7 +186,7 @@ const ViewManageModal = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCronViews();
|
// getCronViews();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user