Skip to content

Commit

Permalink
deleting with spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Aug 28, 2023
1 parent 6b762ea commit b2e7ba3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions jhub_apps/launcher/panel_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ def __init__(self, server_name, logo, desc, link, **params):
self.view_button = pn.widgets.Button(name="View", button_type="primary")
self.edit_button = pn.widgets.Button(name="Edit", button_type="warning")
self.delete_button = pn.widgets.Button(name="Delete", button_type="danger")
self.spinner = pn.indicators.LoadingSpinner(
size=30, value=True, color="secondary", bgcolor="dark", visible=False
)

# Set up event listeners for the buttons
self.view_button.on_click(self.on_view)
Expand All @@ -117,7 +114,6 @@ def __init__(self, server_name, logo, desc, link, **params):
self.view_button,
self.edit_button,
self.delete_button,
self.spinner,
css_classes=["list-item"], # Apply the .list-item CSS styling
)

Expand All @@ -134,7 +130,9 @@ def __init__(self, server_name, logo, desc, link, **params):

pn.config.raw_css.append(item_style)

super().__init__(self.content, **params) # Initializing the pn.Column base class
super().__init__(
self.content, **params
) # Initializing the pn.Column base class

def on_view(self, event):
print(f"View button clicked! {self.desc} {event}")
Expand All @@ -147,11 +145,13 @@ def on_edit(self, event):
def on_delete(self, event):
print(f"Delete button clicked! {self.name} {event}")
hclient = HubClient()
self.spinner.visible = True
self.delete_button.visible = False
spinner = pn.indicators.LoadingSpinner(
size=30, value=True, color="danger", bgcolor="dark", visible=True
)
self.content.append(spinner)
hclient.delete_server(username="aktech", server_name=self.server_name)
self.spinner.visible = False
self.delete_button.visible = False
spinner.visible = False
self.content.visible = False


Expand Down

0 comments on commit b2e7ba3

Please sign in to comment.