mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
dashboard
This commit is contained in:
1 parent
37c29ca6cd
commit
09580cebf5
2 files changed
+36
-6
No files matched your search
@@ -41,9 +41,15 @@ export class Dashboard {
|
||||
}
|
||||
|
||||
case "sharedServers": {
|
||||
const sharedUser = await this.remix.client.users.fetch(data.key).catch(() => null);
|
||||
if (!sharedUser) return { error: "User not found" };
|
||||
return await this.remix.getSharedServers(sharedUser);
|
||||
try {
|
||||
const sharedUser = await this.remix.client.users.fetch(data.key).catch(() => null);
|
||||
if (!sharedUser) return { error: "User not found" };
|
||||
return await this.remix.getSharedServers(sharedUser);
|
||||
} catch (e) {
|
||||
const id = Utils.uid();
|
||||
logger.dashboard("[Dashboard] sharedServers error:", id, e);
|
||||
return { error: "Failed to fetch shared servers. Id: " + id };
|
||||
}
|
||||
}
|
||||
|
||||
case "server": {
|
||||
@@ -73,6 +79,10 @@ export class Dashboard {
|
||||
|
||||
case "function":
|
||||
return await this.runFunction(data.params);
|
||||
|
||||
default:
|
||||
logger.dashboard("[Dashboard] Unknown request type:", data.type);
|
||||
return { error: "Unknown request type: " + (data.type ?? "(none)") };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user