mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-03 01:28:39 +08:00
plugin check
This commit is contained in:
parent
fdc24df613
commit
b6d3a0337d
@ -10,7 +10,7 @@ COPY static ./static
|
|||||||
COPY requirements.txt main.py database.sqlite ./
|
COPY requirements.txt main.py database.sqlite ./
|
||||||
RUN apt update
|
RUN apt update
|
||||||
|
|
||||||
# Install supervisord
|
# Install supervisords
|
||||||
RUN apt install -y supervisor
|
RUN apt install -y supervisor
|
||||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
COPY config/cmd.sh /cmd.sh
|
COPY config/cmd.sh /cmd.sh
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
from api.exception.command_exception import CommandException
|
||||||
|
from api.utils import const
|
||||||
from api.model.user import User
|
from api.model.user import User
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
@ -17,6 +19,8 @@ def AppUpdateUser(user_name, password):
|
|||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
def AppSearchUsers(user_type):
|
def AppSearchUsers(user_type):
|
||||||
|
if user_type != "nginx" or user_type != "portainer":
|
||||||
|
raise CommandException(const.ERROR_CLIENT_PARAM_NOTEXIST, "This plugin doesn't exist!", "This plugin doesn't exist!")
|
||||||
conn = sqlite3.connect('/usr/src/app/database.sqlite')
|
conn = sqlite3.connect('/usr/src/app/database.sqlite')
|
||||||
conn.row_factory = dict_factory
|
conn.row_factory = dict_factory
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
@ -61,7 +61,7 @@ update = "  Compare_content: 新旧版本内容{\n\n" \
|
|||||||
|
|
||||||
appstore_update = "  Update_content: [] 更新内容\n\n}\n\n"
|
appstore_update = "  Update_content: [] 更新内容\n\n}\n\n"
|
||||||
auto = "  auto_update: 目前的自动更新状态\n\n}\n\n"
|
auto = "  auto_update: 目前的自动更新状态\n\n}\n\n"
|
||||||
user = "  user: 用户信息\n\n" \
|
user = "  user: 用户信息{\n\n" \
|
||||||
"      username: 用户名\n\n" \
|
"      username: 用户名\n\n" \
|
||||||
"      password: 密码\n\n" \
|
"      password: 密码\n\n" \
|
||||||
"      nick_name: 昵称\n\n    }\n\n}\n\n"
|
"      nick_name: 昵称\n\n    }\n\n}\n\n"
|
||||||
@ -431,7 +431,7 @@ def AppAutoUpdate(request: Request,auto_update: Optional[str] = Query(default=No
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
@router.api_route("/AppSearchUsers", methods=["GET", "POST"], summary="获取appstore用户信息", response_model=Response, response_description=rd_user_list)
|
@router.api_route("/AppSearchUsers", methods=["GET", "POST"], summary="获取appstore用户信息", response_model=Response, response_description=rd_user_list)
|
||||||
def AppSearchUsers(request: Request, plugin_name: Optional[str] = Query(default=None, description="用户名")):
|
def AppSearchUsers(request: Request, plugin_name: Optional[str] = Query(default=None, description="插件名(仅支持portainer,nginx)")):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
myLogger.info_logger("Receive request: /AppSearchUsers")
|
myLogger.info_logger("Receive request: /AppSearchUsers")
|
||||||
|
Loading…
Reference in New Issue
Block a user