mirror of
https://github.com/dragoonDorise/EmuDeck.git
synced 2025-05-05 16:02:48 +00:00
server changes
This commit is contained in:
parent
3f11ebe64c
commit
daf758df3e
@ -1055,7 +1055,6 @@ function controllerLayout_BAYX(){
|
||||
|
||||
function server_install(){
|
||||
cp "$EMUDECKGIT/tools/server.sh" "$toolsPath/"
|
||||
cp "$EMUDECKGIT/tools/index.html" "$toolsPath/"
|
||||
|
||||
#cp "$EMUDECKGIT/tools/index.html" "$toolsPath/"
|
||||
chmod +x "$toolsPath/server.sh"
|
||||
}
|
@ -719,7 +719,20 @@
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.querySelectorAll("label").forEach((label) => {
|
||||
label.addEventListener("click", function () {
|
||||
document.querySelectorAll("label").forEach((lbl) => {
|
||||
if (lbl !== label) {
|
||||
lbl.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
document.getElementById("filter").addEventListener("input", function () {
|
||||
document.querySelectorAll("label").forEach((lbl) => {
|
||||
lbl.classList.remove("hidden");
|
||||
});
|
||||
|
||||
var filterValue = this.value.toLowerCase();
|
||||
var inputs = document.querySelectorAll('.systems input[type="radio"]');
|
||||
|
||||
|
@ -81,16 +81,24 @@ def get_local_ip():
|
||||
return IP
|
||||
|
||||
def start_server(ip, port):
|
||||
home_config_dir = os.path.expanduser("~/.config/EmuDeck/backend/tools")
|
||||
os.chdir(home_config_dir) # Cambiar el directorio de trabajo
|
||||
http.server.test(HandlerClass=SimpleHTTPRequestHandler, port=port, bind=ip)
|
||||
|
||||
def show_custom_popup(title, message, button_text):
|
||||
popup = tk.Tk()
|
||||
popup.wm_title(title)
|
||||
label = tk.Label(popup, text=message, padx=20, pady=20)
|
||||
label.pack(side="top", fill="x")
|
||||
button = tk.Button(popup, text=button_text, command=popup.destroy, padx=10, pady=15)
|
||||
button.pack()
|
||||
popup.mainloop()
|
||||
|
||||
async def main():
|
||||
global BASE_DIR
|
||||
await getSettings()
|
||||
BASE_DIR = roms_path
|
||||
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
|
||||
ip = get_local_ip()
|
||||
port = 8000
|
||||
|
||||
@ -98,8 +106,7 @@ async def main():
|
||||
server_thread.daemon = True
|
||||
server_thread.start()
|
||||
|
||||
messagebox.showinfo("Server loaded", f"Open http://{ip}:{port}/ in your computer's browser")
|
||||
|
||||
root.destroy()
|
||||
# Mostrar el mensaje en el popup personalizado
|
||||
show_custom_popup("Server loaded", f"Open http://{ip}:{port}/ in your computer's browser. Close this window when you are finished", "Close")
|
||||
|
||||
asyncio.run(main())
|
||||
|
Loading…
x
Reference in New Issue
Block a user