emqx / emqx-dashboard5

The management console used to monitor and manage EMQX clusters.
42 stars 34 forks source link

Disconnected clients. Delete all button. #1533

Open cocoaway opened 1 year ago

cocoaway commented 1 year ago

What would you like to be added or enhanced?

Hi, it would be very useful to have a button to delete all clients that are disconnected from the 'Connections' page of the dashboard.

The procedure could be : select status -> disconnected (as already is) and bring up a 'delete all' button.

Thx.

Luca

Why is this needed?

Greater readability of clients, if in the past there have been hundreds of clients that no longer exist, the dashboard continues to show them, making it difficult to read. In addition, a disconnected client today can only be deleted by clicking on its client_id and without the possibility of multiple delete selections.

zmstone commented 1 year ago

Hi @cocoaway

Thank you for the suggestion. As a workaround, there is a batch kick API.

curl -X 'POST' \
  'http://localhost:18083/api/v5/clients/kickout/bulk' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '[  "client1", "client2" ]'

To query the disconnected:

curl -X 'GET' \
  'http://localhost:18083/api/v5/clients?page=1&limit=5&conn_state=disconnected' \
  -H 'accept: application/json'