Skip to content

Commit

Permalink
Subnets and Nets info
Browse files Browse the repository at this point in the history
Signed-off-by: matthias.gatto <matthias.gatto@outscale.com>
  • Loading branch information
outscale-mgo committed Dec 29, 2023
1 parent 6f2db12 commit a83423a
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions osc_tui/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,30 @@ def exit():
F.editing = False

F.on_ok = exit

info = F.add_widget(
oscscreen.ButtonPress,
name="INFO",
)
def info_net():
exit()
F = displayPopupWide(name = "Net Info Id: " + name)
F.preserve_selected_widget = True

ft = F.add_widget(
oscscreen.Pager,
)
sg = main.GATEWAY.ReadNets(form=form, Filters={"NetIds": [name]})
sg = sg["Nets"][0]

ft.values = json.dumps(sg, indent=2).split("\n")

def ok():
exit()

F.on_ok = ok
F.edit()

delete = F.add_widget(
oscscreen.ButtonPress,
name="DELETE",
Expand All @@ -800,6 +824,7 @@ def subnetRead():
mainForm.MODE = 'Subnets'
form.reload()

info.whenPressed = info_net
delete.whenPressed = delete_cb
read_subnet.whenPressed = subnetRead
F.edit()
Expand Down Expand Up @@ -849,6 +874,31 @@ def exit():
F.editing = False

F.on_ok = exit

info = F.add_widget(
oscscreen.ButtonPress,
name="INFO",
)
def info_subnet():
exit()
F = displayPopupWide(name = "Subnet Info Id: " + name)
F.preserve_selected_widget = True

ft = F.add_widget(
oscscreen.Pager,
)
sg = main.GATEWAY.ReadSubnets(form=form, Filters={"SubnetIds": [name]})
sg = sg["Subnets"][0]

ft.values = json.dumps(sg, indent=2).split("\n")

def ok():
exit()

F.on_ok = ok
F.edit()


test = F.add_widget(
oscscreen.ButtonPress,
name="ASSOCIATE ROUTE TABLE"
Expand All @@ -867,6 +917,8 @@ def delete_cb():
main.GATEWAY.DeleteSubnet(SubnetId=name)
form.current_grid.h_refresh(None)
exit()

info.whenPressed = info_subnet
delete.whenPressed = delete_cb
test.whenPressed = associateRoutetable
F.edit()
Expand Down

0 comments on commit a83423a

Please sign in to comment.