@@ -49,30 +49,43 @@ async def service_details(node_id: NodeID):
4949
5050 ui .separator ()
5151
52- ui .markdown (
53- "**Dangerous Zone, beware!**\n These 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" )
117130async 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