示例#1
0
def network(request):
    logger = logging.getLogger(__name__)
    extra_context = {'wizard_title': u'2 de 4 - Configuração de Rede',
                     'page_name': u'network'}
    if request.method == "GET":
        interface = NetworkInterface.get_instance()
        Form = form(NetworkInterface)
        extra_context['form'] = Form(instance=interface)
        return render_to_response( request, "generic.html", extra_context)
    else:
        edit_singleton_model(request, "generic.html",
                             "nimbus.wizard.views.timezone",
                              model = NetworkInterface,
                              extra_context = extra_context)

        interface = NetworkInterface.get_instance()


        if interface.address == get_raw_network_interface_address():
            return redirect( "nimbus.wizard.views.timezone" )
        else:
            logger.info('redirecting user to redirect page')
            return render_to_response(request, "redirect.html", 
                                        dict(ip_address=interface.address,
                                             url=reverse('nimbus.wizard.views.timezone')))
示例#2
0
def offsite(request):
    extra_context = {'wizard_title': u'3 de 5 - Configuração do Offsite',
                     'page_name': u'offsite',
                     'previous': previous_step_url('offsite')}
    return edit_singleton_model(request, "generic.html",
                                next_step_url('offsite'),
                                formclass = OffsiteForm,
                                extra_context = extra_context)
示例#3
0
def timezone(request):
    extra_context = {
        'wizard_title': u'3 de 4 - Configuração de Hora',
        'page_name': u'timezone',
        'previous': reverse('nimbus.wizard.views.network')
    }
    return edit_singleton_model( request, "generic.html",
                                 "nimbus.wizard.views.password",
                                 formclass = TimezoneForm,
                                 extra_context = extra_context )
示例#4
0
def timezone(request):
    extra_context = {
        'wizard_title': u'4 de 5 - Configuração de Hora',
        'page_name': u'timezone',
        'previous': previous_step_url('timezone')
    }
    return edit_singleton_model( request, "generic.html",
                                 next_step_url('timezone'),
                                 formclass = TimezoneForm,
                                 extra_context = extra_context,
                                 reload_bacula = False)
示例#5
0
def offsite(request):
    extra_context = {
        'wizard_title': u'3 de 5 - Configuração do Offsite',
        'page_name': u'offsite',
        'previous': previous_step_url('offsite')
    }
    return edit_singleton_model(request,
                                "generic.html",
                                next_step_url('offsite'),
                                formclass=OffsiteForm,
                                extra_context=extra_context)
示例#6
0
def email_conf(request):
    return views.edit_singleton_model( request, "emailconf.html",
                                 "nimbus.reports.views.email_test",
                                 formclass = EmailConfForm )
示例#7
0
def timezone_conf(request):
    return edit_singleton_model( request, "timezoneconf.html", 
                                 "nimbus.timezone.views.timezone_conf",
                                 formclass = TimezoneForm )
示例#8
0
def network_conf(request):
    return edit_singleton_model(request, "myform.html", 
                                 "nimbus.network.views.redirect_after_update",
                                 model = NetworkInterface )
示例#9
0
def edit(request):
    title = u'Editar configurações do offsite'
    return edit_singleton_model(request, "offsite_edit.html", 
                                "nimbus.offsite.views.detail",
                                formclass = OffsiteForm,
                                extra_context = locals())