Example #1
0
def vlan_detail(request, pk):
    vlan = get_object_or_404(Vlan, pk=pk)

    return cy_detail(request, Vlan, 'vlan/vlan_detail.html', {
        'Networks': 'network_set',
        'Attributes': 'vlanav_set',
    }, pk=pk, obj=vlan)
Example #2
0
def dynamic_intr_detail(request, pk):
    dynamic_interface = get_object_or_404(DynamicInterface, pk=pk)

    return cy_detail(request, DynamicInterface,
                     'dynamic_intr/dynamic_intr_detail.html', {
                     'Attributes': 'dynamicinterfaceav_set',
                     }, pk=pk, obj=dynamic_interface)
Example #3
0
def supernet_detail(request, pk):
    supernet = get_object_or_404(Supernet, pk=pk)
    networks = supernet.networks

    return cy_detail(request, Supernet, 'supernet/supernet_detail.html', {
        'Child Networks': networks,
    }, obj=supernet)
Example #4
0
def vlan_detail(request, pk):
    vlan = get_object_or_404(Vlan, pk=pk)

    return cy_detail(request, Vlan, 'vlan/vlan_detail.html', {
        'Networks': 'network_set',
        'Attributes': 'vlanav_set',
    }, pk=pk, obj=vlan)
Example #5
0
def workgroup_detail(request, pk):
    workgroup = get_object_or_404(Workgroup, pk=pk)
    return cy_detail(request, Workgroup, 'workgroup/workgroup_detail.html', {
        'Attributes': 'workgroupav_set',
        'Dynamic Interfaces': workgroup.dynamicinterface_set.all(),
        'Static Interfaces': workgroup.staticinterface_set.all(),
    }, obj=workgroup)
Example #6
0
def static_intr_detail(request, pk):
    static_interface = get_object_or_404(StaticInterface, pk=pk)

    return cy_detail(request, StaticInterface,
                     'static_intr/static_intr_detail.html', {
                     'Attributes': 'staticinterfaceav_set',
                     }, pk=pk, obj=static_interface)
Example #7
0
def user_detail(request, pk):
    from cyder.base.views import cy_detail

    user = UserProfile.objects.get(id=pk)
    email = User.objects.get(id=pk).email
    contacts = []
    form = UserPermForm()
    if email:
        contacts = (Ctnr.objects.filter(email_contact__contains=email))
    else:
        contacts = []

    ctnrs = CtnrUser.objects.filter(user_id=user)

    tables = {
        'Containers': ctnrs,
        'Contact For': contacts,
    }

    if request.user.id == user.id or request.user.is_superuser:
        tokens = Token.objects.filter(user=user)
        tables.update({'API Tokens': tokens})

    return cy_detail(request, UserProfile, 'cyuser/user_detail.html',
                     tables, obj=user, user_perm_form=form)
Example #8
0
def vrf_detail(request, pk):
    from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface

    vrf = get_object_or_404(Vrf, pk=pk)

    static_intr_q = get_static_intr_q(vrf)
    static_intrs = (StaticInterface.objects.filter(static_intr_q)
                    if static_intr_q else ())
    networks = Network.objects.filter(vrf=vrf)
    sites = Site.objects.filter(network__in=networks).distinct()

    return cy_detail(
        request,
        Vrf,
        'vrf/vrf_detail.html', {
            'Dynamic Interfaces':
            DynamicInterface.objects.filter(range__network__vrf=vrf),
            'Static Interfaces':
            static_intrs,
            'Sites':
            sites,
            'Networks':
            networks,
            'Attributes':
            'vrfav_set',
        },
        pk=pk,
        obj=vrf)
Example #9
0
def dynamic_intr_detail(request, pk):
    dynamic_interface = get_object_or_404(DynamicInterface, pk=pk)

    return cy_detail(request,
                     DynamicInterface,
                     'cydhcp/cydhcp_detail.html', {},
                     pk=pk,
                     obj=dynamic_interface)
