diff --git a/bot.js b/bot.js
index a6ba469..f103f3d 100644
--- a/bot.js
+++ b/bot.js
@@ -112,7 +112,8 @@ class Bot {
presences: this.presences,
maindb: this.maindb,
prefix: prefix,
- getGuildHandler: (guild) => this.getGuildHandler(guild, prefix)
+ getGuildHandler: (guild) => this.getGuildHandler(guild, prefix),
+ guildHandlers: this.guildHandlers
});
}
@@ -356,4 +357,4 @@ if (typeof require !== 'undefined' && require.main === module) {
logger.error(err.message);
});
});
-}
\ No newline at end of file
+}
diff --git a/lib/webapi.js b/lib/webapi.js
index 7c01981..287ca20 100644
--- a/lib/webapi.js
+++ b/lib/webapi.js
@@ -166,6 +166,20 @@ exports.WebServer = class {
uptime: () => {
return objects.client.uptime;
},
+ voiceConnectionCount: () => {
+ let dcGuilds = Array.from(objects.client.guilds.values());
+ return dcGuilds.filter((x) => {
+ let gh = objects.guildHandlers[x.id];
+ if (gh) {
+ if (gh.dj)
+ return gh.dj.playing;
+ else
+ return false;
+ } else {
+ return false;
+ }
+ }).length;;
+ }
},
prefix: objects.prefix,
presences: objects.presences,
diff --git a/web/graphql/schema.graphql b/web/graphql/schema.graphql
index 0083f16..957e27d 100644
--- a/web/graphql/schema.graphql
+++ b/web/graphql/schema.graphql
@@ -55,6 +55,7 @@ type Guild {
type Client {
guilds(first: Int = 10, offset: Int = 0, id: String): [Guild]
guildCount: Int
+ voiceConnectionCount: Int
user: User
ping: Float
status: Int
diff --git a/web/http/index.html b/web/http/index.html
index fb27838..3bfeecd 100644
--- a/web/http/index.html
+++ b/web/http/index.html
@@ -39,41 +39,47 @@
Guild Count:
+
+ Active Voice Connections:
+
+
-
-
-
-
-
by
-
+
+
+
+
+
+
+
Stats
+
+ Member Count:
+
+
+
+
DJ
+
+ State:
+
+
+
+ Repeat:
+
+
+
+ Voice Channel:
+
-
-
Stats
-
- Member Count:
-
-
-
-
DJ
-
- State:
-
-
-
- Repeat:
-
-
-
- Voice Channel:
-
-
-
+
diff --git a/web/http/sass/style.sass b/web/http/sass/style.sass
index 20c05e5..e4f6151 100644
--- a/web/http/sass/style.sass
+++ b/web/http/sass/style.sass
@@ -25,7 +25,7 @@ body
margin: 0 auto
text-align: center
max-height: 100vh
- height: 100%
+ height: 100vh
.cell
display: list-item
@@ -61,13 +61,12 @@ div.cell > *
.label
font-weight: bold
-
+
.listContainer
- display: block
+ display: grid
width: 100%
text-align: left
overflow: auto
- display: inline-block
position: relative
max-height: 90vh
@@ -115,6 +114,7 @@ div.cell > *
display: table-cell
.songEntry
+ display: flex
display: flex
background: lighten($cBackgroundVariant, 5)
padding: 2px
@@ -147,11 +147,16 @@ div.cell > *
#column-left, #column-middle, #column-right
width: 33%
- height: 100%
#column-middle
background: $cBackgroundVariant
border-radius: 20px
+ height: 100%
+
+#column-right
+ padding: 0 20px 20px
+ display: grid
+ align-content: start
#user-avatar
max-width: 300px
@@ -196,11 +201,13 @@ div.cell > *
width: 100%
margin: auto
border: none
+ height: 52px
border-radius: 12px
-webkit-appearance: none
#guild-icon-container
padding: 10px 0 0 0
+ display: flex
#guild-icon
max-width: 100px
@@ -208,10 +215,13 @@ div.cell > *
height: auto
border-radius: 25%
+#guild-nameAndIcon
+ width: 50%
+
#dj-songinfo
- display: block
background-color: $cBackgroundVariant
border-radius: 20px
+ overflow-x: hidden
#songinfo-container
display: list-item
@@ -220,14 +230,26 @@ div.cell > *
padding: 10px
width: calc(100% - 20px)
-dj-queue-container
- display: list-item
+#dj-queue-container
+ display: grid
+ padding: 0 5px 5px
#dj-songname
+ font-weight: bold
font-weight: bold
font-size: 120%
#dj-songImg
- width: 100%
+ align-self: center
+ width: 80%
height: auto
- border-radius: 5%
\ No newline at end of file
+ margin: 0 10%
+ border-radius: 5%
+
+#guildinfo
+ max-height: 90vh
+ overflow-y: auto
+
+#dj-songQueue
+ display: grid
+ max-height: 100%
diff --git a/web/http/scripts/query.js b/web/http/scripts/query.js
index c78b9fd..ac1e987 100644
--- a/web/http/scripts/query.js
+++ b/web/http/scripts/query.js
@@ -193,6 +193,7 @@ function queryStatus() {
status
uptime
guildCount
+ voiceConnectionCount
user {
presence {
game
@@ -211,6 +212,7 @@ function queryStatus() {
.innerText = `${sd.days}d ${sd.hours}h ${sd.minutes}min ${sd.seconds}s`;
document.querySelector('#client-guildCount').innerText = d.client.guildCount;
+ document.querySelector('#client-vcCount').innerText = d.client.voiceConnectionCount;
if (d.client.status !== 0) {
document.querySelector('#status-indicator').setAttribute('status', 'offline');
} else {