Files
frps-manager/templates/user_form.html
T
Your Name 71214524f4 feat: frps-manager v1.0 - frp 0.70.1 multi-tenant web management system
- Multi-tenant client/proxy management with Flask+SQLite
- Frps server control (start/restart/token rotation)
- Generate frpc.ini with shared server token + admin API
- Dashboard API integration (live client/proxy status)
- RBAC: admin/tenant_admin/user roles
- Audit logging for all operations
- Systemd service files included
- Requires legacy INI format (frp 0.70 TOML auth broken)
2026-08-10 14:17:49 +08:00

36 lines
1.8 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ '编辑' if item else '新建' }}用户 · frps-manager{% endblock %}
{% block content %}
<h1>{{ '编辑用户' if item else '新建用户' }}</h1>
<form method="post" class="form-card">
{% if item %}
<label>用户名 <input value="{{ item.username }}" disabled></label>
{% else %}
<label>用户名 <input name="username" required pattern="[a-zA-Z0-9_.-]+"></label>
{% endif %}
<label>显示名 <input name="display_name" value="{{ item.display_name or '' if item else '' }}"></label>
<label>密码 {% if item %}<span class="muted small">(留空表示不修改)</span>{% endif %}
<input name="password" type="password" {% if not item %}required{% endif %} minlength="6">
</label>
<label>角色
<select name="role">
<option value="user" {% if item and item.role == 'user' %}selected{% endif %}>user (普通用户,只能看自己的租户)</option>
<option value="tenant_admin" {% if item and item.role == 'tenant_admin' %}selected{% endif %}>tenant_admin (租户管理员)</option>
<option value="admin" {% if item and item.role == 'admin' %}selected{% endif %}>admin (系统管理员)</option>
</select>
</label>
<label>归属租户
<select name="tenant_id">
<option value="">(不绑定)</option>
{% for t in tenants %}
<option value="{{ t.id }}" {% if item and item.tenant_id == t.id %}selected{% endif %}>{{ t.name }}</option>
{% endfor %}
</select>
</label>
<label class="checkbox"><input type="checkbox" name="is_active" {% if item is none or item.is_active %}checked{% endif %}> 启用</label>
<div class="form-actions">
<button class="btn btn-primary" type="submit">保存</button>
<a class="btn" href="{{ url_for('users_list') }}">取消</a>
</div>
</form>
{% endblock %}