-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch backend to starlette + broadcaster
- Loading branch information
Showing
17 changed files
with
141 additions
and
63 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
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
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 |
---|---|---|
@@ -1,11 +1,22 @@ | ||
document.querySelector("form").addEventListener("submit", async (e) => { | ||
e.preventDefault(); | ||
(() => { | ||
const form = document.querySelector("form"), button = document.querySelector("button[type = submit]"); | ||
form.addEventListener("submit", async (e) => { | ||
e.preventDefault(); | ||
button.innerHTML = `<div class = "spinner-border spinner-border-sm" role = "status"></div>`; | ||
|
||
// Handle authentication | ||
const response = await window.__NWAUTHMETHOD__( | ||
document.getElementById("usernameInput").value, | ||
document.getElementById("passwordInput").value | ||
) | ||
if (response.code !== 200) return notifier.alert(response.data); | ||
load_frame("welcome"); | ||
}); | ||
// Handle authentication | ||
const response = await nightwatch[form.getAttribute("data-nightwatch-action")]( | ||
document.getElementById("usernameInput").value, | ||
document.getElementById("passwordInput").value | ||
) | ||
if (response.code !== 200) { | ||
button.innerText = "Continue"; | ||
return notifier.alert(response.data); | ||
} | ||
|
||
await nightwatch.authenticate(); | ||
if (nightwatch._error) return load_frame(`errors/${nightwatch._error.type}`); | ||
load_frame("welcome"); | ||
}); | ||
document.getElementById("authServer").innerText = nightwatch.auth_server; | ||
})(); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) 2024 iiPython | ||
|
||
# Modules | ||
from broadcaster import Broadcast | ||
|
||
# Setup broadcast connection | ||
broadcast = Broadcast("memory://") |
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.