Exemplo n.º 1
0
def plugin_item(name):
    return PluginMenuItem(
        permissions=[f"{config.name}.view_{name.lower()}"],
        link=f"plugins:{config.name}:{inflection.tableize(name)}_list",
        link_text=f"{inflection.titleize(inflection.pluralize(name))}",
        buttons=(PluginMenuButton(
            f"plugins:{config.name}:{inflection.tableize(name)}_add",
            f"Add {inflection.titleize(name)}", 'fa fa-plus',
            ButtonColorChoices.GREEN), ))
Exemplo n.º 2
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(
        link='plugins:netbox_virtual_circuit_plugin:virtual_circuit_list',
        link_text='Virtual Circuits',
        permissions=['netbox_virtual_circuit_plugin.view_virtualcircuit'],
        buttons=(PluginMenuButton(
            link='plugins:netbox_virtual_circuit_plugin:virtual_circuit_add',
            title='Add a new virtual circuit',
            icon_class='mdi mdi-plus-thick',
            color=ButtonColorChoices.GREEN,
            permissions=['netbox_virtual_circuit_plugin.add_virtualcircuit'
                         ]), )),
    PluginMenuItem(
        link='plugins:netbox_virtual_circuit_plugin:virtual_circuit_vlan_list',
        link_text='Connections',
        permissions=['netbox_virtual_circuit_plugin.view_virtualcircuitvlan'],
        buttons=(PluginMenuButton(
            link=
            'plugins:netbox_virtual_circuit_plugin:virtual_circuit_vlan_add',
            title='Assign a VLAN to a Virtual Circuit',
            icon_class='mdi mdi-plus-thick',
            color=ButtonColorChoices.GREEN,
            permissions=[
                'netbox_virtual_circuit_plugin.add_virtualcircuitvlan'
            ]), )),
)
Exemplo n.º 3
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(link='plugins:sdns:domainserv_list',
                   link_text='Domains Servers',
                   permissions=[],
                   buttons=(
                       PluginMenuButton(
                           link='plugins:sdns:domainserv_add',
                           title='Add a new Domain Server',
                           icon_class='mdi mdi-plus-thick',
                           color=ButtonColorChoices.GREEN,
                       ),
                       PluginMenuButton(
                           link='plugins:sdns:domainserv_import',
                           title='Import news Domain Servers',
                           icon_class='mdi mdi-database-import-outline',
                           color=ButtonColorChoices.BLUE,
                           permissions=['sdns.add_domainserv']),
                   )),
    PluginMenuItem(link='plugins:sdns:domain_list',
                   link_text='Domain',
                   permissions=[],
                   buttons=(
                       PluginMenuButton(
                           link='plugins:sdns:domain_add',
                           title='Add a new Domain',
                           icon_class='mdi mdi-plus-thick',
                           color=ButtonColorChoices.GREEN,
                       ),
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices


# Declare a list of menu items to be added to NetBox's built-in naivgation menu
menu_items = (

    # Each PluginMenuItem instance renders a custom menu item. Each item may have zero or more buttons.
    PluginMenuItem(
        link='plugins:netbox_aws:vpc_list',
        link_text='VPCs',
        permissions=['netbox_aws.view_vpc'],
        buttons=(

            # Add a green button which links to the admin view to add a new vpc. This
            # button will appear only if the user has the "add_vpc" permission.
            PluginMenuButton(
                link='plugins:netbox_aws:vpc_add',
                title='Add a new VPC',
                icon_class='fa fa-plus',
                color=ButtonColorChoices.GREEN,
                permissions=['netbox_aws.add_vpc']
            ),
        )
    ),

)
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

from .icon_classes import icon_classes

menu_items = (PluginMenuItem(
    link="plugins:netbox_bgppeering:bgppeering_list",
    link_text="BGP Peerings",
    buttons=(PluginMenuButton(
        link="plugins:netbox_bgppeering:bgppeering_add",
        title="Add",
        icon_class=icon_classes.get("plus"),
        color=ButtonColorChoices.GREEN,
        permissions=["netbox_bgppeering.add_bgppeering"],
    ), ),
), )
Exemplo n.º 6
0
from extras.plugins import PluginMenuItem, PluginMenuButton
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(
        link='plugins:software_manager:software_list',
        link_text='Software Repository',
        permissions=['software_manager.view_softwareimage'],
    ),
    PluginMenuItem(
        link='plugins:software_manager:golden_image_list',
        link_text='Golden Images',
        permissions=['software_manager.view_goldenimage'],
    ),
    PluginMenuItem(
        link='plugins:software_manager:upgrade_device_list',
        link_text='Upgrade Devices',
        permissions=['software_manager.view_device'],
        buttons=(
            PluginMenuButton(
                link='plugins:software_manager:scheduled_task_list',
                title='Schedule tasks',
                icon_class='mdi mdi-update',
                color=ButtonColorChoices.BLUE,
                permissions=['software_manager.view_scheduledtask'],
            ),
        ),
    ),
)
Exemplo n.º 7
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(link='plugins:netbox_supervisor_plugin:supervisor_list',
                   link_text='Ответственные',
                   permissions=['netbox_supervisor_plugin.view_supervisor'],
                   buttons=(PluginMenuButton(
                       link='plugins:netbox_supervisor_plugin:supervisor_add',
                       title='Add a new supervisor',
                       icon_class='mdi mdi-plus-thick',
                       color=ButtonColorChoices.GREEN,
                       permissions=['netbox_supervisor_plugin.add_supervisor'
                                    ]), )),
    # PluginMenuItem(
    #     link='plugins:netbox_supervisor_plugin:supervisor_tenant_list',
    #     link_text='Дополнительные связи',
    #     permissions=['netbox_supervisor_plugin.view_supervisortenant'],
    #     buttons=(
    #         PluginMenuButton(
    #             link='plugins:netbox_supervisor_plugin:supervisor_tenant_add',
    #             title='Assign a Tenant to Supervisor',
    #             icon_class='mdi mdi-plus-thick',
    #             color=ButtonColorChoices.GREEN,
    #             permissions=['netbox_supervisor_plugin.add_supervisortenant']
    #         ),
    #     )
    # ),
)
Exemplo n.º 8
0
"""

from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

from .release import NETBOX_RELEASE_CURRENT, NETBOX_RELEASE_210

menu_items = (PluginMenuItem(
    link="plugins:netbox_onboarding:onboardingtask_list",
    link_text="Onboarding Tasks",
    permissions=["netbox_onboarding.view_onboardingtask"],
    buttons=(
        PluginMenuButton(
            link="plugins:netbox_onboarding:onboardingtask_add",
            title="Onboard",
            icon_class="mdi mdi-plus-thick"
            if NETBOX_RELEASE_CURRENT >= NETBOX_RELEASE_210 else "fa fa-plus",
            color=ButtonColorChoices.GREEN,
            permissions=["netbox_onboarding.add_onboardingtask"],
        ),
        PluginMenuButton(
            link="plugins:netbox_onboarding:onboardingtask_import",
            title="Bulk Onboard",
            icon_class="mdi mdi-database-import-outline" if
            NETBOX_RELEASE_CURRENT >= NETBOX_RELEASE_210 else "fa fa-download",
            color=ButtonColorChoices.BLUE,
            permissions=["netbox_onboarding.add_onboardingtask"],
        ),
    ),
), )
Exemplo n.º 9
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(
        link="plugins:axians_netbox_pdu:pduconfig_list",
        link_text="PDU Config",
        permissions=["axians_netbox_pdu.view_pduconfig"],
        buttons=(
            PluginMenuButton(
                link="plugins:axians_netbox_pdu:pduconfig_add",
                title="Add",
                icon_class="fa fa-plus",
                color=ButtonColorChoices.GREEN,
                permissions=["axians_netbox_pdu.add_pduconfig"],
            ),
            PluginMenuButton(
                link="plugins:axians_netbox_pdu:pduconfig_import",
                title="Bulk Add",
                icon_class="fa fa-download",
                color=ButtonColorChoices.BLUE,
                permissions=["axians_netbox_pdu.add_pduconfig"],
            ),
        ),
    ),
)
Exemplo n.º 10
0
limitations under the License.
"""

