Beispiel #1
0
class ArchivedAssetsChanges(BaseCMDBArchiveView):
    model = ArchivedCIChange
    columns = [
        DataTableColumn(
            'CI',
            field='ci',
            sort_expression='ci',
            bob_tag=True,
        ),
        DataTableColumn(
            'Created',
            field='created',
            sort_expression='created',
            bob_tag=True,
        ),
        DataTableColumn(
            'Time',
            field='time',
            sort_expression='time',
            bob_tag=True,
        ),
        DataTableColumn(
            'User',
            bob_tag=True,
        ),
        DataTableColumn(
            'Field name',
            bob_tag=True,
        ),
        DataTableColumn(
            'Old value',
            bob_tag=True,
        ),
        DataTableColumn(
            'New value',
            bob_tag=True,
        ),
        DataTableColumn(
            'Message',
            bob_tag=True,
        ),
    ]

    def get_query(self):
        items = self.model.objects.filter(type=CI_CHANGE_TYPES.DEVICE)
        self.data_table_query(items)

    def get_context_data(self, *args, **kwargs):
        ret = super(ArchivedAssetsChanges, self).get_context_data(
            *args,
            **kwargs
        )
        ret.update({
            'mode': 'assets',
            'section_name': 'Asset attributes changes',
        })
        return ret
Beispiel #2
0
class ArchivedCIAttributesChanges(BaseCMDBArchiveView):
    model = ArchivedCIChangeCMDBHistory
    columns = [
        DataTableColumn(
            'CI',
            field='ci',
            sort_expression='ci',
            bob_tag=True,
        ),
        DataTableColumn(
            'Created',
            field='created',
            sort_expression='created',
            bob_tag=True,
        ),
        DataTableColumn(
            'Time',
            field='time',
            sort_expression='time',
            bob_tag=True,
        ),
        DataTableColumn(
            'User',
            bob_tag=True,
        ),
        DataTableColumn(
            'Field name',
            bob_tag=True,
        ),
        DataTableColumn(
            'Old value',
            bob_tag=True,
        ),
        DataTableColumn(
            'New value',
            bob_tag=True,
        ),
        DataTableColumn(
            'Comment',
            bob_tag=True,
        ),
    ]

    def get_context_data(self, *args, **kwargs):
        ret = super(ArchivedCIAttributesChanges, self).get_context_data(
            *args,
            **kwargs
        )
        ret.update({
            'mode': 'cmdb',
            'section_name': 'CI attributes changes',
        })
        return ret
Beispiel #3
0
class SupportList(GenericSearch):
    """The support list."""

    submodule_name = 'supports'
    active_sidebar_item = 'search'
    Form = SupportSearchForm
    Model = Support

    columns = [
        CheckBoxColumn(
            _('Dropdown'),
            selectable=True,
            bob_tag=True,
        ),
        SupportLinkColumn(
            _('Type'),
            bob_tag=True,
        ),
        DataTableColumn(
            _('Contract id'),
            bob_tag=True,
            field='contract_id',
            sort_expression='contract_id',
        ),
        DataTableColumn(
            _('Name'),
            bob_tag=True,
            field='name',
            sort_expression='name',
        ),
        DataTableColumn(
            _('Date from'),
            bob_tag=True,
            field='date_from',
            sort_expression='date_from',
        ),
        DataTableColumn(
            _('Date to'),
            bob_tag=True,
            field='date_to',
            sort_expression='date_to',
        ),
        DataTableColumn(
            _('Price'),
            bob_tag=True,
            field='price',
            sort_expression='price',
        ),
        DataTableColumn(
            _('Created'),
            bob_tag=True,
            field='created',
            sort_expression='created',
        ),
    ]

    def get_context_data(self, *args, **kwargs):
        data = super(SupportList, self).get_context_data(*args, **kwargs)
        data['supports'] = Support.objects.all()
        return data
Beispiel #4
0
class ArchivedPuppetChanges(BaseCMDBArchiveView):
    model = ArchivedCIChangePuppet
    columns = [
        DataTableColumn(
            'CI',
            field='ci',
            sort_expression='ci',
            bob_tag=True,
        ),
        DataTableColumn(
            'Created',
            field='created',
            sort_expression='created',
            bob_tag=True,
        ),
        DataTableColumn(
            'Time',
            field='time',
            sort_expression='time',
            bob_tag=True,
        ),
        DataTableColumn(
            'Configuration Version',
            field='configuration_version',
            bob_tag=True,
        ),
        DataTableColumn(
            'Host',
            field='host',
            bob_tag=True,
        ),
        DataTableColumn(
            'Kind',
            field='kind',
            bob_tag=True,
        ),
        DataTableColumn(
            'Status',
            field='status',
            bob_tag=True,
        ),
    ]

    def get_context_data(self, *args, **kwargs):
        ret = super(ArchivedPuppetChanges, self).get_context_data(
            *args,
            **kwargs
        )
        ret.update({
            'mode': 'puppet',
            'section_name': 'Agent events',
        })
        return ret
