Ga naar hoofdinhoud

CnAdminActionCard

One maintenance action on an admin settings page: a title, a short explanation and one button. The click posts an app action. The button spins while it runs, and the server's message shows below it as success or error.

Use it for work an admin starts by hand, such as repairing the register or importing the schemas again. That work never belongs in the setup wizard.

Usage​

<CnAdminActionCard
app-id="pipelinq"
action="provision"
:title="t('pipelinq', 'Repair the register')"
:description="t('pipelinq', 'Creates missing schemas again. Your data stays as it is.')"
:button-label="t('pipelinq', 'Repair')"
@result="onRepaired" />

By default the card posts to the app's setup action contract, POST /apps/{appId}/api/setup/action/{action}, the endpoint the setup wizard also uses. Pass url to post to another app path.

The server answers { success, message }. A success: false in a 200 answer shows as an error, the same as a failed request.

Props​

PropTypeDefaultDescription
titleString(required)Card heading. Pass it translated.
descriptionString''What the action does, in one or two short sentences.
appIdString''The app id; builds the default URL.
actionString''The action id posted to /api/setup/action/{action}.
urlString''An app path to post to instead, passed through generateUrl.
payloadObject{}Request body.
buttonLabelString'Run'Button label.
runningLabelString'Running…'Label next to the spinner.
buttonVariantString'secondary'NcButton variant.
disabledBooleanfalseDisable the button.

Events​

EventPayloadWhen
result{ success, message, data }The action finished. data is the response body.

Slots​

SlotDescription
defaultExtra content between the explanation and the button.

Accessibility​

  • The result sits in a role="status" region, so a screen reader hears the outcome without the focus moving.
  • The button stays a real button and is disabled while the action runs.