{%
    local type_switch_table = {
        Lom = 'LOM',
        Dedicated = 'Dedicated',
        ExternalPCIe = 'PCIE',
        Ocp = 'OCP',
        Ocp2 = 'OCP2',
        Aggregation = 'Aggregation',
        FlexIO = 'FlexIO'
    }
    -- 先打印Dedicated类型
    echo(string.format('%-12s | %-10s | %-8s | %-10s', 'Type', 'Name', 'Port ID', 'Link Status'))
    for _, item in pairs(port_list) do
        local linkstatus = 'Link_Up'
        if item.LinkStatus == 'Disconnected' then
            linkstatus = 'Link_Down'
        end
        local type = 'Unknown'
        if item.Type and type_switch_table[item.Type] then
            type = type_switch_table[item.Type]
        end
        echo(string.format('\n%-12s | %-3s%-7u | %-8s | %-10s', type, 'eth', item.EthId, item.DevicePortId , linkstatus))
    end
%}