-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from jrsmth/feature/ui-revamp/main
Feature/UI revamp/main
- Loading branch information
Showing
57 changed files
with
1,984 additions
and
393 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
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
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,28 @@ | ||
from flask import Blueprint, Response, current_app | ||
from werkzeug.security import generate_password_hash, check_password_hash | ||
|
||
|
||
# Admin Logic | ||
def construct_blueprint(auth, redis): | ||
admin_page = Blueprint('admin_page', __name__) | ||
username = current_app.config["USERNAME"] | ||
password = current_app.config["PASSWORD"] | ||
|
||
users = { | ||
username: generate_password_hash(password), | ||
} | ||
|
||
@auth.verify_password | ||
def verify_password(user, pwd): | ||
if user in users and check_password_hash(users.get(user), pwd): | ||
return user | ||
|
||
@admin_page.route("/flood") | ||
@auth.login_required | ||
def destroy_all_games(): | ||
print("[destroy_all_games] Request to wipe data requested by: " + auth.current_user()) | ||
redis.clear() | ||
return Response(status=204, response="The flood is over, Noah") | ||
|
||
# Blueprint return | ||
return admin_page |
Empty file.
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
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
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
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
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 |
---|---|---|
|
@@ -19,4 +19,5 @@ zipp~=3.17.0 | |
gevent | ||
flask_socketio | ||
shortuuid | ||
jsons | ||
jsons | ||
Flask-HTTPAuth |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,34 @@ | ||
//Multiple options dropdown | ||
//https://codepen.io/gatoledo1/pen/QWmpWjK | ||
|
||
const optionMenu = document.querySelector(".game-dropdown"), | ||
selectBtn = optionMenu.querySelector(".select-btn"), | ||
options = optionMenu.querySelectorAll(".option"), | ||
sBtn_text = optionMenu.querySelector(".select-btn-text"); | ||
|
||
selectBtn.addEventListener("click", () => | ||
optionMenu.classList.toggle("active") | ||
); | ||
|
||
options.forEach((option) => { | ||
option.addEventListener("click", () => { | ||
selectBtn.classList.remove("touched") | ||
const newOption = option.querySelector(".option-text").innerText; | ||
const radio = $('.radio'); | ||
let gameId; | ||
|
||
if (newOption === 'New Game') { | ||
radio.removeClass("hide"); | ||
gameId = ''; | ||
} else { | ||
radio.addClass("hide"); | ||
gameId = newOption; | ||
} | ||
|
||
$('#game-id')[0].value = gameId; | ||
sBtn_text.innerText = newOption; | ||
|
||
optionMenu.classList.remove("active"); | ||
selectBtn.classList.add("touched") | ||
}); | ||
}); |
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
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
Oops, something went wrong.