Skip to content

Commit

Permalink
Add initial wwwroot/admin/default/ HTML5 admin pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Daiyuu Nobori committed May 29, 2019
1 parent 529d8f5 commit 39b80e0
Show file tree
Hide file tree
Showing 26 changed files with 7,515 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
.project
.settings/
Makefile
bin/
/src/bin/*
!/src/bin/hamcore/
/src/bin/hamcore/*
!/src/bin/hamcore/wwwroot/
build/
cmake-build-debug/
src/bin/hamcore/authors.txt
Expand Down
1 change: 1 addition & 0 deletions src/bin/hamcore/wwwroot/admin/default/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
16 changes: 16 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"trace": true,
"sourceMaps": true,
"name": "Launch Chrome",
"preLaunchTask": "webpack build",
"file": "${workspaceFolder}/index.html",
"webRoot": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart"
}
]
}
5 changes: 5 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"tsconfig_webpack.json": "jsonc"
}
}
45 changes: 45 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "webpack build",
"type": "npm",
"script": "build",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "webpack watch",
"type": "npm",
"script": "watch",
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "^$"
},
"background": {
"activeOnStart": true,
"beginsPattern": ".*Version: webpack.*",
"endsPattern": ".*\\[built\\]"
},
}
},
{
"label": "tsc build",
"type": "typescript",
"tsconfig": "tsconfig.json",
},
{
"label": "tsc watch",
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
]
}
]
}
23 changes: 23 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/hub.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<!--#include file="include_head.html" -->
<body>
<!--#include file="include_menu.html" -->
<div class="container theme-showcase" role="main">
<H2><div id="HUB_NAME"></div></H2>

<button class="btn btn-lg btn-danger" onclick="JS.DeleteVirtualHub(location.search);">Delete this Virtual Hub</button>

<H3>List of Users</H3>
<ul id="USERS_LIST"></ul>

<H3>List of Active VPN Sessions</H3>
<ul id="SESSIONS_LIST"></ul>
<!--#include file="include_footer.html" -->
</div>
</body>
<script>
JS.HubAdminPage(location.search);
</script>
</html>

4 changes: 4 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/include_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p> </p>
<p> </p>
<hr />
<p>Copyright (c) SoftEther VPN Project under the Apache License 2.0.</p>
9 changes: 9 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/include_head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<head>
<title>SoftEther VPN Server HTML5 Web Administration Console (Under construction!)</title>
<script src="out_webpack/bundle.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous"></script>
<link href="theme.css" rel="stylesheet">
</head>
29 changes: 29 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/include_menu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./">SoftEther VPN Server Web Admin Console</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/api/">JSON-RPC API Reference</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">About <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/SoftEtherVPN/SoftEtherVPN">SoftEther VPN on GitHub</a></li>
<li><a href="https://www.softether.org/">SoftEther.org Web Site</a></li>
</ul>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
45 changes: 45 additions & 0 deletions src/bin/hamcore/wwwroot/admin/default/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<!--#include file="include_head.html" -->
<body>
<!--#include file="include_menu.html" -->
<div class="container theme-showcase" role="main">
<H2>SoftEther VPN Server HTML5 Ajax-based Web Administration Console<BR>(Under construction!)</H2>
<p>This is the sample of HTML5 Ajax-based VPN Server Web Administration Console.</p>
<p>The purpose of this HTML5 admin page is to make administrators easy to set up and manage the running VPN Servers.</p>
<h3>Authentication for this page</h3>
<p>You must supply the HTTP basic authentication credential as following.</p>
<ul>
<li>To login to the VPN server as the entire server administrator, specify empty or "administrator" as the username field,
and specify the server administrative password as the password field.</li>
<li>To login to a particular Virtual Hub as the hub administrator, specify the hub name as the username field, and specify
the hub administrative password as the password field.</li>
</ul>

<h3>Your HTML5 development contribution is very appreciated</h3>
<p>This HTML5 page is obviously under construction, and providing very minimum functions as sample.<BR>This initial page is written by Daiyuu Nobori (the core developer of SoftEther VPN). He is obviously lack of HTML5 development ability.<BR>Please kindly consider to contribute for <strong><a href="https://github.com/SoftEtherVPN/SoftEtherVPN/tree/master/src/bin/hamcore/wwwroot/admin/">SoftEther VPN's development on GitHub.</a></strong> Your code will help every people running SoftEther VPN Server.</p>

<p>This HTML5 page's JavaScript codes directly call <strong><a href="/api/">SoftEther VPN Server JSON-RPC API</a></strong> on the running VPN Server from the web browser.<BR>You can also call the <strong><a href="/api/">SoftEther VPN Server JSON-RPC API</a></strong> remotely from your original application. (JavaScript, TypeScript, C#, Java, Python, Ruby, etc.)</p>
<p><a href="/api/"><strong>The insanely kindness API reference</strong></a> is available.</p>

<H3>List of Virtual Hubs</H3>
<ul id="HUB_LIST"></ul>

<H3>Create new Virtual Hub</H3>
Virtual Hub Name:<BR>
<input id="NEW_HUB_NAME" /> <button class="btn btn-lg btn-primary" onclick="JS.CreateNewHub($('#NEW_HUB_NAME').val(), '#HUB_LIST')">Create</button>

<H3>VPN Server Information</H3>
<ul id="VPN_SERVER_INFO"></ul>

<H3>VPN Server Status</H3>
<ul id="VPN_SERVER_STATUS"></ul>
<!--#include file="include_footer.html" -->
</div>
</body>
<script>
JS.ShowVpnServerInfo("#VPN_SERVER_INFO", "#VPN_SERVER_STATUS");
JS.ListVirtualHubs("#HUB_LIST");
</script>
</html>

Loading

0 comments on commit 39b80e0

Please sign in to comment.