From 7afd8032a8a4ca5d2a0372c910c364f8ab1f3674 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Sun, 16 Aug 2020 19:57:30 +0200 Subject: [PATCH] Improve API response and add a static website at root --- index.html | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ main.js | 20 ++++++++++++ style.css | 70 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 184 insertions(+) create mode 100644 index.html create mode 100644 main.js create mode 100644 style.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..63b80aa --- /dev/null +++ b/index.html @@ -0,0 +1,94 @@ + + + + + + + + Ryujinx Ldn + + + +
+

Status

+

Multiplayer statistics for Ryujinx local wireless game connection.

+
+
+
+
+
+
+

Who is online ?

+
+
+
+
+
+
+
+
+
+

Hosted Games

+
+
+ + + + + + + + + + +
GamePlayersState
+
+
+
+
+ +
+ + + + + + + \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..77cd25d --- /dev/null +++ b/main.js @@ -0,0 +1,20 @@ +$(document).ready(function() { + $.getJSON("/api", function(data) { + $(".main-stats").append('
Public Players
' + data.public_players_count + '
'); + $(".main-stats").append('
Private Players
' + data.private_players_count + '
'); + $(".main-stats").append('
Total Players
' + data.total_players_count + '
'); + $(".main-stats").append('
'); + $(".main-stats").append('
Public Games
' + data.public_games_count + '
'); + $(".main-stats").append('
Private Games
' + data.private_games_count + '
'); + $(".main-stats").append('
Total Games
' + data.total_games_count + '
'); + $(".main-stats").append('
'); + $(".main-stats").append('
In Connection
' + data.in_progress_count + '
'); + $(".main-stats").append('
On Proxy Server
' + data.master_proxy_count + '
'); + }); + + $.getJSON("/api/public_games", function(data) { + $.each(data, function() { + $(".games-table").append(' ' + this.game_name + '
(' + this.title_id + ')' + this.player_count + '/' + this.max_player_count + '
' + this.players.join(', ') + ' ' + this.mode + ' (' + this.status + ')'); + }); + }); +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..2d22c44 --- /dev/null +++ b/style.css @@ -0,0 +1,70 @@ +html { + font-size: 14px; +} + +body { + background-color: #303036 !important; + color: #FFFFFF; +} + +.navbar { + background-color: #303036; +} + +table { + color: #FFFFFF !important; +} + +.public-games { + height: 300px; + overflow-y: scroll; +} + +.display-4, .font-weight-normal { + font-weight: 500 !important; +} + +.container { + max-width: 1280px; +} + +.intro-header { + max-width: 700px; +} + +.card { + border: none !important; +} + +.card-header { + background-color: #47474e !important; +} + +.card-body { + background-color: #515159; +} + +.row-space { height: 15px; } + +.main-stats .col-4 { + padding-right: 0; +} + +.main-stats .row { + margin-right: -30px; +} + +.titleid { + font-size: 12px; + font-weight: normal; +} + +.online-dot { + color: #4bd6d1; +} + +@media (min-width: 768px) { + html { + font-size: 16px; + } +} \ No newline at end of file