Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
duydvu committed Sep 14, 2022
1 parent 2726628 commit 500e3d9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions README.md
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "directus-extension-api-trigger-interface",
"version": "1.0.0",
"description": "Display a button to trigger custom APIs",
"description": "Trigger API calls from the UI",
"author": {
"email": "duydvu98@gmail.com",
"name": "Vũ Đức Duy"
Expand Down
Binary file added screenshots/screenshot1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 500e3d9

Please sign in to comment.