VPNManager/templates/main/index.html.ep

42 lines
1.6 KiB
Plaintext
Raw Normal View History

2024-07-19 20:06:19 +02:00
% use Encode qw/encode decode/;
2024-07-16 23:49:24 +02:00
% my $users = stash 'users';
<html>
<head>
<link rel="stylesheet" href="/style.css"/>
</head>
<body class="main">
2024-07-19 20:01:15 +02:00
<h2>VPN Users</h2>
2024-07-16 23:49:24 +02:00
<p><a href="/vpn/create-user">Create new vpn user</a>.</p>
% if (defined $users && @$users) {
<ul>
% for my $user (@$users) {
2024-07-19 20:06:19 +02:00
<li>Id: <b><%=$user->id%></b> Name: <b><%=decode 'utf-8', $user->name%></b> Internal IP Address: <b><%=$user->ip_to_text%></b> <a href="/vpn/user/<%=$user->id%>/details">View details</a>
2024-07-16 23:49:24 +02:00
<form class="inline" method="post" action="/vpn/user/<%=$user->id%>/<%=$user->is_enabled ? 'disable' : 'enable'%>">
<input type="submit" value="<%=$user->is_enabled? 'Disable' : 'Enable'%>"/>
</form></li>
% }
% }
</ul>
2024-07-19 20:01:15 +02:00
<h2>Console whitelist</h2>
<h3>Add a user to the console whitelist</h3>
<form action="/whitelist/add" method="post">
<div>
<label for="name">Name</label>
<input name="username"/>
</div>
<input type="submit" value="Submit"/>
2024-07-16 23:49:24 +02:00
</form>
2024-07-19 20:01:15 +02:00
% my $whitelist_users = stash 'whitelist_users';
% if (defined $whitelist_users && @$whitelist_users) {
<h3>List of console users in whitelist</h3>
<ul>
% for my $user (@$whitelist_users) {
<li><%=$user->username%> <form class="inline" method="post" action="/whitelist/<%=$user->id%>/remove">
<input type="submit" value="Delete"/>
</form></li>
% }
</ul>
% }
2024-07-16 23:49:24 +02:00
</body>
</html>