Example #1
0
def create_admin_fieldsets():
	row1 = ['input_row', _('Username'), 'username', 'text', c.read_app_config_value('username')]
	row2 = ['input_row', _('Password'), 'password', 'text', c.read_app_config_value('password')]
	row3 = ['select_row', _('Languages'), 'languages', '', 'multiple="multiple" id="languages"', l.LANGUAGES]
	row4 = ['button_row', _('Remove selected language'), '', 'button', _('Remove'), 'onclick="remove_from_select(\'languages\');"']
	row5 = ['span_row', _('Install a new language'), 'class="sub_title"']
	row6 = ['input_row', _('Code'), 'code', 'text', '', '', '', 'Example: en']
	row7 = ['input_row', _('Label'), 'label', 'text', '', '', '', 'Example: English']
	row8 = ['input_row', _('Title'), 'title', 'text', c.read_app_config_value('title'), 'size="40"']
	row9 = ['input_row', _('Host'), 'host', 'text', c.read_app_config_value('host'), 'onkeypress="return ip_keys_only(event);" placeholder="0.0.0.0"', '', 'Default is 0.0.0.0 to listen to all interfaces.']
	row10 = ['input_row', _('Port'), 'port', 'text', c.read_app_config_value('port'), 'onkeypress="return integers_only(event);" placeholder="80"', '', 'Default is 80.']
	row11 = ['input_row', _('Debug'), 'debug', 'checkbox', 'enabled', is_checked(c.read_app_config_value('debug'), 'enabled'), '', _('Enabled')]
	row12 = ['input_row', _('Reloader'), 'reloader', 'checkbox', 'enabled', is_checked(c.read_app_config_value('reloader'), 'enabled'), '', _('Enabled')]
	row13 = ['span_row', '<br/>' + _('Debug and Reloader should be disabled in production mode.') + '<br/>' + _('A restart of the service is needed to activate changes made in this section.'), 'class="note"']
	return [[_('Security'), 'security', [row1, row2]], [_('Interface'), 'interface', [row8, row3, row4, row5, row6, row7]], [_('Service'), 'service', [row9, row10, row11, row12, row13]]]