Beispiel #5
0
class ArchivedGitChanges(BaseCMDBArchiveView):
    model = ArchivedCIChangeGit
    columns = [
        DataTableColumn(
            'CI',
            field='ci',
            sort_expression='ci',
            bob_tag=True,
        ),
        DataTableColumn(
            'Created',
            field='created',
            sort_expression='created',
            bob_tag=True,
        ),
        DataTableColumn(
            'Time',
            field='time',
            sort_expression='time',
            bob_tag=True,
        ),
        DataTableColumn(
            'Fila path',
            field='file_paths',
            bob_tag=True,
        ),
        DataTableColumn(
            'Comment',
            field='comment',
            bob_tag=True,
        ),
        DataTableColumn(
            'Author',
            field='author',
            bob_tag=True,
        ),
        DataTableColumn(
            'Changeset',
            field='changeset',
            bob_tag=True,
        ),
    ]

    def get_context_data(self, *args, **kwargs):
        ret = super(ArchivedGitChanges, self).get_context_data(
            *args,
            **kwargs
        )
        ret.update({
            'mode': 'git',
            'section_name': 'Repo changes',
        })
        return ret
Beispiel #6
0
class ArchivedZabbixTriggers(BaseCMDBArchiveView):
    model = ArchivedCIChangeZabbixTrigger
    columns = [
        DataTableColumn(
            'CI',
            field='ci',
            sort_expression='ci',
            bob_tag=True,
        ),
        DataTableColumn(
            'Created',
            field='created',
            sort_expression='created',
            bob_tag=True,
        ),
        DataTableColumn(
            'Host',
            field='host',
            sort_expression='host',
            bob_tag=True,
        ),
        DataTableColumn(
            'Status',
            field='status',
            sort_expression='status',
            bob_tag=True,
        ),
        DataTableColumn(
            'Priority',
            field='priority',
            sort_expression='priority',
            bob_tag=True,
        ),
        DataTableColumn(
            'Description',
            field='description',
            bob_tag=True,
        ),
        DataTableColumn(
            'Last Change',
            field='lastchange',
            sort_expression='lastchange',
            bob_tag=True,
        ),
        DataTableColumn(
            'Comments',
            field='comments',
            bob_tag=True,
        ),
    ]

    def get_context_data(self, *args, **kwargs):
        ret = super(ArchivedZabbixTriggers, self).get_context_data(
            *args,
            **kwargs
        )
        ret.update({
            'mode': 'zabbix',
            'section_name': 'Monitoring events',
        })
        return ret
Beispiel #7
0
class LicenceList(LicenseSelectedMixin, GenericSearch):
    """Displays a list of licences."""

    active_sidebar_item = 'search'
    template_name = 'assets/licence_list.html'

    Model = Licence
    Form = LicenceSearchForm
    columns = [
        CheckBoxColumn(
            _('Dropdown'),
            selectable=True,
            bob_tag=True,
        ),
        LicenceLinkColumn(
            _('Type'),
            bob_tag=True,
        ),
        DataTableColumn(
            _('Inventory number'),
            bob_tag=True,
            field='niw',
            sort_expression='niw',
        ),
        DataTableColumn(
            _('Licence Type'),
            bob_tag=True,
            field='licence_type__name',
            sort_expression='licence_type__name',
        ),
        DataTableColumn(
            _('Manufacturer'),
            bob_tag=True,
            field='manufacturer__name',
            sort_expression='manufacturer__name',
        ),
        DataTableColumn(
            _('Software Category'),
            bob_tag=True,
            field='software_category',
            sort_expression='software_category__name',
        ),
        DataTableColumn(
            _('Property of'),
            bob_tag=True,
            field='property_of__name',
            sort_expression='property_of__name',
        ),
        DataTableColumn(
            _('Number of purchased items'),
            bob_tag=True,
            field='number_bought',
            sort_expression='number_bought',
        ),
        DataTableColumn(
            _('Used'),
            bob_tag=True,
            field='used',
        ),
        DataTableColumn(
            _('Invoice date'),
            bob_tag=True,
            field='invoice_date',
            sort_expression='invoice_date',
        ),
        DataTableColumn(
            _('Invoice no.'),
            bob_tag=True,
            field='invoice_no',
            sort_expression='invoice_no',
        ),
        DataTableColumn(
            _('Valid thru'),
            bob_tag=True,
            field='valid_thru',
            sort_expression='valid_thru',
        ),
        DataTableColumn(
            _('Created'),
            bob_tag=True,
            field='created',
            sort_expression='created',
        ),
    ]

    def get_context_data(self, **kwargs):
        context = super(LicenceList, self).get_context_data(**kwargs)
        context.update({'get_query': self.request.GET.urlencode()})
        return context