fix: restore overflow on sound cards + fix connectedSince uptime
- Restore overflow:hidden on html/body, sound-card, modal, admin items - Only .now-playing and .np-name keep unbounded width (Last Played bubble) - Fix Verbunden seit 0s: auto-set connectedSince when connection is ready but timestamp was not recorded (e.g. after redeploy)
This commit is contained in:
parent
de67a15050
commit
197af92909
2 changed files with 1656 additions and 1639 deletions
|
|
@ -1526,11 +1526,15 @@ app.get('/api/events', (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
const statsSnap: Record<string, any> = {};
|
const statsSnap: Record<string, any> = {};
|
||||||
for (const [gId, st] of guildAudioState) {
|
for (const [gId, st] of guildAudioState) {
|
||||||
|
const status = st.connection.state?.status ?? 'unknown';
|
||||||
|
if (status === 'ready' && !connectedSince.has(gId)) {
|
||||||
|
connectedSince.set(gId, new Date().toISOString());
|
||||||
|
}
|
||||||
const ch = client.channels.cache.get(st.channelId);
|
const ch = client.channels.cache.get(st.channelId);
|
||||||
statsSnap[gId] = {
|
statsSnap[gId] = {
|
||||||
voicePing: (st.connection.ping as any)?.ws ?? null,
|
voicePing: (st.connection.ping as any)?.ws ?? null,
|
||||||
gatewayPing: client.ws.ping,
|
gatewayPing: client.ws.ping,
|
||||||
status: st.connection.state?.status ?? 'unknown',
|
status,
|
||||||
channelName: ch && 'name' in ch ? (ch as any).name : null,
|
channelName: ch && 'name' in ch ? (ch as any).name : null,
|
||||||
connectedSince: connectedSince.get(gId) ?? null,
|
connectedSince: connectedSince.get(gId) ?? null,
|
||||||
};
|
};
|
||||||
|
|
@ -1620,13 +1624,17 @@ app.listen(PORT, () => {
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if (sseClients.size === 0 || guildAudioState.size === 0) return;
|
if (sseClients.size === 0 || guildAudioState.size === 0) return;
|
||||||
for (const [gId, st] of guildAudioState) {
|
for (const [gId, st] of guildAudioState) {
|
||||||
|
const status = st.connection.state?.status ?? 'unknown';
|
||||||
|
if (status === 'ready' && !connectedSince.has(gId)) {
|
||||||
|
connectedSince.set(gId, new Date().toISOString());
|
||||||
|
}
|
||||||
const ch = client.channels.cache.get(st.channelId);
|
const ch = client.channels.cache.get(st.channelId);
|
||||||
sseBroadcast({
|
sseBroadcast({
|
||||||
type: 'voicestats',
|
type: 'voicestats',
|
||||||
guildId: gId,
|
guildId: gId,
|
||||||
voicePing: (st.connection.ping as any)?.ws ?? null,
|
voicePing: (st.connection.ping as any)?.ws ?? null,
|
||||||
gatewayPing: client.ws.ping,
|
gatewayPing: client.ws.ping,
|
||||||
status: st.connection.state?.status ?? 'unknown',
|
status,
|
||||||
channelName: ch && 'name' in ch ? (ch as any).name : null,
|
channelName: ch && 'name' in ch ? (ch as any).name : null,
|
||||||
connectedSince: connectedSince.get(gId) ?? null,
|
connectedSince: connectedSince.get(gId) ?? null,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
background: var(--bg-deep);
|
background: var(--bg-deep);
|
||||||
color: var(--text-normal);
|
color: var(--text-normal);
|
||||||
font-family: var(--font);
|
font-family: var(--font);
|
||||||
|
|
@ -376,6 +377,7 @@ input, select {
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
width: 340px;
|
width: 340px;
|
||||||
box-shadow: 0 20px 60px rgba(0,0,0,.4);
|
box-shadow: 0 20px 60px rgba(0,0,0,.4);
|
||||||
|
overflow: hidden;
|
||||||
animation: slideUp .2s ease;
|
animation: slideUp .2s ease;
|
||||||
}
|
}
|
||||||
@keyframes slideUp {
|
@keyframes slideUp {
|
||||||
|
|
@ -969,6 +971,7 @@ input, select {
|
||||||
transition: all var(--transition);
|
transition: all var(--transition);
|
||||||
border: 2px solid transparent;
|
border: 2px solid transparent;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
overflow: hidden;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
animation: card-enter 350ms ease-out forwards;
|
animation: card-enter 350ms ease-out forwards;
|
||||||
|
|
@ -1064,6 +1067,8 @@ input, select {
|
||||||
color: var(--text-normal);
|
color: var(--text-normal);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
}
|
}
|
||||||
|
|
@ -1689,6 +1694,8 @@ input, select {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--text-normal);
|
color: var(--text-normal);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1696,6 +1703,8 @@ input, select {
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: var(--text-faint);
|
color: var(--text-faint);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue