{
    type: 'panel',
    label: 'NAS / Copy',
    items: {
        _checkConfig: {
            // this component is not visible in the UI
            // it checks the configuration
            type: 'custom',
            bundlerType: 'module',
            i18n: true,
            url: 'custom/customComponents.js',
            name: 'ConfigCustomBackItUpSet/Components/CheckAllConfigInvisible',
        },
        _header: {
            type: 'header',
            size: 2,
            text: 'NAS / Copy',
            xs: 12,
            sm: 12,
            md: 12,
            lg: 12,
            xl: 12,
        },
        connectType: {
            type: 'select',
            label: 'Connection type',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            options: [
                {
                    label: 'CIFS',
                    value: 'CIFS',
                },
                {
                    label: 'Copy locally',
                    value: 'Copy',
                },
                {
                    label: 'Expert',
                    value: 'Expert',
                },
                {
                    label: 'NFS',
                    value: 'NFS',
                },
            ],
            newLine: true,
        },
        _helpLine1: {
            newLine: true,
            type: 'divider',
            color: 'primary',
        },
        cifsMount: {
            hidden: "data.connectType !== 'NFS' && data.connectType !== 'CIFS'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'host',
            help: 'IP address or hostname',
            newLine: true,
            validator: 'data.cifsMount',
            validatorNoSaveOnError: true,
        },
        cifsDomain: {
            hidden: "data.connectType !== 'NFS' && data.connectType !== 'CIFS'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Domain name (optional)',
        },
        smbType: {
            type: 'select',
            hidden: "data.connectType !== 'CIFS'",
            label: 'SMB type',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            noTranslations: true,
            options: [
                {
                    label: 'SMB 1.0',
                    value: 'vers=1.0',
                },
                {
                    label: 'SMB 2.0',
                    value: 'vers=2.0',
                },
                {
                    label: 'SMB 3.0',
                    value: 'vers=3.0',
                },
                {
                    label: 'SMB 3.02',
                    value: 'vers=3.02',
                },
                {
                    label: 'SMB 3.1.1',
                    value: 'vers=3.1.1',
                },
            ],
        },
        cifsUser: {
            hidden: "data.connectType !== 'CIFS'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Username',
            newLine: true,
            validator: 'data.cifsUser',
            validatorNoSaveOnError: true,
        },
        cifsPassword: {
            hidden: "data.connectType !== 'CIFS'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'password',
            visible: true,
            label: 'Password',
            validator: 'data.cifsPassword',
            validatorNoSaveOnError: true,
        },
        noserverino: {
            type: 'checkbox',
            hidden: "data.connectType !== 'CIFS'",
            label: 'Mount with option "noserverino"',
            xs: 12,
            sm: 6,
            md: 4,
            lg: 2,
            xl: 2,
        },
        cacheLoose: {
            type: 'checkbox',
            hidden: "data.connectType !== 'CIFS'",
            label: 'Mount with option "Cache Loose"',
            xs: 12,
            sm: 6,
            md: 4,
            lg: 2,
            xl: 2,
        },
        sudoMount: {
            type: 'checkbox',
            hidden: "data.connectType !== 'NFS' && data.connectType !== 'CIFS'",
            label: 'Mount as root',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            newLine: true,
        },
        cifsDeleteOldBackup: {
            type: 'checkbox',
            label: 'Delete old NAS / Copy-Backups',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
        },
        cifsOwnDir: {
            hidden: "data.connectType == 'Expert'",
            type: 'checkbox',
            label: 'Extra path for backup types',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
        },
        wakeOnLAN: {
            hidden: "data.connectType == 'Copy'",
            type: 'checkbox',
            label: 'Wake on LAN',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            newLine: true,
        },
        macAd: {
            hidden: "data.connectType == 'Copy' || !data.wakeOnLAN",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'MAC address',
        },
        wolWait: {
            hidden: "data.connectType == 'Copy' || !data.wakeOnLAN",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            min: 0,
            max: 180,
            type: 'number',
            label: 'seconds',
            help: 'WOL wait time in seconds',
        },
        wolExtra: {
            hidden: "data.connectType == 'Copy' || !data.wakeOnLAN",
            type: 'checkbox',
            label: 'Wake on LAN advanced settings',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            newLine: true,
        },
        wolPort: {
            hidden: "data.connectType == 'Copy' || !data.wakeOnLAN || !data.wolExtra",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            min: 1,
            max: 65535,
            type: 'number',
            label: 'Port',
        },
        cifsMinimalDir: {
            hidden: "data.connectType == 'Expert' || !data.cifsOwnDir",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Path for ioBroker backup',
            newLine: true,
        },
        cifsCcuDir: {
            hidden: "data.connectType == 'Expert' || !data.cifsOwnDir",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Path for CCU backup',
        },
        cifsDir: {
            hidden: "data.connectType == 'Expert' || data.cifsOwnDir",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Path',
            newLine: true,
        },
        expertMount: {
            hidden: "data.connectType !== 'Expert'",
            xs: 12,
            sm: 12,
            md: 12,
            lg: 12,
            xl: 12,
            type: 'text',
            label: 'Mount command (expert)',
            newLine: true,
            validator: 'data.expertMount',
            validatorNoSaveOnError: true,
        },
    },
}
