Add system settings, one-click deploy, and simplify embed UI.
Remove Gate scout auto-seeding and the manual hub login button while keeping Gate login and instance SSO. Add password change and database backup/restore, plus deploy scripts with env auto-generation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from flask_wtf.file import FileAllowed, FileField
|
||||
from wtforms import IntegerField, PasswordField, SelectField, StringField, SubmitField
|
||||
from wtforms.validators import DataRequired, NumberRange, Optional, ValidationError
|
||||
from wtforms.validators import DataRequired, EqualTo, Length, NumberRange, Optional, ValidationError
|
||||
|
||||
|
||||
class LoginForm(FlaskForm):
|
||||
@@ -78,3 +79,35 @@ class ServiceForm(FlaskForm):
|
||||
v = (field.data or "").strip()
|
||||
if v and not v.startswith("/"):
|
||||
raise ValidationError("路径需以 / 开头,例如 /admin")
|
||||
|
||||
|
||||
class ChangePasswordForm(FlaskForm):
|
||||
current_password = PasswordField(
|
||||
"当前密码", validators=[DataRequired(message="请输入当前密码")]
|
||||
)
|
||||
new_password = PasswordField(
|
||||
"新密码",
|
||||
validators=[
|
||||
DataRequired(message="请输入新密码"),
|
||||
Length(min=6, message="新密码至少 6 位"),
|
||||
],
|
||||
)
|
||||
confirm_password = PasswordField(
|
||||
"确认新密码",
|
||||
validators=[
|
||||
DataRequired(message="请再次输入新密码"),
|
||||
EqualTo("new_password", message="两次输入的新密码不一致"),
|
||||
],
|
||||
)
|
||||
submit = SubmitField("保存密码")
|
||||
|
||||
|
||||
class RestoreBackupForm(FlaskForm):
|
||||
backup_file = FileField(
|
||||
"备份文件",
|
||||
validators=[
|
||||
DataRequired(message="请选择备份文件"),
|
||||
FileAllowed(["db"], message="仅支持 .db 文件"),
|
||||
],
|
||||
)
|
||||
submit = SubmitField("一键恢复")
|
||||
|
||||
Reference in New Issue
Block a user