feat: 添加完整实验板信息

This commit is contained in:
SikongJueluo 2025-07-11 21:50:35 +08:00
parent da6386c6f0
commit e0619eb9a3
No known key found for this signature in database
1 changed files with 45 additions and 1 deletions

View File

@ -239,6 +239,44 @@ const columns: ColumnDef<BoardData>[] = [
: h("span", { class: "font-medium" }, device.ipAddr);
},
},
{
accessorKey: "port",
header: "端口",
cell: ({ row }) => {
const device = row.original;
return isEditMode.value
? h("input", {
type: "number",
class: "input input-sm w-full",
value: device.port,
onInput: (e: Event) => {
device.port = parseInt((e.target as HTMLInputElement).value);
},
})
: h("span", { class: "font-mono" }, device.port.toString());
},
enableHiding: true,
},
{
accessorKey: "id",
header: "设备ID",
cell: ({ row }) =>
h("span", { class: "font-mono text-xs" }, row.original.id),
enableHiding: true,
},
{
accessorKey: "status",
header: "状态",
cell: ({ row }) => {
const device = row.original;
const statusText = device.status === 0 ? "忙碌" : "可用";
const statusClass = device.status === 0 ? "badge-warning" : "badge-success";
return h("span", {
class: `badge ${statusClass} min-w-15`
}, statusText);
},
enableHiding: true,
},
{
accessorKey: "version",
header: "版本号",
@ -362,7 +400,12 @@ const columns: ColumnDef<BoardData>[] = [
// TanStack Table
const sorting = ref<SortingState>([]);
const columnFilters = ref<ColumnFiltersState>([]);
const columnVisibility = ref<VisibilityState>({});
const columnVisibility = ref<VisibilityState>({
// ID
port: false,
id: false,
status: false,
});
const rowSelection = ref({});
const expanded = ref<ExpandedState>({});
@ -430,6 +473,7 @@ const table = useVueTable({
},
},
});
onMounted(() => {
//
boardManager.fetchBoardsData();