Skip to content

Commit

Permalink
feat(docker): dedicated menu for logging out of registries
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed May 12, 2024
1 parent cde7e97 commit e00885c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- refactor(vscode): add name of the vscode instance to the sub heading of the vscode
menu when it is running
- fix(vscode): set a timeout for vscode commands - closes #101
- feat(docker): dedicated menu for logging out of registries

## Version 0.14.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@
1,
1
],
"icon": "󰐲",
"icon": "󰌉",
"is_short": false,
"label": "Set Access Key",
"label": "Add Registry",
"opacity": null
}
],
Expand Down
37 changes: 27 additions & 10 deletions ubo_app/services/080-docker/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from docker.models.containers import Container
from docker.models.images import Image
from reducer import IMAGES
from ubo_gui.constants import DANGER_COLOR
from ubo_gui.menu.types import ActionItem, HeadedMenu, HeadlessMenu, Item, SubMenuItem

from ubo_app.constants import (
Expand Down Expand Up @@ -327,18 +328,34 @@ def settings_menu_items(usernames: dict[str, str]) -> Sequence[Item]:
"""Get the settings menu items for the Docker service."""
return [
ActionItem(
label='Set Access Key',
icon='󰐲',
label='Add Registry',
icon='󰌉',
action=input_credentials,
),
*[
ActionItem(
label=registry,
icon='󰌊',
action=functools.partial(clear_credentials, registry),
)
for registry in usernames
],
*(
[
SubMenuItem(
label='Registries',
icon='󱕴',
sub_menu=HeadedMenu(
title='󱕴Registries',
heading='Logged in Registries',
sub_heading='Log out of any registry by selecting it',
items=[
ActionItem(
label=registry,
icon='󰌊',
background_color=DANGER_COLOR,
action=functools.partial(clear_credentials, registry),
)
for registry in usernames
],
),
),
]
if usernames
else []
),
]


Expand Down

0 comments on commit e00885c

Please sign in to comment.