Skip to content

Commit 9a4dbfd

Browse files
author
Andrei Neagu
committed
enhanced texts
1 parent 1aae2e4 commit 9a4dbfd

File tree

2 files changed

+35
-17
lines changed
  • services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/api/frontend/routes

2 files changed

+35
-17
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/api/frontend/routes/_index.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _render_buttons(node_id: NodeID, service: TrackedServiceModel) -> None:
7373
with ui.dialog() as confirm_dialog, ui.card():
7474

7575
async def stop_process_task():
76-
confirm_dialog.submit("Yes")
76+
confirm_dialog.submit("Stop")
7777

7878
await httpx.AsyncClient(timeout=10).get(
7979
f"http://localhost:{DEFAULT_FASTAPI_PORT}/service/{node_id}:stop"
@@ -83,20 +83,18 @@ async def stop_process_task():
8383
f"Submitted stop request for {node_id}. Please give the service some time to stop!"
8484
)
8585

86-
ui.markdown(f"Are you sure you want to stop the service **{node_id}**?")
87-
ui.label("The service will also result sopped for the user in his project.")
86+
ui.markdown(f"Stop service **{node_id}**?")
87+
ui.label("The service will be stopped and its data will be saved.")
8888
with ui.row():
89-
ui.button("Yes", color="red", on_click=stop_process_task)
89+
ui.button("Stop", color="red", on_click=stop_process_task)
9090
ui.button("No", on_click=lambda: confirm_dialog.submit("No"))
9191

9292
async def display_confirm_dialog():
9393
await confirm_dialog
9494

9595
ui.button(
9696
"Stop service", icon="stop", color="orange", on_click=display_confirm_dialog
97-
).tooltip(
98-
"Stops the service, same as the user when they press the stop button."
99-
)
97+
).tooltip("Stops the service and saves the data")
10098

10199

102100
def _render_card(

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/api/frontend/routes/_service.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,43 @@ async def service_details(node_id: NodeID):
4949

5050
ui.separator()
5151

52-
ui.markdown(
53-
"**Dangerous Zone, beware!**\nThese actions can damage the system!"
52+
ui.markdown("**Danger Zone, beware!**").classes("text-2xl text-red-700")
53+
ui.label(
54+
"Do not use these actions if you do not know what they are doing."
55+
).classes("text-red-700")
56+
57+
ui.label(
58+
"They are reserved as means of recovering the system form a failing state."
5459
).classes("text-red-700")
5560

5661
with ui.dialog() as confirm_dialog, ui.card():
5762

5863
async def remove_from_tracking():
59-
confirm_dialog.submit("Yes")
64+
confirm_dialog.submit("Remove")
6065
await httpx.AsyncClient(timeout=10).get(
6166
f"http://localhost:{DEFAULT_FASTAPI_PORT}/service/{node_id}/tracker:remove"
6267
)
6368

64-
ui.notify(f"Removal request for {node_id} accepted")
69+
ui.notify(f"Service {node_id} removed from tracking")
6570
ui.navigate.to("/")
6671

67-
ui.markdown(f"Remove from tracking **{node_id}**?")
72+
ui.markdown(f"Remove service **{node_id}** form tracker?")
73+
ui.label(
74+
"This action will result in the removal of the service form the internal tracker. "
75+
"This action should be used whn you are facing issues and the service is not "
76+
"automatically removed."
77+
)
6878
ui.label(
69-
"This will break the fronted for the user! They will no longer receive status updated!"
79+
"NOTE 1: the system normally cleans up services but it might take a few minutes. "
80+
"Only use this option when you have observed enough time passing without any change."
7081
).classes("text-red-600")
7182
ui.label(
72-
"You want to do this if for whatever reason the dynamic-scheduler does not remove this item."
73-
)
83+
"NOTE 2: This will break the fronted for the user! If the user has the service opened, "
84+
"it will no longer receive an status updates."
85+
).classes("text-red-600")
86+
7487
with ui.row():
75-
ui.button("Yes", color="red", on_click=remove_from_tracking)
88+
ui.button("Remove", color="red", on_click=remove_from_tracking)
7689
ui.button("No", on_click=lambda: confirm_dialog.submit("No"))
7790

7891
async def display_confirm_dialog():
@@ -115,4 +128,11 @@ async def service_stop(node_id: NodeID):
115128

116129
@router.page("/service/{node_id}/tracker:remove")
117130
async def remove_service_from_tracking(node_id: NodeID):
118-
await remove_tracked_service(get_parent_app(app), node_id)
131+
parent_app = get_parent_app(app)
132+
133+
service_model = await get_tracked_service(parent_app, node_id)
134+
if not service_model:
135+
ui.notify(f"Could not remove service {node_id}. Was not abel to find it")
136+
return
137+
138+
await remove_tracked_service(parent_app, node_id)

0 commit comments

Comments
 (0)