cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

Allow for dynamic Cockpit Actions and add support for customizable HTTP request actions

Open rafaellehmkuhl opened this issue 1 year ago • 1 comments

https://github.com/user-attachments/assets/7e64a286-4a72-4755-93a6-6e43636e273d

Fix #568

rafaellehmkuhl avatar Oct 03 '24 18:10 rafaellehmkuhl

  • [x] File import/export would be very useful
  • [x] Include a "test now" button in the Actions editor

ES-Alexander avatar Oct 03 '24 19:10 ES-Alexander

  • [x] File import/export would be very useful
  • [x] Include a "test now" button in the Actions editor

Added both:

image

Can be tested with the following files:

http-request-action (Arm with HTTP).json http-request-action (Disarm with HTTP).json

rafaellehmkuhl avatar Oct 08 '24 20:10 rafaellehmkuhl

We indeed were using 'Title Case' on the titles for the windows, modals and expansible panels, but after some feedback we decided to keep everything on regular capitalization:

Check the Alerts config page: image

image

ArturoManzoli avatar Oct 09 '24 17:10 ArturoManzoli

Missing some tooltips for the action buttons and some margin on the table header:

image

Margins: image

ArturoManzoli avatar Oct 09 '24 18:10 ArturoManzoli

I was able to load some random .json files into the Actions module and they broke cockpit (obviously.. haha) What are your thoughts on adding a header to the files exported from the "Cockpit actions configuration" table? Would it be necessary or just overkill for the current needs?

image

ArturoManzoli avatar Oct 09 '24 19:10 ArturoManzoli

I was able to load some random .json files into the Actions module and they broke cockpit (obviously.. haha) What are your thoughts on adding a header to the files exported from the "Cockpit actions configuration" table? Would it be necessary or just overkill for the current needs?

I think we can add a simple validator to check at least if the json structure is the same.

rafaellehmkuhl avatar Oct 09 '24 19:10 rafaellehmkuhl

Export icons can be centered inside its container using:

<v-btn
    variant="outlined"
    class="rounded-full mx-1 pl-[3px] pt-[1px]"
    icon="mdi-export"
    size="x-small"
    @click="exportAction(item.id)"
/>

image

ArturoManzoli avatar Oct 09 '24 19:10 ArturoManzoli

@ArturoManzoli all UI changes were performed. I've also added file validation for the "Import action" button and changed the data-lake structures to "CockpitActionVariable" (former "CockpitActionParameter").

image

rafaellehmkuhl avatar Oct 14 '24 14:10 rafaellehmkuhl