function siteTab() {
    return {
        title: '站点',
        tab: {
            type: 'crud',
            title: '站点列表',
            api: '${base}/site/list',
            ...crudCommonOptions(),
            headerToolbar: ['reload'],
            loadDataOnce: true,
            columns: [
                {
                    label: '名称',
                    name: 'name',
                    width: 250,
                },
                {
                    label: '新闻数',
                    name: 'news',
                    width: 50,
                    className: 'text-center',
                },
                {
                    label: '链接',
                    name: 'url',
                },
                {
                    label: '操作',
                    type: 'operation',
                    width: 100,
                    fixed: 'right',
                    className: 'nowrap',
                    buttons: [
                        {
                            visibleOn: '${code}',
                            label: "规则",
                            type: "action",
                            level: "link",
                            tooltip: '查看站点规则',
                            actionType: 'dialog',
                            dialog: {
                                title: '规则查看器',
                                ...readOnlyDialogOptions(),
                                size: 'full',
                                body: {
                                    type: 'service',
                                    api: {
                                        method: 'get',
                                        url: '${base}/site/source?code=${code}',
                                        adaptor: (payload, response, api, context) => {
                                            return {
                                                source: JSON.stringify(payload)
                                            }
                                        }
                                    },
                                    body: {
                                        disabled: true,
                                        type: 'editor',
                                        name: 'source',
                                        language: 'json',
                                        options: {
                                            wordWrap: 'on',
                                        },
                                    }
                                }
                            }
                        },
                        {
                            visibleOn: '${code && !iframe}',
                            label: "官网",
                            type: "action",
                            level: "link",
                            tooltip: '打开${url}',
                            actionType: 'url',
                            url: '${url}'
                        },
                        {
                            visibleOn: '${code && iframe}',
                            label: "官网",
                            type: "action",
                            level: "link",
                            tooltip: '打开${url}',
                            actionType: 'dialog',
                            dialog: {
                                title: '官网',
                                ...readOnlyDialogOptions(),
                                size: 'xl',
                                body: {
                                    type: 'iframe',
                                    src: '${url}',
                                    height: 1000,
                                }
                            }
                        },
                    ]
                }
            ],
        }
    }
}