Example #2
0
def create_configure_fieldsets():
	row1 = ['input_row', _('Identifier'), 'identifier', 'text', c.read_config_value('identifier')]
	row2 = ['select_row', _('Language(s)'), 'language', c.read_config_value('language'), '', [['', ''], ['English', 'English'], ['English French', 'English - French'], ['French', 'French'], ['French English', 'French - English']]]
	row3 = ['input_row', _('Context'), 'context', 'text', c.read_config_value('context')]
	time_zones = load_time_zones()
	if len(time_zones) < 2:
		m.add_message(_('Time zones file not found or empty.'))
	row4 = ['select_row', _('Time zone'), 'timezone', c.read_config_value('timezone'), '', time_zones]
	row5 = ['button_row', _('Backup firmware'), '', 'button', _('Download'), 'onclick="download_firmware(\'' + firmware_file_name() + '\');"', firmware_file_name()]
	row6 = ['input_row', _('Update firmware'), 'firmware_version', 'file', '', 'accept=".gz"']
	row7 = ['input_row', _('Hostname'), 'hostname', 'text', c.read_config_value('hostname')]
	row8 = ['input_row', _('Domain name'), 'domain_name', 'text', c.read_config_value('domain_name')]
	row9 = ['select_row', _('Connection type'), 'connection_type', c.read_config_value('connection_type'), 'onchange="change_connection_type(this);"', [['dhcp', 'DHCP'], ['static', 'Static']]]
	row10 = ['ip_row', _('IP address'), 'ip', c.read_config_value('ip'), 'connection_type']
	row11 = ['ip_row', _('Subnet mask'), 'subnet', c.read_config_value('subnet'), 'connection_type']
	row12 = ['ip_row', _('Default gateway'), 'gateway', c.read_config_value('gateway'), 'connection_type']
	row13 = ['ip_row', _('Static DNS 1'), 'dns1', c.read_config_value('dns1'), 'connection_type']
	row14 = ['ip_row', _('Static DNS 2'), 'dns2', c.read_config_value('dns2'), 'connection_type']
	row15 = ['input_row', _('Admin access'), 'admin_access', 'checkbox', 'enable', is_checked(c.read_config_value('admin_access'), 'enable'), '', _('Enabled')]
	row16 = ['input_row', _('Utility access'), 'utility_access', 'radio', c.read_config_value('utility_access'), '', [['utility_access_1', 'http'], ['utility_access_2', 'https']]]
	row17 = ['input_row', _('SNMP'), 'SNMP', 'checkbox', 'enable', is_checked(c.read_config_value('SNMP'), 'enable'), '', _('Enabled')]
	row18 = ['input_row', _('Web login name'), 'Web_Login_Name', 'text', c.read_config_value('Web_Login_Name')]
	row19 = ['input_row', _('Web login password'), 'Web_Login_password', 'text', c.read_config_value('Web_Login_password')]
	row20 = ['input_row', _('SSH'), 'SSH', 'checkbox', 'enable', is_checked(c.read_config_value('SSH'), 'enable'), '', _('Enabled')]
	row21 = ['input_row', _('SSH login name'), 'SSH_Login_Name', 'text', c.read_config_value('SSH_Login_Name')]
	row22 = ['input_row', _('SSH login password'), 'SSH_Login_password', 'text', c.read_config_value('SSH_Login_password')]
	row23 = ['input_row', _('Syslog'), 'syslog', 'checkbox', 'enable', is_checked(c.read_config_value('syslog'), 'enable'), '', _('Enabled')]
	row24 = ['input_row', _('Max size'), 'max_size', 'text', c.read_config_value('max_size')]
	row25 = ['input_row', _('Report by mail'), 'report_by_mail', 'checkbox', 'enable', is_checked(c.read_config_value('report_by_mail'), 'enable'), '', _('Enabled')]
	row26 = ['input_row', _('Sender'), 'mail_sender', 'text', c.read_config_value('mail_sender')]
	row27 = ['input_row', _('Receiver'), 'mail_receiver', 'text', c.read_config_value('mail_receiver')]
	row28 = ['input_row', _('Subject'), 'mail_subject', 'text', c.read_config_value('mail_subject')]
	row29 = ['input_row', _('SMTP server'), 'mail_smtp_server', 'text', c.read_config_value('mail_smtp_server')]
	row30 = ['input_row', _('SMTP'), 'SMTP', 'text', c.read_config_value('SMTP')]
	row31 = ['input_row', _('Log count'), 'MAIL_Log_Count', 'text', c.read_config_value('MAIL_Log_Count')]
	row32 = ['input_row', _('Interval'), 'MAIL_Interval', 'text', c.read_config_value('MAIL_Interval')]
	row33 = ['input_row', _('SMTP user'), 'MAIL_Smtp_User', 'text', c.read_config_value('MAIL_Smtp_User')]
	row34 = ['input_row', _('Proxy'), 'proxy', 'text', c.read_config_value('proxy')]
	row35 = ['input_row', _('Outbound proxy'), 'outbound_proxy', 'text', c.read_config_value('outbound_proxy')]
	row36 = ['input_row', _('Registration'), 'registration', 'checkbox', 'enable', is_checked(c.read_config_value('registration'), 'enable'), '', _('Enabled')]
	row37 = ['input_row', _('Registration expires'), 'registration_expires', 'text', c.read_config_value('registration_expires'), 'onkeypress="return integers_only(event);"', '', _('seconds')]
	row38 = ['input_row', _('Use outbound proxy'), 'use_OBP', 'checkbox', 'enable', is_checked(c.read_config_value('use_OBP'), 'enable'), '', _('Enabled')]
	row39 = ['input_row', _('Send calls without registration'), 'send_calls_without_reg', 'checkbox', 'enable', is_checked(c.read_config_value('send_calls_without_reg'), 'enable'), '', _('Enabled')]
	row40 = ['input_row', _('Receive calls without registration'), 'receive_calls_without_reg', 'checkbox', 'enable', is_checked(c.read_config_value('receive_calls_without_reg'), 'enable'), '', _('Enabled')]
	row41 = ['input_row', _('CID'), 'CID', 'text', c.read_config_value('CID')]
	row42 = ['input_row', _('UID'), 'UID', 'text', c.read_config_value('UID')]
	row43 = ['input_row', _('Password'), 'password', 'text', c.read_config_value('password')]
	row44 = ['input_row', _('Dial plan'), 'dialplan', 'text', c.read_config_value('dialplan')]
	return [[_('Identifier'), 'identifier', [row1, row2]], [_('Global'), 'global', [row3, row4, row5, row6]], [_('Network'), 'network', [row7, row8, row9, row10, row11, row12, row13, row14]], [_('Web access'), 'web_access', [row15, row16, row17, row18, row19, row20, row21, row22]], [_('Log'), 'log', [row23, row24, row25, row26, row27, row28, row29, row30, row31, row32, row33]], [_('Proxy and registration'), 'proxy and registration', [row34, row35, row36, row37, row38, row39, row40]], [_('Subscriber'), 'subscriber', [row41, row42, row43, row44]]]