Skip to content

Commit

Permalink
pot: ui: Better consistency in controls.
Browse files Browse the repository at this point in the history
  • Loading branch information
gleidi-suse committed Nov 15, 2023
1 parent 551ddef commit 30d464e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions pot/ui/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,21 @@ class ContainersScreen(RefreshTableScreen):

BINDINGS = [
("i", "inspect", "Inspect"),
("d", "delete", "Delete"),
("r", "run", "Run container"),
("l", "log", "Show logs"),
("k", "stop", "Stop"),
("d", "remove", "Remove"),
("r", "run", "Run container"),
("s", "start", "Start")
]

def __init__(self):
super().__init__(Runtime.get_instance(), "containers")

async def action_delete(self):
container = self.get_selection()
if container:
await self.get_backend().containers.remove(container)

async def action_inspect(self):
container = self.get_selection()
if container:
Expand All @@ -64,11 +69,6 @@ async def action_log(self):
if container:
await self.app.push_screen(ContainerLogScreen(container))

async def action_remove(self):
container = self.get_selection()
if container:
await self.get_backend().containers.remove(container)

async def action_run(self):
await self.app.push_screen(RunContainerScreen(self.get_backend()))

Expand Down
8 changes: 4 additions & 4 deletions pot/ui/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class ImagesScreen(RefreshTableScreen):

BINDINGS = [
("i", "inspect", "Inspect"),
("d", "remove", "Remove"),
("p", "pull", "Pull"),
("r", "run", "Run container")
("d", "delete", "Delete"),
("r", "run", "Run container"),
("p", "pull", "Pull")
]

def __init__(self):
Expand All @@ -24,7 +24,7 @@ async def action_inspect(self):
image_details = await self.get_backend().images.inspect(image)
await self.app.push_screen(InspectScreen(image.repository, image_details))

async def action_remove(self):
async def action_delete(self):
image = self.get_selection()
if image:
await self.get_backend().images.remove(image)
Expand Down

0 comments on commit 30d464e

Please sign in to comment.