chore: lint & permissions fix
@@ -1,6 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
export function genId({ name }: { name: string; id: string }) {
|
export function genId({ name }: { name: string; id: string }) {
|
||||||
const generated = name.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
|
const generated = name
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/[^a-z0-9]+/g, "_")
|
||||||
|
.replace(/^_|_$/g, "");
|
||||||
return { id: generated };
|
return { id: generated };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
export function genId({ name, prefix }: { name: string; prefix: string }) {
|
export function genId({ name, prefix }: { name: string; prefix: string }) {
|
||||||
console.log(name, prefix)
|
console.log(name, prefix);
|
||||||
const generated = name.toLowerCase().replace(/[^a-z0-9]+/g, "") + (name.length ? rot13(prefix) : "");
|
const generated =
|
||||||
|
name.toLowerCase().replace(/[^a-z0-9]+/g, "") +
|
||||||
|
(name.length ? rot13(prefix) : "");
|
||||||
return { id: generated };
|
return { id: generated };
|
||||||
}
|
}
|
||||||
|
|
||||||
function rot13(str: string) {
|
function rot13(str: string) {
|
||||||
const shift = 13;
|
const shift = 13;
|
||||||
let res = "";
|
let res = "";
|
||||||
for (const c of str) res += String.fromCharCode(((c.toLowerCase().charCodeAt(0) - 97 + shift) % 26) + 97)
|
for (const c of str)
|
||||||
|
res += String.fromCharCode(
|
||||||
|
((c.toLowerCase().charCodeAt(0) - 97 + shift) % 26) + 97,
|
||||||
|
);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
export function genId({ name }: { name: string; id: string }) {
|
export function genId({ name }: { name: string; id: string }) {
|
||||||
const generated = name.toLowerCase().slice(0, 3).replace(/[^a-z0-9]+/g, "");
|
const generated = name
|
||||||
|
.toLowerCase()
|
||||||
|
.slice(0, 3)
|
||||||
|
.replace(/[^a-z0-9]+/g, "");
|
||||||
return { id: generated };
|
return { id: generated };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,9 +158,7 @@ export function CharacterChooser({
|
|||||||
</Button>
|
</Button>
|
||||||
</AlertDialogTrigger>
|
</AlertDialogTrigger>
|
||||||
<AlertDialogContent>
|
<AlertDialogContent>
|
||||||
<AlertDialogTitle>
|
<AlertDialogTitle>วิธีแก้ไขตัวละครไม่ขึ้น</AlertDialogTitle>
|
||||||
วิธีแก้ไขตัวละครไม่ขึ้น
|
|
||||||
</AlertDialogTitle>
|
|
||||||
<div className="gap-1 flex flex-col">
|
<div className="gap-1 flex flex-col">
|
||||||
<center>
|
<center>
|
||||||
ในเกม เปิด<b>เมนูเกม</b>แล้วไปที่ <b>แก้ไขข้อมูลส่วนตัว</b>
|
ในเกม เปิด<b>เมนูเกม</b>แล้วไปที่ <b>แก้ไขข้อมูลส่วนตัว</b>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -436,5 +436,10 @@ export function FormAction({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function FormRow({ className, ...props }: React.ComponentProps<"div">) {
|
export function FormRow({ className, ...props }: React.ComponentProps<"div">) {
|
||||||
return <div className={cn("flex gap-2 flex-wrap items-end", className)} {...props} />;
|
return (
|
||||||
}
|
<div
|
||||||
|
className={cn("flex gap-2 flex-wrap items-end", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"use client";
|
"use client"
|
||||||
|
|
||||||
import type * as React from "react";
|
import * as React from "react"
|
||||||
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
function ScrollArea({
|
function ScrollArea({
|
||||||
className,
|
className,
|
||||||
@@ -25,7 +25,7 @@ function ScrollArea({
|
|||||||
<ScrollBar />
|
<ScrollBar />
|
||||||
<ScrollAreaPrimitive.Corner />
|
<ScrollAreaPrimitive.Corner />
|
||||||
</ScrollAreaPrimitive.Root>
|
</ScrollAreaPrimitive.Root>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function ScrollBar({
|
function ScrollBar({
|
||||||
@@ -43,7 +43,7 @@ function ScrollBar({
|
|||||||
"h-full w-2.5 border-l border-l-transparent",
|
"h-full w-2.5 border-l border-l-transparent",
|
||||||
orientation === "horizontal" &&
|
orientation === "horizontal" &&
|
||||||
"h-2.5 flex-col border-t border-t-transparent",
|
"h-2.5 flex-col border-t border-t-transparent",
|
||||||
className,
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
@@ -52,7 +52,7 @@ function ScrollBar({
|
|||||||
className="bg-border relative flex-1 rounded-full"
|
className="bg-border relative flex-1 rounded-full"
|
||||||
/>
|
/>
|
||||||
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ScrollArea, ScrollBar };
|
export { ScrollArea, ScrollBar }
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ export async function actionLog(text: string, details?: unknown) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
revalidatePath("/admin/log");
|
revalidatePath("/admin/log");
|
||||||
} catch { }
|
} catch {}
|
||||||
|
|
||||||
if (res) ps.publish(res, { topic: "log" });
|
if (res) ps.publish(res, { topic: "log" });
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 622 KiB After Width: | Height: | Size: 622 KiB |
|
Before Width: | Height: | Size: 938 KiB After Width: | Height: | Size: 938 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |