-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
924 additions
and
857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
name: Jekyll test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
Build_Test: | ||
runs-on: ubuntu-20.04 | ||
name: Build Test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: vendor/cache | ||
key: ${{ runner.os }}-bundle-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: ${{ runner.os }}-bundle- | ||
- uses: actions/setup-ruby@v1 | ||
- name: Install dependencies | ||
run: | | ||
bundle config set path 'vendor/cache' | ||
bundle config set cache_all true | ||
bundle install --jobs 4 --retry 3 | ||
[ -d "vendor/cache" ] || { bundle package; } | ||
- name: Build Jekyll site | ||
run: bundle exec jekyll build | ||
name: Jekyll test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
Build_Test: | ||
runs-on: ubuntu-20.04 | ||
name: Build Test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: vendor/cache | ||
key: ${{ runner.os }}-bundle-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: ${{ runner.os }}-bundle- | ||
- uses: actions/setup-ruby@v1 | ||
- name: Install dependencies | ||
run: | | ||
bundle config set path 'vendor/cache' | ||
bundle config set cache_all true | ||
bundle install --jobs 4 --retry 3 | ||
[ -d "vendor/cache" ] || { bundle package; } | ||
- name: Build Jekyll site | ||
run: bundle exec jekyll build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
img/bg.* | ||
Gemfile.lock | ||
composer.lock | ||
vendor/ | ||
.bundle | ||
_site | ||
img/bg.* | ||
Gemfile.lock | ||
composer.lock | ||
vendor/ | ||
.bundle | ||
_site | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Unify Guest Portal | ||
|
||
## License | ||
|
||
This work is licensed under the Creative Commons Attribution 4.0 International License. | ||
# Unify Guest Portal | ||
|
||
## License | ||
|
||
This work is licensed under the Creative Commons Attribution 4.0 International License. | ||
To view a copy of this license, visit [LICENSE](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
theme: null | ||
exclude: | ||
- vendor/bundle | ||
- .bundle | ||
- .gitignore | ||
- composer.json | ||
- Gemfile | ||
theme: null | ||
exclude: | ||
- vendor/bundle | ||
- vendor/cache | ||
- .bundle | ||
- .gitignore | ||
- composer.json | ||
- Gemfile | ||
- README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<!-- Awaiting approval --> | ||
<div id="approval" class="view"> | ||
<div class="spinner"> | ||
<div class="spinner-grow spinner-grow-lg text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<h2 class="noselect">Waiting for | ||
approval...</h2> | ||
<!-- Awaiting approval --> | ||
<div id="approval" class="view"> | ||
<div class="spinner"> | ||
<div class="spinner-grow spinner-grow-lg text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<h2 class="noselect">Waiting for | ||
approval...</h2> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<!-- Error --> | ||
<div id="error" class="view"> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<div id="error-container"> | ||
<h1><i class="far fa-frown text-danger noselect"></i></h1> | ||
<h2 id="error-msg">Error:</h2> | ||
</div> | ||
<!-- Error --> | ||
<div id="error" class="view"> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<div id="error-container"> | ||
<h1><i class="far fa-frown text-danger noselect"></i></h1> | ||
<h2 id="error-msg">Error:</h2> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<!-- Form --> | ||
<div id="form" class="view"> | ||
<form method="POST" action="/submit.php"> | ||
<h1 class="title noselect">Guest Wifi</h1> | ||
<div class="input-group"> | ||
<input class="form-control" type="text" placeholder="Enter your login code" pattern="^\d{5}(?:-)?\d{5}$" | ||
autocomplete="one-time-code" autofocus="" autocapitalize="off" spellcheck="false" inputmode="numeric" | ||
required="" id="otp" maxlength="11" name="code"> | ||
|
||
<span class="input-group-btn"> | ||
<button type="submit" class="btn btn-success ">Connect <i class="fas fa-chevron-right"></i></button> | ||
</span> | ||
</div> | ||
|
||
<div class="separator noselect">or</div> | ||
<button type="button" class="btn btn-danger form-control" id="manual"><i class="fas fa-comment"></i> Manual | ||
approval</button> | ||
</form> | ||
<!-- Form --> | ||
<div id="form" class="view"> | ||
<form method="POST" action="/submit.php"> | ||
<h1 class="title noselect">Guest Wifi</h1> | ||
<div class="input-group"> | ||
<input class="form-control" type="text" placeholder="Enter your login code" pattern="^\d{5}(?:-)?\d{5}$" | ||
autocomplete="one-time-code" autofocus="" autocapitalize="off" spellcheck="false" inputmode="numeric" | ||
required="" id="otp" maxlength="11" name="code"> | ||
|
||
<span class="input-group-btn"> | ||
<button type="submit" class="btn btn-success ">Connect <i class="fas fa-chevron-right"></i></button> | ||
</span> | ||
</div> | ||
|
||
<div class="separator noselect">or</div> | ||
<button type="button" class="btn btn-danger form-control" id="manual"><i class="fas fa-comment"></i> Manual | ||
approval</button> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<!-- Loading --> | ||
<div id="loading" class="view"> | ||
<h1>Communicating with network...</h1> | ||
<div> | ||
<div class="spinner-grow text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<!-- Loading --> | ||
<div id="loading" class="view"> | ||
<h1>Communicating with network...</h1> | ||
<div> | ||
<div class="spinner-grow text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- Success --> | ||
<div id="success" class="view"> | ||
<h1>Welcome! 😄</h1> | ||
<!-- Success --> | ||
<div id="success" class="view"> | ||
<h1>Welcome! 😄</h1> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
<html lang="en-us"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Guest WiFi</title> | ||
<link rel="icon" href="/img/favicon.svg" type="image/x-icon" /> | ||
<link rel="icon" href="/img/favicon.png" type="image/png" /> | ||
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png" sizes="256x256" /> | ||
<link rel="stylesheet" href="/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" href="/css/main.css" /> | ||
<link rel="stylesheet" href="/css/all.min.css"/> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="main col-12 col-md-10 col-xl-4"> | ||
{{ content }} | ||
</div> | ||
</div> | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/js/jquery-ui.min.js"></script> | ||
<script src="/js/main.js"></script> | ||
<script src="/js/modenizr-webp.min.js"></script> | ||
</body> | ||
|
||
<html lang="en-us"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Guest WiFi</title> | ||
<link rel="icon" href="/img/favicon.svg" type="image/x-icon" /> | ||
<link rel="icon" href="/img/favicon.png" type="image/png" /> | ||
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png" sizes="256x256" /> | ||
<link rel="stylesheet" href="/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" href="/css/main.css" /> | ||
<link rel="stylesheet" href="/css/all.min.css"/> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
{{ content }} | ||
</div> | ||
</div> | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/js/jquery-ui.min.js"></script> | ||
<script src="/js/main.js"></script> | ||
<script src="/js/modenizr-webp.min.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
layout: default | ||
--- | ||
<?php | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
$unifi_connection = new UniFi_API\Client($_ENV['hotspot_user'], $_ENV['hotspot_password'], $_ENV['unifi_url'], $_ENV['unifi_site'], $_ENV['unifi_version'], FALSE); | ||
$login = $unifi_connection->login(); | ||
$guests = $unifi_connection->list_guests(); | ||
$clients = $unifi_connection->list_clients(); | ||
?> | ||
<div class="main col-12 col-md-10 col-xl-5"> | ||
<!-- Requests --> | ||
<div class="col-md-6 noselect" style="float:left;text-align: left;"> | ||
<h1 style="text-align: center;">Requests</h1> | ||
<ul class="list-group"> | ||
<?php foreach($clients as $client ) { | ||
$client = get_object_vars($client); | ||
if ($client['is_guest'] == null){ | ||
continue; | ||
} | ||
if($client['authorized']){ | ||
continue; | ||
} | ||
|
||
?> | ||
<li class="list-group-item d-flex justify-content-between align-items-center"><?php echo $client['hostname']; ?> | ||
<div class="request-buttons"> | ||
<button class="btn btn-success"><i class="fas fa-check"></i></button> | ||
<button class="btn btn-danger"><i class="fas fa-times"></i></button> | ||
</div> | ||
</li> | ||
<?php } ?> | ||
|
||
</ul> | ||
</div> | ||
<!-- Online users --> | ||
<div class="col-md-6 noselect" style="float:right; text-align: left;"> | ||
<h1 style="text-align: center;">Online</h1> | ||
<ul class="list-group"> | ||
<?php | ||
foreach($guests as $guest) { | ||
$guest = get_object_vars($guest); | ||
$mac = $guest['mac']; | ||
$name = $unifi_connection->list_devices($mac); | ||
|
||
if ($name != "") { | ||
$output = $name; | ||
} | ||
else { | ||
$output = $mac; | ||
} | ||
?> | ||
<li class="list-group-item"><?php echo $output; ?></li> | ||
<?php | ||
} | ||
?> | ||
</ul> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"require": { | ||
"art-of-wifi/unifi-api-client": "^1.1" | ||
} | ||
{ | ||
"require": { | ||
"art-of-wifi/unifi-api-client": "^1.1" | ||
} | ||
} |
Oops, something went wrong.