-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: matthias.gatto <[email protected]>
- Loading branch information
1 parent
62cda15
commit 4ed9dad
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from osc_tui import main | ||
from osc_tui import popup | ||
from osc_tui import selectableGrid | ||
|
||
class nicsGrid(selectableGrid.SelectableGrid): | ||
def __init__(self, screen, *args, **keywords): | ||
super().__init__(screen, *args, **keywords) | ||
self.col_titles = ["Id", "State"] | ||
|
||
def refresh_call(self, name_filter=None): | ||
groups = main.GATEWAY.ReadNics(form=self.form)['Nics'] | ||
return groups | ||
|
||
def refresh(self): | ||
groups = main.do_search(self.data.copy(), ["NicId", "State"]) | ||
values = list() | ||
for g in groups: | ||
values.append([g['NicId'], g["State"]]) | ||
self.values = values |