srl-labs / clab-io-draw

Containerlab and Draw.io Integration
MIT License
17 stars 4 forks source link

clab2drawio interactive mode #11

Closed toweber closed 5 months ago

toweber commented 5 months ago

I think it would be helpful to have an interactive mode for the drawio generation. The graph-level and icon options are not needed for clab and I personally would like to keep them out of the clab file while still keeping this awesome feature of creating a drawio diagram. This mode could be optional by invoking the command with an "interactive" flag while the current mode can still be the default way to go.

I am thinking of an interactive menu where the user can choose the options on the fly after the clab file has been parsed.

Example

    Parsing clab file... Found 8 nodes... Done.

    DEFINE GRAPH LEVELS
    Choose level 1 nodes:
    [X] borderleaf1
    [X] borderleaf2
    [ ] spine1
    [ ] spine2
    [ ] leaf1
    [ ] leaf2
    [ ] host1
    [ ] host2

    OK!

    Choose level 2 nodes:
    [X] spine1
    [X] spine2
    [ ] leaf1
    [ ] leaf2
    [ ] host1
    [ ] host2

    OK!

    Choose level 3 nodes:
    [X] leaf1
    [X] leaf2
    [ ] host1
    [ ] host2

    OK!

    Choose level 4 nodes:
    [X] host1
    [X] host2

    OK!

    No more nodes left. Done!

    DEFINE GRAPH ICONS
    Choose dcgw icon nodes:
    [X] borderleaf1
    [X] borderleaf2
    [ ] spine1
    [ ] spine2
    [ ] leaf1
    [ ] leaf2
    [ ] host1
    [ ] host2

    OK!

    Choose spine icon nodes:
    [X] spine1
    [X] spine2
    [ ] leaf1
    [ ] leaf2
    [ ] host1
    [ ] host2

    OK!

    Choose leaf icon nodes:
    [X] leaf1
    [X] leaf2
    [ ] host1
    [ ] host2

    OK!

    Choose server icon nodes:
    [X] host1
    [X] host2

    OK!

    No more nodes left. Done!