mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add task
This commit is contained in:
@@ -34,8 +34,11 @@ class Api {
|
||||
return await Http.get<String>(Url.INTIME_LOG(cron), null);
|
||||
}
|
||||
|
||||
|
||||
static Future<HttpResponse<TaskDetailBean>> taskDetail(String cron) async {
|
||||
return await Http.get<TaskDetailBean>(Url.TASK_DETAIL+cron, null);
|
||||
return await Http.get<TaskDetailBean>(Url.TASK_DETAIL + cron, null);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<TaskDetailBean>> addTask(String name, String command, String cron, {String? id}) async {
|
||||
return await Http.put<TaskDetailBean>(Url.ADD_TASK, {"name": name, "command": command, "schedule": cron, "_id": id});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ class Url {
|
||||
static const RUN_TASKS = "/api/crons/run";
|
||||
static const STOP_TASKS = "/api/crons/stop";
|
||||
static const TASK_DETAIL = "/api/crons/";
|
||||
static const ADD_TASK = "/api/crons";
|
||||
|
||||
static INTIME_LOG(String cronId) {
|
||||
return "/api/crons/$cronId/log";
|
||||
|
||||
Reference in New Issue
Block a user