mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
依赖管理支持批量添加
This commit is contained in:
@@ -89,24 +89,21 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> startTasks(
|
||||
List<String> crons) async {
|
||||
static Future<HttpResponse<NullResponse>> startTasks(List<String> crons) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.runTasks,
|
||||
crons,
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> stopTasks(
|
||||
List<String> crons) async {
|
||||
static Future<HttpResponse<NullResponse>> stopTasks(List<String> crons) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.stopTasks,
|
||||
crons,
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> updatePassword(
|
||||
String name, String password) async {
|
||||
static Future<HttpResponse<NullResponse>> updatePassword(String name, String password) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.updatePassword,
|
||||
{
|
||||
@@ -130,11 +127,7 @@ class Api {
|
||||
int? id,
|
||||
String? nId,
|
||||
}) async {
|
||||
var data = <String, dynamic>{
|
||||
"name": name,
|
||||
"command": command,
|
||||
"schedule": cron
|
||||
};
|
||||
var data = <String, dynamic>{"name": name, "command": command, "schedule": cron};
|
||||
|
||||
if (id != null || nId != null) {
|
||||
if (id != null) {
|
||||
@@ -202,8 +195,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> saveFile(
|
||||
String name, String content) async {
|
||||
static Future<HttpResponse<NullResponse>> saveFile(String name, String content) async {
|
||||
return await Http.post<NullResponse>(
|
||||
Url.saveFile,
|
||||
{"content": content, "name": name},
|
||||
@@ -268,8 +260,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> moveEnv(
|
||||
String id, int fromIndex, int toIndex) async {
|
||||
static Future<HttpResponse<NullResponse>> moveEnv(String id, int fromIndex, int toIndex) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.envMove(id),
|
||||
{"fromIndex": fromIndex, "toIndex": toIndex},
|
||||
@@ -284,12 +275,10 @@ class Api {
|
||||
}
|
||||
|
||||
static Future<HttpResponse<List<TaskLogBean>>> taskLog() async {
|
||||
return await Http.get<List<TaskLogBean>>(Url.taskLog, null,
|
||||
serializationName: Utils.isUpperVersion2_12_2() ? "data" : "dirs");
|
||||
return await Http.get<List<TaskLogBean>>(Url.taskLog, null, serializationName: Utils.isUpperVersion2_12_2() ? "data" : "dirs");
|
||||
}
|
||||
|
||||
static Future<HttpResponse<String>> taskLogDetail(
|
||||
String name, String path) async {
|
||||
static Future<HttpResponse<String>> taskLogDetail(String name, String path) async {
|
||||
if (Utils.isUpperVersion2_13_0()) {
|
||||
return await Http.get<String>(
|
||||
Url.taskLogDetail + name + "?path=" + path,
|
||||
@@ -311,8 +300,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> updateScript(
|
||||
String name, String path, String content) async {
|
||||
static Future<HttpResponse<NullResponse>> updateScript(String name, String path, String content) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.scriptDetail,
|
||||
{
|
||||
@@ -323,8 +311,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> delScript(
|
||||
String name, String path) async {
|
||||
static Future<HttpResponse<NullResponse>> delScript(String name, String path) async {
|
||||
return await Http.delete<NullResponse>(
|
||||
Url.scriptDetail,
|
||||
{
|
||||
@@ -334,8 +321,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<String>> scriptDetail(
|
||||
String name, String? path) async {
|
||||
static Future<HttpResponse<String>> scriptDetail(String name, String? path) async {
|
||||
return await Http.get<String>(
|
||||
Url.scriptDetail + name,
|
||||
{
|
||||
@@ -344,8 +330,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<List<DependencyBean>>> dependencies(
|
||||
String type) async {
|
||||
static Future<HttpResponse<List<DependencyBean>>> dependencies(String type) async {
|
||||
return await Http.get<List<DependencyBean>>(
|
||||
Url.dependencies,
|
||||
{
|
||||
@@ -354,8 +339,7 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> dependencyReinstall(
|
||||
String id) async {
|
||||
static Future<HttpResponse<NullResponse>> dependencyReinstall(String id) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.dependencies,
|
||||
[id],
|
||||
@@ -369,21 +353,14 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> addDependency(
|
||||
String name, int type) async {
|
||||
static Future<HttpResponse<NullResponse>> addDependency(List<Map<String, dynamic>> list) async {
|
||||
return await Http.post<NullResponse>(
|
||||
Url.dependencies,
|
||||
[
|
||||
{
|
||||
"name": name,
|
||||
"type": type,
|
||||
}
|
||||
],
|
||||
list,
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<NullResponse>> addScript(
|
||||
String name, String path, String content) async {
|
||||
static Future<HttpResponse<NullResponse>> addScript(String name, String path, String content) async {
|
||||
return await Http.post<NullResponse>(
|
||||
Url.addScript,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user