mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 05:38:51 +00:00
feat: oauth2 登录
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
import { useAuth } from "@/hooks/useAuth"
|
||||
import useSettings from "@/hooks/useSetting"
|
||||
import { copyToClipboard } from "@/lib/utils"
|
||||
import { ModelProfile, ModelSettingResponse } from "@/types"
|
||||
import { ModelProfile, ModelConfig } from "@/types"
|
||||
import i18next from "i18next"
|
||||
import { Check, Clipboard } from "lucide-react"
|
||||
import { forwardRef, useState } from "react"
|
||||
@@ -33,8 +33,8 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((p
|
||||
try {
|
||||
setCopy(true)
|
||||
if (!profile) throw new Error("Profile is not found.")
|
||||
if (!settings) throw new Error("Settings is not found.")
|
||||
await copyToClipboard(generateCommand(type, settings, profile) || "")
|
||||
if (!settings?.config) throw new Error("Settings is not found.")
|
||||
await copyToClipboard(generateCommand(type, settings!.config, profile) || "")
|
||||
} catch (e: Error | any) {
|
||||
console.error(e)
|
||||
toast(t("Error"), {
|
||||
@@ -88,7 +88,7 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((p
|
||||
|
||||
const generateCommand = (
|
||||
type: number,
|
||||
{ agent_secret_key, install_host, tls }: ModelSettingResponse,
|
||||
{ agent_secret_key, install_host, tls }: ModelConfig,
|
||||
{ agent_secret, role }: ModelProfile,
|
||||
) => {
|
||||
if (!install_host) throw new Error(i18next.t("Results.InstallHostRequired"))
|
||||
|
||||
@@ -62,7 +62,7 @@ export const ServerCard: React.FC<ServerCardProps> = ({ data, mutate }) => {
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
const onSubmit = async (values: z.infer<typeof serverFormSchema>) => {
|
||||
await updateServer(data.id, values)
|
||||
await updateServer(data!.id!, values)
|
||||
setOpen(false)
|
||||
await mutate()
|
||||
form.reset()
|
||||
@@ -122,7 +122,6 @@ export const ServerCard: React.FC<ServerCardProps> = ({ data, mutate }) => {
|
||||
{...field}
|
||||
value={conv.arrToStr(field.value || [])}
|
||||
onChange={(e) => {
|
||||
console.log(field.value)
|
||||
const arr = conv
|
||||
.strToArr(e.target.value)
|
||||
.map(Number)
|
||||
|
||||
Reference in New Issue
Block a user