from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(
        link="plugins:netbox_tunnels:tunnels_list",
        link_text="Tunnels",
        permissions=["netbox_tunnels.view_tunnels"],
        buttons=(
            # Link to the plugins view to add a tunnel if user has "add_tunnels" permission.
            PluginMenuButton(
                link="plugins:netbox_tunnels:tunnel_creation",
                title="Add a new tunnel",
                icon_class="fa fa-plus",
                color=ButtonColorChoices.GREEN,
                permissions=["netbox_tunnels.add_tunnels"],
            ),
            # Links to the plugins view to bulk import tunnels if user has the "add_tunnels" permission.
            PluginMenuButton(
                link="plugins:netbox_tunnels:tunnels_import",
                title="Bulk import tunnels",
                icon_class="fa fa-download",
                color=ButtonColorChoices.BLUE,
                permissions=["netbox_tunnels.add_tunnels"],
            ),
        ),
    ), )
Exemplo n.º 11
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

# Declare a list of menu items to be added to NetBox's built-in naivgation menu
menu_items = (

    # Each PluginMenuItem instance renders a custom menu item. Each item may have zero or more buttons.
    PluginMenuItem(
        link='plugins:netbox_animal_sounds:list_animals',
        link_text='List all animals',
        permissions=[],
        buttons=(

            # Add a default button which links to the random animal view
            PluginMenuButton(link='plugins:netbox_animal_sounds:random_animal',
                             title='Random animal',
                             icon_class='fa-question'),

            # Add a green button which links to the admin view to add a new animal. This
            # button will appear only if the user has the "add_animal" permission.
            PluginMenuButton(link='admin:netbox_animal_sounds_animal_add',
                             title='Add a new animal',
                             icon_class='fa-plus',
                             color=ButtonColorChoices.GREEN,
                             permissions=['netbox_animal_sounds.add_animal']),
        )), )
