Fully renamed socket to ttp
This commit is contained in:
parent
7ebe028629
commit
76ca664298
13 changed files with 55 additions and 42 deletions
|
|
@ -32,10 +32,10 @@ export const failedUser = {
|
|||
sub_level: 0,
|
||||
user_id: 0,
|
||||
username: "unknown",
|
||||
} as z.infer<typeof socket.get_user_data.response>;
|
||||
} as z.infer<typeof ttp.get_user_data.response>;
|
||||
|
||||
// Socket
|
||||
export const socket = {
|
||||
// TTP
|
||||
export const ttp = {
|
||||
identification: {
|
||||
request: z
|
||||
.object({
|
||||
|
|
@ -162,7 +162,7 @@ export const socket = {
|
|||
},
|
||||
} satisfies Record<string, { request: z.ZodType; response: z.ZodType }>;
|
||||
|
||||
export type Socket = typeof socket;
|
||||
export type TTP = typeof ttp;
|
||||
|
||||
// Storage
|
||||
export interface Storage {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,16 @@ import { Ban, Check, Info, TriangleAlert } from "lucide-react";
|
|||
export function log(
|
||||
logLevel: number,
|
||||
logger: string,
|
||||
color: "red" | "green" | "yellow" | "purple" | "blue",
|
||||
color:
|
||||
| "red"
|
||||
| "green"
|
||||
| "yellow"
|
||||
| "purple"
|
||||
| "blue"
|
||||
| "cyan"
|
||||
| "white"
|
||||
| "black"
|
||||
| "gray",
|
||||
...args: unknown[]
|
||||
) {
|
||||
const currentLogLevel = Number(localStorage.getItem("log_level") || 0);
|
||||
|
|
@ -24,6 +33,10 @@ export function log(
|
|||
yellow: "\x1b[33m",
|
||||
purple: "\x1b[35m",
|
||||
blue: "\x1b[34m",
|
||||
cyan: "\x1b[36m",
|
||||
white: "\x1b[37m",
|
||||
black: "\x1b[30m",
|
||||
gray: "\x1b[90m",
|
||||
};
|
||||
const resetCode = "\x1b[0m";
|
||||
console.log(`${colorCodes[color]}${logger}${resetCode}`, ...args);
|
||||
|
|
|
|||
Loading…
Reference in a new issue