-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Introduction | ||
A [Directus](https://github.com/directus/directus) interface extension for triggering API calls from the UI. | ||
|
||
- **Support common HTTP methods**. GET, POST, PUT, PATCH, DELETE. | ||
- **API calls are authenticated automatically**. | ||
- **Dynamic URL**. Use [micromustache](https://github.com/userpixel/micromustache) to generate dynamic URL based on the current values of the item. | ||
- **Disable trigger based on the current values of the item**. | ||
|
||
![](./screenshots/screenshot1.jpeg) | ||
|
||
# Installation | ||
``` | ||
npm i directus-extension-api-trigger-interface | ||
``` | ||
|
||
# Get Started | ||
1. Go to **Settings**, create a new field with type alias. | ||
2. In the **Interface** panel, choose **API Trigger** interface. There are 2 options: | ||
1. **Layout**: Display the button list vertically or horizontally. | ||
2. **Triggers**: A list of trigger. | ||
1. **Label**: label of the button | ||
2. **Size**: size of the button | ||
3. **Type**: style of the button | ||
4. **Icon**: icon of the button | ||
5. **URL**: API endpoint | ||
6. **Method**: Method of the API call | ||
7. **Reload**: If enabled, reload the browser if call succeeded | ||
8. **Disabled Conditions**: disable the button if the conditions are met. | ||
|
||
# Limitation | ||
- Only works for same domain APIs. | ||
|
||
# TODO | ||
- Allow to disable authentication. | ||
- Call external APIs. | ||
- Reduce budnle size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.