71214524f4
- 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)
71 lines
2.7 KiB
HTML
71 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}客户端 · frps-manager{% endblock %}
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1>客户端 (frpc)</h1>
|
|
<a class="btn btn-primary" href="{{ url_for('clients_new') }}">+ 新建客户端</a>
|
|
</div>
|
|
|
|
{% if tenants|length > 1 %}
|
|
<form method="get" class="filter-bar">
|
|
<label>租户
|
|
<select name="tenant_id" onchange="this.form.submit()">
|
|
<option value="">全部</option>
|
|
{% for t in tenants %}
|
|
<option value="{{ t.id }}" {% if filter_tenant_id == t.id %}selected{% endif %}>{{ t.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
</form>
|
|
{% endif %}
|
|
|
|
<table class="table">
|
|
<thead>
|
|
<tr><th>名称 (frpc user)</th><th>租户</th><th>在线</th><th>NAT</th><th>版本</th><th>frpc 连接</th><th>状态</th><th>操作</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for c in items %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ c.name }}</strong>
|
|
<br><span class="muted small">{{ c.description or '' }}</span>
|
|
{% if c.server_addr %}<br><span class="muted small">frps: {{ c.server_addr }}</span>{% endif %}
|
|
</td>
|
|
<td>{{ c.tenant.name }}</td>
|
|
<td>
|
|
{% if c._online %}
|
|
<span class="badge badge-ok">在线</span>
|
|
<span class="muted small">{{ c._version }}</span>
|
|
{% else %}
|
|
<span class="badge badge-off">离线</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ c._nat }}</td>
|
|
<td>{{ c._version }}</td>
|
|
<td>{{ c._conn_count }}</td>
|
|
<td>{% if c.is_active %}<span class="badge badge-ok">启用</span>{% else %}<span class="badge badge-off">禁用</span>{% endif %}</td>
|
|
<td class="actions">
|
|
<a href="{{ url_for('clients_frpc_config', cid=c.id) }}" target="_blank">frpc.toml</a>
|
|
<a href="{{ url_for('clients_edit', cid=c.id) }}">编辑</a>
|
|
<form method="post" action="{{ url_for('clients_delete', cid=c.id) }}" style="display:inline"
|
|
onsubmit="return confirm('删除客户端 {{ c.name }} ?注意:frps 0.70 用共享 token,删除注册不会立即断开已连的 frpc。');">
|
|
<button class="link-btn link-danger">删除</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="8" class="muted">暂无客户端</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<section style="margin-top: 24px;">
|
|
<h2>使用流程</h2>
|
|
<ol class="muted">
|
|
<li>复制上面任意客户端的 <strong>frpc.toml</strong> 到目标 frpc 主机</li>
|
|
<li>在该主机的 frpc.toml 末尾追加 <code>[[proxies]]</code> 段定义要暴露的本地服务</li>
|
|
<li><code>systemctl enable --now frpc</code> 或 <code>frpc -c /etc/frpc.toml</code></li>
|
|
<li>回到仪表盘或「在线代理」页,应能看到客户端上线</li>
|
|
</ol>
|
|
</section>
|
|
{% endblock %} |