feat: 添加完整实验板信息
This commit is contained in:
parent
da6386c6f0
commit
e0619eb9a3
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue