mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 05:38:51 +00:00
feat: batch set server config (#114)
* feat: batch set server config * make every field optional * chore: auto-fix linting and formatting issues * update * [WIP] improve batch edit ux * chore: auto-fix linting and formatting issues
This commit is contained in:
@@ -7,6 +7,7 @@ import { InstallCommandsMenu } from "@/components/install-commands"
|
||||
import { NoteMenu } from "@/components/note-menu"
|
||||
import { ServerCard } from "@/components/server"
|
||||
import { ServerConfigCard } from "@/components/server-config"
|
||||
import { ServerConfigCardBatch } from "@/components/server-config-batch"
|
||||
import { TerminalButton } from "@/components/terminal"
|
||||
import { Checkbox } from "@/components/ui/checkbox"
|
||||
import {
|
||||
@@ -20,7 +21,7 @@ import {
|
||||
import { IconButton } from "@/components/xui/icon-button"
|
||||
import { useServer } from "@/hooks/useServer"
|
||||
import { joinIP } from "@/lib/utils"
|
||||
import { ModelForceUpdateResponse, ModelServer as Server } from "@/types"
|
||||
import { ModelServerTaskResponse, ModelServer as Server } from "@/types"
|
||||
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table"
|
||||
import { useEffect, useMemo } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
@@ -144,7 +145,7 @@ export default function ServerPage() {
|
||||
<>
|
||||
<TerminalButton id={s.id} />
|
||||
<ServerCard mutate={mutate} data={s} />
|
||||
<ServerConfigCard id={s.id} />
|
||||
<ServerConfigCard sid={[s.id]} variant="outline" />
|
||||
</>
|
||||
</ActionButtonGroup>
|
||||
)
|
||||
@@ -187,7 +188,7 @@ export default function ServerPage() {
|
||||
return
|
||||
}
|
||||
|
||||
let resp: ModelForceUpdateResponse = {}
|
||||
let resp: ModelServerTaskResponse = {}
|
||||
try {
|
||||
resp = await forceUpdateServer(id)
|
||||
} catch (e) {
|
||||
@@ -212,6 +213,10 @@ export default function ServerPage() {
|
||||
})
|
||||
}}
|
||||
/>
|
||||
<ServerConfigCardBatch
|
||||
sid={selectedRows.map((r) => r.original.id)}
|
||||
className="shadow-[inset_0_1px_0_rgba(255,255,255,0.2)] bg-yellow-600 text-white hover:bg-yellow-500 dark:hover:bg-yellow-700 rounded-lg"
|
||||
/>
|
||||
<InstallCommandsMenu className="shadow-[inset_0_1px_0_rgba(255,255,255,0.2)] bg-blue-700 text-white hover:bg-blue-600 dark:hover:bg-blue-800 rounded-lg" />
|
||||
</HeaderButtonGroup>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user