Ejemplo n.º 1
0
def admin_html():
	html = html_template_start('/admin', c.read_app_config_value('title'), c.read_config_value('firmware_version'), main_menu('/admin'))
	html += '<form action="/admin_submit" method="post" onsubmit="select_all_options(\'languages\');">' + c.CR
	html += display_fieldsets(data.ADMIN_FIELDSETS)
	html += '<input type="submit" value="' + _('Save') + '" name="submit"/>' + c.CR
	html += '<input type="reset" value="' + _('Cancel changes') + '" name="cancel" style="margin-top:10px;"/>' + c.CR
	html += '</form>' + c.CR
	html += html_template_end()
	return html
Ejemplo n.º 2
0
def configure_html():
	html = html_template_start('/configure', c.read_app_config_value('title'), c.read_config_value('firmware_version'), main_menu('/configure'), c.read_config_value('connection_type'))
	html += '<form action="/configure_submit" method="post" enctype="multipart/form-data">' + c.CR
	html += display_fieldsets(data.CONFIG_FIELDSETS)
	html += '<input type="submit" value="' + _('Save configuration') + '" name="submit"/>' + c.CR
	html += '<input type="reset" value="' + _('Cancel all changes') + '" name="cancel" style="margin-top:10px;"/>' + c.CR
	html += '</form>' + c.CR
	html += html_template_end()
	return html
Ejemplo n.º 3
0
def backup_restore_html():
	html = html_template_start('/backup_restore', c.read_app_config_value('title'), c.read_config_value('firmware_version'), main_menu('/backup_restore'))
	html += '<form action="/backup_restore_submit" method="post" enctype="multipart/form-data">' + c.CR
	html += open_fieldset(_('Download/Upload'))
	html += button_row(_('Backup'), '', 'button', _('Download a copy'), 'onclick="download_configuration(\'' + get_config_file_name() + '\');"') + c.CR
	html += input_row(_('Restore'), 'uploaded_file', 'file') + c.CR
	html += '<tr><td><input type="submit" value="' + _('Upload') + '" name="submit"/></td><td></td></tr>' + c.CR
	html += close_fieldset() + '<br/>'
	html += open_fieldset(_('File content'))
	html += '<tr><td class="display_file">'
	html += display_config_file()
	html += '</td></tr>'
	html += close_fieldset()
	html += '</form>' + c.CR
	html += html_template_end()
	return html
Ejemplo n.º 4
0
def login_html():
    html = html_template_start(
        "/login", c.read_app_config_value("title"), c.read_config_value("firmware_version"), _("Identification")
    )
    html += '<form action="/login_submit" method="post" class="text_align_center">' + c.CR
    html += '<br/><div><input type="text" placeholder="' + _("Username") + '" name="username"/></div><br/>' + c.CR
    html += '<div><input type="password" placeholder="' + _("Password") + '" name="password"/></div>' + c.CR
    html += "<br/>" + c.CR
    html += (
        '<table style="margin:0 auto;">'
        + select_row(_("Interface language"), "language", c.read_app_config_value("language"), "", l.LANGUAGES)
        + "</table>"
        + c.CR
    )
    html += "<br/>" + c.CR
    html += '<input type="submit" value="' + _("Log in") + '"/>' + c.CR
    html += "</form>" + c.CR
    html += html_template_end()
    return html