Exemplo n.º 12
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (PluginMenuItem(
    link="plugins:ciscodnacnetbox:status",
    link_text="Status",
    permissions=["admin"],
    buttons=(
        PluginMenuButton(
            link="plugins:ciscodnacnetbox:sync_full",
            title="Settings",
            icon_class="mdi mdi-all-inclusive",
            color=ButtonColorChoices.BLUE,
            permissions=["admin"],
        ),
        PluginMenuButton(
            link="plugins:ciscodnacnetbox:settings",
            title="Settings",
            icon_class="mdi mdi-cog",
            color=ButtonColorChoices.BLUE,
            permissions=["admin"],
        ),
    ),
), )
Exemplo n.º 13
0
from extras.plugins import PluginMenuButton, PluginMenuItem

menu_items = (
    PluginMenuItem(link='plugins:dummy_plugin:dummy_models',
                   link_text='Item 1',
                   buttons=(
                       PluginMenuButton(
                           link='admin:dummy_plugin_dummymodel_add',
                           title='Add a new dummy model',
                           icon_class='mdi mdi-plus-thick',
                       ),
                       PluginMenuButton(
                           link='admin:dummy_plugin_dummymodel_add',
                           title='Add a new dummy model',
                           icon_class='mdi mdi-plus-thick',
                       ),
                   )),
    PluginMenuItem(
        link='plugins:dummy_plugin:dummy_models',
        link_text='Item 2',
    ),
)
Exemplo n.º 14
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(
        link="plugins:netbox_proxbox:proxmoxvm_list",
        link_text="Proxmox VM/CT",
        buttons=(
            PluginMenuButton(
                # match the names of the path for create view defined in ./urls.py
                link="plugins:netbox_proxbox:proxmoxvm_add",
                # text that appears when hovering the ubtton
                title="Add",
                # font-awesome icon to use
                icon_class="mdi mdi-plus-thick",  # 'fa fa-plus' didn't work
                # defines color button to green
                color=ButtonColorChoices.GREEN,
                permissions=["netbox_proxbox.add_proxmoxvm"],
            ), ),
    ), )
Exemplo n.º 15
0
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(
        link='plugins:netbox_bgp:asn_list',
        link_text='AS Numbers',
        permissions=['netbox_bgp.view_asn'],
        buttons=(
            PluginMenuButton(
                link='plugins:netbox_bgp:asn_add',
                title='AS Numbers',
                icon_class='mdi mdi-plus-thick',
                color=ButtonColorChoices.GREEN,
                permissions=['netbox_bgp.add_asn'],
            ),
        ),
    ),
    PluginMenuItem(
        link='plugins:netbox_bgp:community_list',
        link_text='Communities',
        permissions=['netbox_bgp.view_community'],
        buttons=(
            PluginMenuButton(
                link='plugins:netbox_bgp:community_add',
                title='Communities',
                icon_class='mdi mdi-plus-thick',
                color=ButtonColorChoices.GREEN,
                permissions=['netbox_bgp.add_community'],
            ),
        ),
Exemplo n.º 16
0
from extras.plugins import PluginMenuButton, PluginMenuItem

menu_items = (
    PluginMenuItem(link='plugins:dummy_plugin:dummy_models',
                   link_text='Item 1',
                   buttons=(
                       PluginMenuButton(
                           link='admin:dummy_plugin_dummymodel_add',
                           title='Add a new dummy model',
                           icon_class='fa fa-plus',
                       ),
                       PluginMenuButton(
                           link='admin:dummy_plugin_dummymodel_add',
                           title='Add a new dummy model',
                           icon_class='fa fa-plus',
                       ),
                   )),
    PluginMenuItem(
        link='plugins:dummy_plugin:dummy_models',
        link_text='Item 2',
    ),
)
Exemplo n.º 17
0
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (PluginMenuItem(
    link="plugins:netbox_onboarding:onboardingtask_list",
    link_text="Onboarding Tasks",
    permissions=["netbox_onboarding.view_onboardingtask"],
    buttons=(
        PluginMenuButton(
            link="plugins:netbox_onboarding:onboardingtask_add",
            title="Onboard",
            icon_class="fa fa-plus",
            color=ButtonColorChoices.GREEN,
            permissions=["netbox_onboarding.add_onboardingtask"],
        ),
        PluginMenuButton(
            link="plugins:netbox_onboarding:onboardingtask_import",
            title="Bulk Onboard",
            icon_class="fa fa-download",
            color=ButtonColorChoices.BLUE,
            permissions=["netbox_onboarding.add_onboardingtask"],
        ),
    ),
), )
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices

menu_items = (
    PluginMenuItem(link='plugins:config_officer:collection_status',
                   link_text='Device data collection',
                   buttons=(PluginMenuButton(
                       link='plugins:config_officer:collect_all_cisco_configs',
                       title='Start global collection',
                       icon_class='mdi mdi-earth',
                       color=ButtonColorChoices.BLUE), )),
    PluginMenuItem(
        link='plugins:config_officer:template_list',
        link_text='Templates configuration',
    ),
    PluginMenuItem(
        link='plugins:config_officer:service_mapping_list',
        link_text='Templates compliance status',
    ),
)