Example #10
0
def workgroup_detail(request, pk):
    workgroup = get_object_or_404(Workgroup, pk=pk)
    return cy_detail(request, Workgroup, 'workgroup/workgroup_detail.html', {
        'Attributes': 'workgroupav_set',
        'Dynamic Interfaces': workgroup.dynamicinterface_set.all(),
        'Static Interfaces': workgroup.staticinterface_set.all(),
        'Containers': 'ctnr_set',
    }, obj=workgroup)
Example #11
0
def static_intr_detail(request, pk):
    static_interface = get_object_or_404(StaticInterface, pk=pk)

    return cy_detail(request,
                     StaticInterface,
                     'cydhcp/cydhcp_detail.html', {},
                     pk=pk,
                     obj=static_interface)
Example #12
0
def vlan_detail(request, pk):
    return cy_detail(request,
                     Vlan,
                     'cydhcp/cydhcp_detail.html', {
                         'Networks': 'network_set',
                         'Attributes': 'vlankeyvalue_set',
                     },
                     pk=pk)
Example #13
0
def network_detail(request, pk):
    network = get_object_or_404(Network, pk=pk)
    parent_networks, child_networks = calc_networks(network)
    return cy_detail(request, Network, 'network/network_detail.html', {
        'Ranges': 'range_set',
        'Parent Networks': parent_networks,
        'Child Networks': child_networks,
        'Attributes': 'networkkeyvalue_set',
    }, obj=network)
Example #14
0
def network_detail(request, pk):
    network = get_object_or_404(Network, pk=pk)
    parent_networks, child_networks = calc_networks(network)

    return cy_detail(request, Network, 'network/network_detail.html', {
        'Supernet': 'supernets',
        'Ranges': 'range_set',
        'Attributes': 'networkav_set',
    }, obj=network)
Example #15
0
def static_intr_detail(request, pk):
    static_interface = get_object_or_404(StaticInterface, pk=pk)

    return cy_detail(request,
                     StaticInterface,
                     'static_intr/static_intr_detail.html', {
                         'Attributes': 'staticinterfaceav_set',
                     },
                     pk=pk,
                     obj=static_interface)
Example #16
0
def site_detail(request, pk):
    obj = get_object_or_404(Site, pk=pk)
    networks = Network.objects.filter(site=obj)

    return cy_detail(request, Site, 'site/site_detail.html', {
        'Networks': networks,
        'Attributes': 'siteav_set',
        'Children Sites': 'site_set',
        'Vlanless Networks': networks.filter(vlan__isnull=True)
    }, obj=obj)
Example #17
0
def soa_detail(request, pk):
    from cyder.base.views import cy_detail
    soa = SOA.objects.get(id=pk)
    return cy_detail(request, SOA, 'soa/soa_detail.html', {
        'domains': (soa.domain_set.filter(is_reverse=False)
                    .order_by('master_domain').select_related()),
        'rdomains': (soa.domain_set.filter(is_reverse=True)
                     .order_by('master_domain').select_related()),
        'attributes': SOAAV.objects.filter(entity=soa.id)
    }, obj=soa)
Example #18
0
def vrf_detail(request, pk):
    vrf = get_object_or_404(Vrf, pk=pk)
    return cy_detail(request,
                     Vrf,
                     'cydhcp/cydhcp_detail.html', {
                         'Dynamic Hosts': 'dynamicinterface_set',
                         'Static Hosts': 'staticinterface_set',
                         'Attributes': 'vrfkeyvalue_set',
                     },
                     pk=pk)
Example #19
0
def dynamic_intr_detail(request, pk):
    dynamic_interface = get_object_or_404(DynamicInterface, pk=pk)

    return cy_detail(request,
                     DynamicInterface,
                     'dynamic_intr/dynamic_intr_detail.html', {
                         'Attributes': 'dynamicinterfaceav_set',
                     },
                     pk=pk,
                     obj=dynamic_interface)
