Add developer API, Prometheus metrics, and community links
This commit is contained in:
@@ -24,6 +24,7 @@ export function Dashboard() {
|
||||
[token, setToken] = useState(""),
|
||||
[busy, setBusy] = useState(false);
|
||||
const router = useRouter();
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const load = useCallback(async () => {
|
||||
try {
|
||||
const [m, t] = await Promise.all([
|
||||
@@ -34,6 +35,7 @@ export function Dashboard() {
|
||||
]);
|
||||
setMaps(m.maps);
|
||||
setTokens(t.tokens);
|
||||
setLoaded(true);
|
||||
setError("");
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
@@ -98,10 +100,22 @@ export function Dashboard() {
|
||||
</div>
|
||||
{error && (
|
||||
<p role="alert" className="error-message">
|
||||
{t(error)}
|
||||
{t(error)}{" "}
|
||||
<button
|
||||
type="button"
|
||||
className="text-link"
|
||||
onClick={() => void load()}
|
||||
>
|
||||
{t("Retry")}
|
||||
</button>
|
||||
</p>
|
||||
)}
|
||||
{!maps.length && (
|
||||
{!loaded && !error && (
|
||||
<p role="status" className="muted">
|
||||
{t("Loading…")}
|
||||
</p>
|
||||
)}
|
||||
{loaded && !maps.length && (
|
||||
<div className="empty-state">
|
||||
<h2>{t("A blank map is a beginning.")}</h2>
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user