Add dashboard UI source and track it in the repository.

Expose the Vite/React website source under dashboard/ (with node_modules still ignored) so the full dashboard can be built and maintained from this repo.
This commit is contained in:
Char committed 2026-07-26 13:09:19 +01:00
1 parent e97e281bda
commit b82f69783d
117 files changed
+18615 -3

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import type { ConfigSchema } from "./types";
import { messagesSchema } from "./messages";
import { supportbotSchema } from "./supportbot";
import { supportbotAiSchema } from "./supportbot-ai";
import { ticketPanelSchema } from "./ticket-panel";
export type ConfigFileName =
| "supportbot"
| "ticket-panel"
| "commands"
| "messages"
| "supportbot-ai";
export const configSchemas: Record<ConfigFileName, ConfigSchema | "commands"> = {
supportbot: supportbotSchema,
"ticket-panel": ticketPanelSchema,
commands: "commands",
messages: messagesSchema,
"supportbot-ai": supportbotAiSchema,
};
export function getSchema(file: string): ConfigSchema | "commands" | null {
if (file in configSchemas) {
return configSchemas[file as ConfigFileName];
}
return null;
}
export * from "./types";
@@ -0,0 +1,41 @@
import type { ConfigSchema } from "./types";
export const messagesSchema: ConfigSchema = [
{
title: "Info command",
fields: [
{ path: "Info.Title", label: "Title", type: "text" },
{ path: "Info.Description", label: "Description", type: "textarea" },
{ path: "Info.Button", label: "Button label", type: "text" },
{ path: "Info.URL", label: "Button URL", type: "text" },
{ path: "Info.Colour", label: "Colour", type: "color" },
],
},
{
title: "Welcome message",
fields: [
{ path: "Welcome.Enabled", label: "Enabled", type: "boolean" },
{
path: "Welcome.LayoutStyle",
label: "Layout style",
type: "select",
options: [
{ value: "modern", label: "Modern (components)" },
{ value: "classic", label: "Classic embed" },
],
},
{ path: "Welcome.Embed.Colour", label: "Embed colour", type: "color" },
{ path: "Welcome.Embed.Title", label: "Embed title", type: "text" },
{ path: "Welcome.Embed.Message", label: "Embed message", type: "textarea" },
],
},
{
title: "Leave message",
fields: [
{ path: "Leave.Enabled", label: "Enabled", type: "boolean" },
{ path: "Leave.Embed.Colour", label: "Embed colour", type: "color" },
{ path: "Leave.Embed.Title", label: "Embed title", type: "text" },
{ path: "Leave.Embed.Message", label: "Embed message", type: "textarea" },
],
},
];
@@ -0,0 +1,142 @@
import type { ConfigSchema } from "./types";
const providers = [
{ value: "openai", label: "OpenAI" },
{ value: "groq", label: "Groq" },
{ value: "claude", label: "Claude" },
];
const messageTypes = [
{ value: "text", label: "Plain text" },
{ value: "embed", label: "Embed" },
{ value: "components_v2", label: "Components v2" },
];
const memoryScopes = [
{ value: "channel", label: "Per channel" },
{ value: "guild", label: "Per server" },
];
export const supportbotAiSchema: ConfigSchema = [
{
title: "General",
fields: [
{ path: "Enabled", label: "AI enabled", type: "boolean" },
{
path: "General.Provider",
label: "Provider",
type: "select",
options: providers,
},
{ path: "General.Model", label: "Model", type: "text" },
{
path: "General.Model_API_Key",
label: "API key",
type: "secret",
placeholder: "MODEL_API_KEY",
},
{ path: "General.Tokens", label: "Max tokens", type: "number" },
{
path: "General.Temperature",
label: "Temperature",
type: "number",
},
{ path: "General.Name", label: "Display name", type: "text" },
{
path: "General.PastebinAPI_Key",
label: "Pastebin API key",
type: "secret",
placeholder: "PASTEBIN_API_KEY",
},
{
path: "General.PastebinAPI_URL",
label: "Pastebin API URL",
type: "text",
},
],
},
{
title: "Style & channel",
fields: [
{
path: "Style.MessageType",
label: "Message type",
type: "select",
options: messageTypes,
},
{
path: "Features.SuggestTickets",
label: "Suggest tickets",
type: "boolean",
},
{
path: "Channels.AIChannel",
label: "AI channel ID",
type: "discordId",
},
{ path: "Embed.Color", label: "Embed colour", type: "color" },
{ path: "Embed.Footer", label: "Embed footer", type: "text" },
],
},
{
title: "Memory",
fields: [
{ path: "Memory.Enabled", label: "Memory enabled", type: "boolean" },
{ path: "Memory.StoreFacts", label: "Store facts", type: "boolean" },
{
path: "Memory.StoreSummaries",
label: "Store summaries",
type: "boolean",
},
{
path: "Memory.MaxRecentMessages",
label: "Max recent messages",
type: "number",
},
{
path: "Memory.Scope",
label: "Memory scope",
type: "select",
options: memoryScopes,
},
],
},
{
title: "Custom instructions",
fields: [
{
path: "CustomInstructions",
label: "Instruction lines",
type: "stringList",
description: "One instruction per line sent to the AI.",
},
],
},
{
title: "Messages",
fields: [
{
path: "Messages.ErrorResponse",
label: "Error response",
type: "text",
},
{ path: "Messages.AIError", label: "AI error", type: "text" },
{ path: "Messages.AIDisabled", label: "AI disabled", type: "text" },
{
path: "Messages.MessageTooLong",
label: "Message too long",
type: "text",
},
{
path: "Messages.SuggestTicketText",
label: "Suggest ticket text",
type: "text",
},
{
path: "Messages.SuggestTicketReaction",
label: "Suggest ticket emoji",
type: "emoji",
},
],
},
];
@@ -0,0 +1,507 @@
import type { ConfigSchema } from "./types";
const activityTypes = [
{ value: "Playing", label: "Playing" },
{ value: "Watching", label: "Watching" },
{ value: "Listening", label: "Listening" },
{ value: "Competing", label: "Competing" },
{ value: "Streaming", label: "Streaming" },
];
const suggestionModes = [
{ value: "Channel", label: "Channel" },
{ value: "Forum", label: "Forum" },
];
const ticketTypes = [
{ value: "channels", label: "Channels" },
{ value: "threads", label: "Threads" },
];
const ticketSubjects = [
{ value: "description", label: "Channel description" },
{ value: "embed", label: "Embed" },
];
const buttonStyles = [
{ value: "1", label: "Blurple" },
{ value: "2", label: "Grey" },
{ value: "3", label: "Green" },
{ value: "4", label: "Red" },
];
export const supportbotSchema: ConfigSchema = [
{
title: "General",
fields: [
{ path: "General.Name", label: "Bot name", type: "text" },
{
path: "General.Token",
label: "Bot token",
type: "secret",
description: "Masked in the dashboard. Your real token is preserved on save.",
},
{
path: "General.GuildId",
label: "Server (guild) ID",
type: "discordId",
description:
"Right-click your Discord server icon → Copy Server ID. The bot should only stay in this server.",
placeholder: "Discord server snowflake ID",
},
{
path: "General.Addons.Enabled",
label: "Addons enabled",
type: "boolean",
},
],
},
{
title: "Activity",
fields: [
{ path: "Activity.Status", label: "Status text", type: "text" },
{
path: "Activity.Type",
label: "Activity type",
type: "select",
options: activityTypes,
},
{
path: "Activity.StreamingURL",
label: "Streaming URL",
type: "text",
description: "Required when type is Streaming.",
},
],
},
{
title: "Embeds",
fields: [
{ path: "Embed.Colours.General", label: "General colour", type: "color" },
{ path: "Embed.Colours.Success", label: "Success colour", type: "color" },
{ path: "Embed.Colours.Error", label: "Error colour", type: "color" },
{ path: "Embed.Colours.Warn", label: "Warn colour", type: "color" },
{ path: "Embed.Footer", label: "Footer text", type: "text" },
],
},
{
title: "Roles",
fields: [
{
path: "Roles.AutoRole.Enabled",
label: "Auto role enabled",
type: "boolean",
},
{
path: "Roles.AutoRole.Role",
label: "Auto role",
type: "discordRole",
},
{
path: "Roles.StaffMember.Staff",
label: "Staff role",
type: "discordRole",
},
{
path: "Roles.StaffMember.Admin",
label: "Admin role",
type: "discordRole",
},
{
path: "Roles.StaffMember.Moderator",
label: "Moderator role",
type: "discordRole",
},
{
path: "Roles.Mod.AllowSupportStaff",
label: "Allow support staff /mod",
type: "boolean",
},
],
},
{
title: "Welcome & leave",
fields: [
{ path: "Welcome.Enabled", label: "Welcome enabled", type: "boolean" },
{
path: "Welcome.Channel",
label: "Welcome channel",
type: "discordChannel",
},
{ path: "Leave.Enabled", label: "Leave enabled", type: "boolean" },
{
path: "Leave.Channel",
label: "Leave channel",
type: "discordChannel",
},
],
},
{
title: "Suggestions",
fields: [
{
path: "Suggestions.Mode",
label: "Mode",
type: "select",
options: suggestionModes,
},
{
path: "Suggestions.Channel",
label: "Suggestions channel",
type: "discordChannel",
},
{
path: "Suggestions.ForumChannel",
label: "Forum channel",
type: "discordChannel",
},
{
path: "Suggestions.UpvoteEmoji",
label: "Upvote emoji",
type: "emoji",
},
{
path: "Suggestions.DownvoteEmoji",
label: "Downvote emoji",
type: "emoji",
},
{ path: "Suggestions.OwnSuggestion", label: "Own suggestion votes", type: "boolean" },
{ path: "Suggestions.ShowUsers", label: "Show users", type: "boolean" },
{
path: "Suggestions.UpvoteTitle",
label: "Upvote button title",
type: "text",
},
{
path: "Suggestions.DownvoteTitle",
label: "Downvote button title",
type: "text",
},
{
path: "Suggestions.Threads.Enabled",
label: "Suggestion threads",
type: "boolean",
},
{
path: "Suggestions.Threads.Title",
label: "Thread title",
type: "text",
},
{
path: "Suggestions.Threads.Reason",
label: "Thread reason",
type: "text",
},
{
path: "Suggestions.Buttons.Upvote",
label: "Upvote button style",
type: "select",
options: buttonStyles,
},
{
path: "Suggestions.Buttons.Downvote",
label: "Downvote button style",
type: "select",
options: buttonStyles,
},
{
path: "Suggestions.Buttons.RemoveVote",
label: "Remove vote button style",
type: "select",
options: buttonStyles,
},
{
path: "Suggestions.Buttons.RemoveVote_Title",
label: "Remove vote title",
type: "text",
},
{
path: "Suggestions.Tags.Created",
label: "Tag: created",
type: "text",
},
{
path: "Suggestions.Tags.Considering",
label: "Tag: considering",
type: "text",
},
{
path: "Suggestions.Tags.Solved",
label: "Tag: solved",
type: "text",
},
{
path: "Suggestions.Tags.Denied",
label: "Tag: denied",
type: "text",
},
],
},
{
title: "Tickets",
fields: [
{
path: "Ticket.TicketType",
label: "Ticket type",
type: "select",
options: ticketTypes,
},
{
path: "Ticket.UserManagement.DMOnAdd",
label: "DM when added to ticket",
type: "boolean",
},
{
path: "Ticket.UserManagement.DMOnRemove",
label: "DM when removed from ticket",
type: "boolean",
},
{
path: "Ticket.UserManagement.DMTranscript",
label: "DM transcript on close",
type: "boolean",
},
{
path: "Ticket.TicketHome",
label: "Ticket home channel",
type: "discordChannel",
},
{
path: "Ticket.TicketChannelsCategory",
label: "Ticket category",
type: "discordCategory",
},
{
path: "Ticket.TicketChannelsCategory2",
label: "Overflow ticket category",
type: "discordCategory",
description: "Used when the first category is full.",
},
{
path: "Ticket.TicketArchiveCategory",
label: "Archive category",
type: "discordCategory",
},
{ path: "Ticket.Channel", label: "Channel prefix", type: "text" },
{
path: "Ticket.TicketSubject",
label: "Ticket subject display",
type: "select",
options: ticketSubjects,
},
{ path: "Ticket.Timeout", label: "Close timeout (minutes)", type: "number" },
{
path: "Ticket.TicketsPerUser",
label: "Tickets per user",
type: "number",
},
{ path: "Ticket.TicketReason", label: "Require reason", type: "boolean" },
{
path: "Ticket.Close.StaffOnly",
label: "Close staff only",
type: "boolean",
},
{
path: "Ticket.Invites.StaffOnly",
label: "Ticket invites staff only",
type: "boolean",
},
{
path: "Ticket.ClaimTickets.Enabled",
label: "Claim tickets",
type: "boolean",
},
{
path: "Ticket.ClaimTickets.Channel",
label: "Claim log channel",
type: "discordChannel",
},
{
path: "Ticket.ClaimTickets.ClaimAcceptTime",
label: "Claim accept time (ms)",
type: "number",
},
{
path: "Ticket.ClaimTickets.ButtonTitle",
label: "Claim button title",
type: "text",
},
{
path: "Ticket.ClaimTickets.ButtonEmoji",
label: "Claim button emoji",
type: "emoji",
},
{
path: "Ticket.ClaimTickets.Button",
label: "Claim button style",
type: "select",
options: buttonStyles,
},
{
path: "Ticket.ReviewSystem.Enabled",
label: "Review system",
type: "boolean",
},
{
path: "Ticket.ReviewSystem.Channel",
label: "Review channel",
type: "discordChannel",
},
{
path: "Ticket.ReviewSystem.UseModal",
label: "Review uses modal",
type: "boolean",
},
{
path: "Ticket.Log.TicketDataLog",
label: "Ticket data log channel",
type: "discordChannel",
},
{
path: "Ticket.Log.TickeDataTitle",
label: "Ticket data log title",
type: "text",
},
{
path: "Ticket.Log.TicketBlacklistLog",
label: "Blacklist log channel",
type: "discordChannel",
},
{
path: "Ticket.AIMode.Enabled",
label: "AI mode in tickets",
type: "boolean",
},
{
path: "Ticket.AIMode.ThreadName",
label: "AI thread name",
type: "text",
},
{
path: "Ticket.AIMode.WelcomeMessage",
label: "AI welcome message",
type: "textarea",
},
{
path: "Ticket.DepartmentSystem.Enabled",
label: "Departments enabled",
type: "boolean",
},
{
path: "Ticket.DepartmentSystem.Placeholder",
label: "Department placeholder",
type: "text",
},
{
path: "Ticket.DepartmentSystem.DefaultDepartment",
label: "Default department key",
type: "text",
},
{
path: "Ticket.PrioritySystem.Enabled",
label: "Priority system",
type: "boolean",
},
{
path: "Ticket.PrioritySystem.DefaultPriority",
label: "Default priority",
type: "text",
},
{
path: "Ticket.PrioritySystem.AllowUsersToChooseOnOpen",
label: "User picks priority on open",
type: "boolean",
},
{
path: "Ticket.Questions.Enabled",
label: "Ticket questions",
type: "boolean",
},
{
path: "Ticket.Questions.List",
label: "Default questions",
type: "stringList",
},
],
},
{
title: "Voice tickets",
fields: [
{ path: "VoiceTickets.Name", label: "VC name format", type: "text" },
{
path: "VoiceTickets.Category",
label: "VC category",
type: "discordCategory",
},
],
},
{
title: "Logging",
fields: [
{
path: "MessageDelete.Channel",
label: "Message delete log channel",
type: "discordChannel",
},
{
path: "MessageDelete.Colour",
label: "Message delete embed colour",
type: "color",
},
{
path: "MessageUpdate.Channel",
label: "Message update log channel",
type: "discordChannel",
},
{
path: "MessageUpdate.Colour",
label: "Message update embed colour",
type: "color",
},
{
path: "Translate.TranslateLog",
label: "Translate log channel",
type: "discordChannel",
},
],
},
{
title: "Buttons & menus",
description: "Ticket panel and control button labels and styles.",
fields: [
{ path: "Buttons.General.Delete", label: "Delete emoji", type: "emoji" },
{
path: "Buttons.General.DeleteStyle",
label: "Delete button style",
type: "select",
options: buttonStyles,
},
{
path: "Buttons.Voice.TicketDeleteText",
label: "Voice delete label",
type: "text",
},
{
path: "Buttons.Tickets.ClaimEmoji",
label: "Ticket claim emoji",
type: "emoji",
},
{
path: "Buttons.Tickets.ClaimStyle",
label: "Ticket claim style",
type: "select",
options: buttonStyles,
},
{
path: "SelectMenus.Tickets.PanelEmoji",
label: "Panel menu emoji",
type: "emoji",
},
{
path: "SelectMenus.Tickets.CloseEmoji",
label: "Close menu emoji",
type: "emoji",
},
],
},
];
@@ -0,0 +1,109 @@
import type { ConfigSchema } from "./types";
const buttonStyles = [
{ value: "1", label: "Blurple" },
{ value: "2", label: "Grey" },
{ value: "3", label: "Green" },
{ value: "4", label: "Red" },
];
const layouts = [
{ value: "1", label: "Style 1" },
{ value: "2", label: "Style 2" },
{ value: "3", label: "Style 3" },
{ value: "4", label: "Style 4 (classic embed)" },
];
export const ticketPanelSchema: ConfigSchema = [
{
title: "Panel",
fields: [{ path: "Panel", label: "Panel enabled", type: "boolean" }],
},
{
title: "Embed style",
fields: [
{ path: "Style.Title", label: "Title", type: "text" },
{ path: "Style.Description", label: "Description", type: "textarea" },
{ path: "Style.Image", label: "Image URL", type: "text" },
{ path: "Style.Color", label: "Embed colour", type: "color" },
{
path: "Style.Layout",
label: "Layout",
type: "select",
options: layouts,
},
],
},
{
title: "Create button",
fields: [
{ path: "Button.Text", label: "Button text", type: "text" },
{ path: "Button.Emoji", label: "Button emoji", type: "emoji" },
{
path: "Button.Color",
label: "Button style",
type: "select",
options: buttonStyles,
},
{ path: "Button.CustomId", label: "Custom ID", type: "text" },
],
},
{
title: "Department menu",
fields: [
{ path: "DepartmentMenu.CustomId", label: "Custom ID", type: "text" },
{ path: "DepartmentMenu.Placeholder", label: "Placeholder", type: "text" },
{
path: "DepartmentMenu.DefaultDescription",
label: "Default description",
type: "text",
},
{
path: "DepartmentMenu.DefaultEmoji",
label: "Default emoji",
type: "emoji",
},
],
},
{
title: "Panel settings",
fields: [
{ path: "Settings.Image", label: "Show image", type: "boolean" },
{ path: "Settings.TopTitle", label: "Top title", type: "boolean" },
{ path: "Settings.TopDivider", label: "Top divider", type: "boolean" },
{
path: "Settings.BottomTitle",
label: "Bottom title",
type: "boolean",
},
{
path: "Settings.BottomDivider",
label: "Bottom divider",
type: "boolean",
},
],
},
{
title: "Messages",
description: "Bot messages when using the ticket panel command.",
fields: [
{
path: "Messages.NotConfigured",
label: "Not configured",
type: "textarea",
},
{
path: "Messages.InvalidChannel",
label: "Invalid channel",
type: "textarea",
},
{ path: "Messages.PanelSent", label: "Panel sent", type: "text" },
{
path: "Messages.PanelSentWithDepartments",
label: "Panel sent (departments)",
type: "text",
},
{ path: "Messages.SendError", label: "Send error", type: "text" },
],
},
];
+32
View File
@@ -0,0 +1,32 @@
export type FieldType =
| "text"
| "textarea"
| "boolean"
| "number"
| "color"
| "emoji"
| "select"
| "discordId"
| "discordChannel"
| "discordRole"
| "discordCategory"
| "secret"
| "stringList"
| "googleFont";
export interface ConfigField {
path: string;
label: string;
type: FieldType;
description?: string;
options?: { value: string; label: string }[];
placeholder?: string;
}
export interface ConfigSection {
title: string;
description?: string;
fields: ConfigField[];
}
export type ConfigSchema = ConfigSection[];