Example #20
0
def domain_detail(request, pk):
    return cy_detail(request, Domain, 'cydns/cydns_detail.html', {
        'Interfaces': 'staticinterface_set',
        'Address Records': 'addressrecord_set',
        'CNAMEs': 'cname_set',
        'MXs': 'mx_set',
        'Nameservers': 'nameserver_set',
        'PTRs': 'reverse_ptr_set',
        'SRVs': 'srv_set',
        'SSHFPs': 'sshfp_set',
        'TXTs': 'txt_set',
    }, pk=pk)
Example #21
0
def network_detail(request, pk):
    network = get_object_or_404(Network, pk=pk)
    parent_networks, child_networks = calc_networks(network)

    return cy_detail(request,
                     Network,
                     'network/network_detail.html', {
                         'Supernet': 'supernets',
                         'Ranges': 'range_set',
                         'Attributes': 'networkav_set',
                     },
                     obj=network)
Example #22
0
def vrf_detail(request, pk):
    vrf = get_object_or_404(Vrf, pk=pk)
    return cy_detail(
        request,
        Vrf,
        "cydhcp/cydhcp_detail.html",
        {
            "Dynamic Hosts": "dynamicinterface_set",
            "Static Hosts": "staticinterface_set",
            "Attributes": "vrfkeyvalue_set",
        },
        pk=pk,
    )
Example #23
0
def site_detail(request, pk):
    obj = get_object_or_404(Site, pk=pk)
    networks = Network.objects.filter(site=obj)

    return cy_detail(
        request,
        Site,
        'site/site_detail.html', {
            'Networks': networks,
            'Attributes': 'siteav_set',
            'Children Sites': 'site_set',
            'Vlanless Networks': networks.filter(vlan__isnull=True)
        },
        obj=obj)
Example #24
0
def vrf_detail(request, pk):
    from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface

    vrf = get_object_or_404(Vrf, pk=pk)

    static_intr_q = get_static_intr_q(vrf)
    static_intrs = (
        StaticInterface.objects.filter(static_intr_q) if static_intr_q else ())

    return cy_detail(request, Vrf, 'vrf/vrf_detail.html', {
        'Dynamic Interfaces': DynamicInterface.objects.filter(
            range__network__vrf=vrf),
        'Static Interfaces': static_intrs,
        'Attributes': 'vrfav_set',
    }, pk=pk, obj=vrf)
Example #25
0
def soa_detail(request, pk):
    from cyder.base.views import cy_detail
    soa = SOA.objects.get(id=pk)
    return cy_detail(
        request,
        SOA,
        'soa/soa_detail.html', {
            'domains': (soa.domain_set.filter(
                is_reverse=False).order_by('master_domain').select_related()),
            'rdomains': (soa.domain_set.filter(
                is_reverse=True).order_by('master_domain').select_related()),
            'attributes':
            SOAAV.objects.filter(entity=soa.id)
        },
        obj=soa)
Example #26
0
def dynamic_intr_detail(request, pk):
    dynamic_interface = get_object_or_404(DynamicInterface, pk=pk)

    return cy_detail(request, DynamicInterface,
                     'cydhcp/cydhcp_detail.html', {}, pk=pk,
                     obj=dynamic_interface)
Example #27
0
def static_intr_detail(request, pk):
    static_interface = get_object_or_404(StaticInterface, pk=pk)

    return cy_detail(request, StaticInterface,
                     'cydhcp/cydhcp_detail.html', {},
                     pk=pk, obj=static_interface)
Example #28
0
def address_record_detail(request, pk):
    return cy_detail(
        request, AddressRecord, 'cydns/cydns_detail.html', {}, pk=pk)
Example #29
0
def vlan_detail(request, pk):
    return cy_detail(request, Vlan, 'cydhcp/cydhcp_detail.html', {
        'Networks': 'network_set',
        'Attributes': 'vlankeyvalue_set',
    }, pk=pk)