Code Monkey home page Code Monkey logo

Comments (10)

iDebugAll avatar iDebugAll commented on June 18, 2024

Hi,

could you please elaborate the expected tag assignment and handling in some more details?

The ability to hide specific layers is already implemented in general.
You can use "undisplayed_device_role_slugs" plugin parameter to make listed device roles hidden on the initial site topology:

PLUGINS_CONFIG = {
    "nextbox_ui_plugin": {
        "undisplayed_device_role_slugs": (
            "edge-switch",
            "border-router",
        )
    }
}

In the example above, any devices with 'edge-switch' or 'border-router' role assigned will be initially hidden.
Such device roles will be unchecked in the 'Select Layers' menu on the topology view.
You can use this menu to dynamically control the visibility of the layers:

How do you suggest to improve or extend this logic?

from nextbox-ui-plugin.

Vadims06 avatar Vadims06 commented on June 18, 2024

Hi,

could you please elaborate the expected tag assignment and handling in some more details?

The ability to hide specific layers is already implemented in general.
You can use "undisplayed_device_role_slugs" plugin parameter to make listed device roles hidden on the initial site topology:

PLUGINS_CONFIG = {
    "nextbox_ui_plugin": {
        "undisplayed_device_role_slugs": (
            "edge-switch",
            "border-router",
        )
    }
}

In the example above, any devices with 'edge-switch' or 'border-router' role assigned will be initially hidden.
Such device roles will be unchecked in the 'Select Layers' menu on the topology view.
You can use this menu to dynamically control the visibility of the layers:

How do you suggest to improve or extend this logic?

@iDebugAll, I could suggest that it would be great if we could make such dynamic filtering based on ... Tags for example. Because we have a big topology with switches with the same role, but I would like to see only those switches, which refer to particular Dev environment or lab. Suppose, we have 100 switches in one site and 5 environments with 20 devices in each environment. It would be great if we had a chance to see only devices from one environment.

from nextbox-ui-plugin.

Vadims06 avatar Vadims06 commented on June 18, 2024

@iDebugAll additionally, is it possible to increase topology window to "full view"?)

from nextbox-ui-plugin.

jpobeda avatar jpobeda commented on June 18, 2024

@Vadims06 explained it better than I did but that's the idea. If you want to only draw let's say a particular tag that belongs to a particular customer or environment. It would be awesome to be able to that from the web ui dynamically.

from nextbox-ui-plugin.

iDebugAll avatar iDebugAll commented on June 18, 2024

@Vadims06 @jpobeda thank you for the clarification. Such visibility granularity sounds reasonable and aligned with current plugin design.
I have just made a first approach to an implementation. In my lab, it looks as follows:

Some tag filtering should still be added as not all the tags conform this idea by design. I'm thinking of an approach like that:

PLUGINS_CONFIG = {
    "nextbox_ui_plugin": {
        "undisplayed_device_tags": (
            "tag_to_hide_some_devices_initially",
            "another_tag_to_hide_some_devices_initially",
        ),
        "select_layers_list_include_device_tags": (
            # include only tags containing listed words to a 'Select Layers' list
            "lab",
            "group",
         ),
        "select_layers_list_exclude_device_tags": (
            # filter out tags containing listed words from a 'Select Layers' list
            "foo",
            "bar",
         ),
    }
}

This should cover most of the cases.
Could you provide some insight on how you use tags in your environment? It could be helpful.

from nextbox-ui-plugin.

jpobeda avatar jpobeda commented on June 18, 2024

Hi @iDebugAll ,

It looks promising. Thanks for taking the time to look into it.

The main reason to be using tags is to be able to create filters easily from retrieving one field (aka tags). My use case to request this feature is that we host our own infra but also customer's infrastructure whether it's in our datacenter or an external one.
So, let's say I go to Sites and pick one of this DC and click on the topology icon. It will currently draw a massive topology whereas if I could also say, for this site, just this and this tag (dynamically) it'll narrow down the drawing to what I want.

For example a customer having an interconnect through your gear, If only select the customer tag I would only get the customer gear and would be missing the interconnect through my company's gear.

The only down side I see on your approach is that every time I create a new Tenant and customer tag I'll have to manually edit configuration.py to add them. I haven't proposed to use Tenant/Tenant Group because I think people might be using them in different ways as well. In my case, I have a match between two.

Does that make sense? I'm open to ideas :D

Can any of this be configured through the admin portal?

from nextbox-ui-plugin.

iDebugAll avatar iDebugAll commented on June 18, 2024

Hi @jpobeda

The only down side I see on your approach is that every time I create a new Tenant and customer tag I'll have to manually edit configuration.py to add them.

I made all tag visibility control parameters regexp-based. So you can define just a few base rules if you have a predictable naming convention for your tags. With regular expression syntax, you can do this as specific as you need.
The plugin preforms a re.search based on defined parameter values. This is effectively an any position match of given substring within a tag string. For instance, 'cust' would match 'cust_0001', '0001_cust', and any other tag values containing 'cust' on any position. '^cust_0001$' would match an exact 'cust_0001' tag value and so on.

from nextbox-ui-plugin.

iDebugAll avatar iDebugAll commented on June 18, 2024

I have just published a new v0.6.0 containing this feature implementation. It is available on PyPi.
Feel free to check this out. I'll appreciate your feedback and further improvement suggestions.

Also some comments on your side questions:

Can any of this be configured through the admin portal?

@jpobeda The quick answer is no. The plugin on its current development stage does not write anything to the database.
Implementing per user setting and persistent views will likely require this. So I will consider implementing this in a future releases.

is it possible to increase topology window to "full view"?)

@Vadims06 There are some NeXt UI limitations in canvas size adaptiveness. I'm looking for a workaround.

from nextbox-ui-plugin.

jpobeda avatar jpobeda commented on June 18, 2024

@iDebugAll , great, thanks! I'll see if I can check it out during the day in test env and get back to you :D

from nextbox-ui-plugin.

jpobeda avatar jpobeda commented on June 18, 2024

Looks great! Thanks!

from nextbox-ui-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.