forked from labring/laf
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(system): fix trigger CRUD pages;
- Loading branch information
Showing
3 changed files
with
100 additions
and
222 deletions.
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 |
---|---|---|
@@ -1,23 +1,58 @@ | ||
import store from '@/store' | ||
import request from '@/utils/request' | ||
|
||
/** | ||
* 应用所有触发器调度 | ||
* Create a trigger | ||
* @param {string} func_id | ||
* @param {object} function_data | ||
* @returns | ||
*/ | ||
export function applyTriggers() { | ||
export function createTrigger(func_id, trigger_data) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/admin/apply/triggers`, | ||
method: 'post' | ||
url: `/apps/${appid}/function/${func_id}/triggers/create`, | ||
method: 'post', | ||
data: trigger_data | ||
}) | ||
} | ||
|
||
/** | ||
* Update a trigger | ||
* @param {string} func_id | ||
* @param {object} function_data | ||
* @returns | ||
*/ | ||
export function updateTrigger(func_id, trigger_id, trigger_data) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/function/${func_id}/triggers/${trigger_id}`, | ||
method: 'post', | ||
data: trigger_data | ||
}) | ||
} | ||
|
||
/** | ||
* Remove a trigger | ||
* @param {string} func_id | ||
* @param {object} function_data | ||
* @returns | ||
*/ | ||
export function removeTrigger(func_id, trigger_id) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/function/${func_id}/triggers/${trigger_id}`, | ||
method: 'delete' | ||
}) | ||
} | ||
|
||
/** | ||
* 应用一个触发器调度 | ||
* @param {String} triggerId 触发器ID | ||
* Publish triggers | ||
* @returns | ||
*/ | ||
export function applyTrigger(triggerId) { | ||
export function publishTriggers() { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/admin/apply/triggers?tid=${triggerId}`, | ||
url: `/apps/${appid}/function/publish/triggers`, | ||
method: 'post' | ||
}) | ||
} |
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
Oops, something went wrong.