Beispiel #1
0
def summary_dummy(xfer):
    if not hasattr(xfer, 'add_component'):
        return True
    else:
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('dummytitle')
        lab.set_value_as_infocenter("Dummy")
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        lbl = XferCompLabelForm('dummy_time')
        lbl.set_color('blue')
        lbl.set_location(0, row + 1, 4)
        lbl.set_centered()
        lbl.set_value(datetime.now())
        lbl.set_format('H')
        xfer.add_component(lbl)

        btn = XferCompButton('btnscheduler')
        btn.set_action(xfer.request, AddSchedulerTask.get_action('Task', ''))
        btn.set_location(0, row + 2, 4)
        xfer.add_component(btn)
        lbl = XferCompLabelForm('dummy-value')
        lbl.set_location(0, row + 3, 4)
        lbl.set_value(Params.getvalue('dummy-value'))
        xfer.add_component(lbl)
        return True
Beispiel #2
0
def summary_dummy(xfer):
    if not hasattr(xfer, 'add_component'):
        return True
    else:
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('dummytitle')
        lab.set_value_as_infocenter("Dummy")
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        lbl = XferCompLabelForm('dummy_time')
        lbl.set_color('blue')
        lbl.set_location(0, row + 1, 4)
        lbl.set_centered()
        lbl.set_value(datetime.now().ctime())
        xfer.add_component(lbl)

        btn = XferCompButton('btnscheduler')
        btn.set_action(xfer.request, AddSchedulerTask.get_action('Task', ''))
        btn.set_location(0, row + 2, 4)
        xfer.add_component(btn)
        lbl = XferCompLabelForm('dummy-value')
        lbl.set_location(0, row + 3, 4)
        lbl.set_value(Params.getvalue('dummy-value'))
        xfer.add_component(lbl)
        return True
Beispiel #3
0
def conf_wizard_core(wizard_ident, xfer):
    if isinstance(wizard_ident, list) and (xfer is None):
        wizard_ident.append(("core_home", 0))
        wizard_ident.append(("core_users", 100))
    elif (xfer is not None) and (wizard_ident == "core_home"):
        initial_wizard = Params.getvalue("CORE-Wizard")
        param_wizard = xfer.getparam("CORE-Wizard", initial_wizard)
        if initial_wizard != param_wizard:
            Parameter.change_value("CORE-Wizard", param_wizard)
            Params.clear()
        lbl = XferCompLabelForm('title')
        lbl.set_centered()
        lbl.set_value_as_info(six.text_type(settings.APPLIS_NAME))
        lbl.set_location(0, 3, 6)
        xfer.add_component(lbl)
        lbl = XferCompImage('img')
        lbl.type = 'jpg'
        lbl.set_value(settings.APPLIS_LOGO)
        lbl.set_location(2, 4, 2)
        xfer.add_component(lbl)
        lbl = XferCompLabelForm('home')
        lbl.set_value(_('This wizard will help you to configure this software.'))
        lbl.set_location(0, 5, 6)
        xfer.add_component(lbl)
        Params.fill(xfer, ['CORE-Wizard'], 1, 6, False)
        check = xfer.get_components("CORE-Wizard")
        check.set_action(xfer.request, xfer.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
        lbl = XferCompLabelForm('lbl_wizard')
        lbl.set_value_as_name(check.description)
        lbl.set_location(2, 6)
        xfer.add_component(lbl)
        check.description = ""
    elif (xfer is not None) and (wizard_ident == "core_users"):
        xfer.add_title(six.text_type(settings.APPLIS_NAME), _("Groups and users"))
        param_lists = ['CORE-connectmode', 'CORE-Wizard']
        Params.fill(xfer, param_lists, 1, xfer.get_max_row() + 1)
        btn = XferCompButton('editparam')
        btn.set_location(4, xfer.get_max_row())
        btn.set_is_mini(True)
        btn.set_action(xfer.request, ParamEdit.get_action(TITLE_MODIFY, 'images/edit.png'), close=CLOSE_NO,
                       params={'params': param_lists})
        xfer.add_component(btn)
        lbl = XferCompLabelForm("nb_user")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': LucteriosUser._meta.verbose_name_plural, 'count': len(LucteriosUser.objects.all())})
        xfer.add_component(lbl)
        btn = XferCompButton("btnusers")
        btn.set_location(4, xfer.get_max_row())
        btn.set_action(xfer.request, UsersList.get_action(TITLE_MODIFY, "images/edit.png"), close=CLOSE_NO)
        xfer.add_component(btn)
        lbl = XferCompLabelForm("nb_group")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': LucteriosGroup._meta.verbose_name_plural, 'count': len(LucteriosGroup.objects.all())})
        xfer.add_component(lbl)
        btn = XferCompButton("btngroups")
        btn.set_location(4, xfer.get_max_row())
        btn.set_action(xfer.request, GroupsList.get_action(TITLE_MODIFY, "images/edit.png"), close=CLOSE_NO)
        xfer.add_component(btn)
Beispiel #4
0
def summary_dummy(xfer):
    row = xfer.get_max_row() + 1
    lab = XferCompLabelForm('dummytitle')
    lab.set_value_as_infocenter("Dummy")
    lab.set_location(0, row, 4)
    xfer.add_component(lab)
    lbl = XferCompLabelForm('dummy_time')
    lbl.set_color('blue')
    lbl.set_location(0, row + 1, 4)
    lbl.set_centered()
    lbl.set_value(datetime.now().ctime())
    xfer.add_component(lbl)
    return True
Beispiel #5
0
 def add_title(self, title, subtitle, helptext=''):
     lbl = XferCompLabelForm('title')
     lbl.set_centered()
     lbl.set_value_as_info(title)
     lbl.set_location(0, 3, 6)
     self.add_component(lbl)
     lbl = XferCompLabelForm('subtitle')
     lbl.set_centered()
     lbl.set_value_as_name(subtitle)
     lbl.set_location(0, 4, 6)
     self.add_component(lbl)
     lbl = XferCompLabelForm('help')
     lbl.set_italic()
     lbl.set_value(helptext + "{[br/]}")
     lbl.set_location(0, 5, 6)
     self.add_component(lbl)
Beispiel #6
0
 def header_title(self, step, steplist):
     if step > 0:
         btn = XferCompButton("prec_wizard")
         btn.set_location(0, 0)
         btn.set_is_mini(True)
         btn.set_action(self.request, self.get_action(_("Prec"), "images/left.png"),
                        modal=FORMTYPE_REFRESH, close=CLOSE_NO, params={'step': step - 1})
         self.add_component(btn)
     lbl = XferCompLabelForm('progress')
     lbl.set_centered()
     lbl.set_value_as_name(_("progress steps: %(current)d/%(max)d") % {'current': step + 1, "max": len(steplist)})
     lbl.set_location(1, 0, 4)
     self.add_component(lbl)
     if step < (len(steplist) - 1):
         btn = XferCompButton("next_wizard")
         btn.set_location(5, 0)
         btn.set_is_mini(True)
         btn.set_action(self.request, self.get_action(_("Next"), "images/right.png"),
                        modal=FORMTYPE_REFRESH, close=CLOSE_NO, params={'step': step + 1})
         self.add_component(btn)
     lbl = XferCompLabelForm('sep1')
     lbl.set_value("{[hr/]}")
     lbl.set_location(0, 1, 6)
     self.add_component(lbl)
Beispiel #7
0
 def add_name(self, pos, name):
     lbl = XferCompLabelForm('name_%d' % pos)
     lbl.set_centered()
     lbl.set_value_as_name(name)
     lbl.set_location(0, pos)
     self.add_component(lbl)