forked from abner/for-legacy-web
Bump revolt.js to include rate limiter.
Handle new server flags. Show server ping in developer tab.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Check } from "@styled-icons/boxicons-regular";
|
||||
import { Cog } from "@styled-icons/boxicons-solid";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { Link } from "react-router-dom";
|
||||
@@ -29,7 +30,7 @@ export default observer(({ server }: Props) => {
|
||||
style={{
|
||||
background: bannerURL ? `url('${bannerURL}')` : undefined,
|
||||
}}>
|
||||
{server.owner === "01EX2NCWQ0CHS3QJF0FEQS1GR4" ? (
|
||||
{server.flags && server.flags & 1 ? (
|
||||
<Tooltip content={"Official Server"} placement={"bottom-start"}>
|
||||
<svg width="20" height="20">
|
||||
<image
|
||||
@@ -50,6 +51,20 @@ export default observer(({ server }: Props) => {
|
||||
</svg>
|
||||
</Tooltip>
|
||||
) : undefined}
|
||||
{server.flags && server.flags & 2 ? (
|
||||
<Tooltip content={"Verified Server"} placement={"bottom-start"}>
|
||||
<svg width="20" height="20">
|
||||
<image
|
||||
xlinkHref="/assets/badges/verified.svg"
|
||||
height="20"
|
||||
width="20"
|
||||
/>
|
||||
<foreignObject x="2" y="2" width="15" height="15">
|
||||
<Check size={15} color="black" strokeWidth={8} />
|
||||
</foreignObject>
|
||||
</svg>
|
||||
</Tooltip>
|
||||
) : undefined}
|
||||
|
||||
<ServerName>{server.name}</ServerName>
|
||||
{(server.permission & ServerPermission.ManageServer) > 0 && (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Wrench } from "@styled-icons/boxicons-solid";
|
||||
|
||||
import { useContext } from "preact/hooks";
|
||||
import { useContext, useState } from "preact/hooks";
|
||||
|
||||
import PaintCounter from "../../lib/PaintCounter";
|
||||
import { TextReact } from "../../lib/i18n";
|
||||
@@ -11,8 +11,15 @@ import Header from "../../components/ui/Header";
|
||||
|
||||
export default function Developer() {
|
||||
// const voice = useContext(VoiceContext);
|
||||
|
||||
const client = useContext(AppContext);
|
||||
const userPermission = client.user!.permission;
|
||||
const [ping, setPing] = useState<undefined | number>(client.websocket.ping);
|
||||
|
||||
setInterval(
|
||||
() => setPing(client.websocket.ping),
|
||||
client.options.heartbeat * 1e3,
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -24,6 +31,8 @@ export default function Developer() {
|
||||
<PaintCounter always />
|
||||
</div>
|
||||
<div style={{ padding: "16px" }}>
|
||||
<b>Server Ping:</b> {ping ?? "?"}ms
|
||||
<br />
|
||||
<b>User ID:</b> {client.user!._id} <br />
|
||||
<b>Permission against self:</b> {userPermission} <br />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user