mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
新增任务详情页
This commit is contained in:
@@ -8,7 +8,6 @@ import 'package:qinglong_app/module/others/login_log/login_log_bean.dart';
|
||||
import 'package:qinglong_app/module/others/scripts/script_bean.dart';
|
||||
import 'package:qinglong_app/module/others/task_log/task_log_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_detail/task_detail_bean.dart';
|
||||
|
||||
import 'url.dart';
|
||||
|
||||
@@ -58,24 +57,17 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<TaskDetailBean>> taskDetail(String cron) async {
|
||||
return await Http.get<TaskDetailBean>(
|
||||
Url.taskDetail + cron,
|
||||
null,
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<TaskDetailBean>> addTask(String name, String command, String cron, {String? id}) async {
|
||||
static Future<HttpResponse<NullResponse>> addTask(String name, String command, String cron, {String? id}) async {
|
||||
var data = {"name": name, "command": command, "schedule": cron};
|
||||
|
||||
if (id != null) {
|
||||
data["_id"] = id;
|
||||
return await Http.put<TaskDetailBean>(
|
||||
return await Http.put<NullResponse>(
|
||||
Url.addTask,
|
||||
data,
|
||||
);
|
||||
}
|
||||
return await Http.post<TaskDetailBean>(
|
||||
return await Http.post<NullResponse>(
|
||||
Url.addTask,
|
||||
data,
|
||||
);
|
||||
|
||||
@@ -14,11 +14,13 @@ import 'package:qinglong_app/module/others/task_log/task_log_detail_page.dart';
|
||||
import 'package:qinglong_app/module/others/task_log/task_log_page.dart';
|
||||
import 'package:qinglong_app/module/task/add_task_page.dart';
|
||||
import 'package:qinglong_app/module/task/task_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_detail/task_detail_page.dart';
|
||||
|
||||
class Routes {
|
||||
static const String routeHomePage = "/home/homepage";
|
||||
static const String routeLogin = "/login";
|
||||
static const String routeAddTask = "/task/add";
|
||||
static const String routeTaskDetail = "/task/detail";
|
||||
static const String routeAddDependency = "/task/dependency";
|
||||
static const String routeAddEnv = "/env/add";
|
||||
static const String routeConfigEdit = "/config/edit";
|
||||
@@ -45,7 +47,7 @@ class Routes {
|
||||
return CupertinoPageRoute(builder: (context) => const AddTaskPage());
|
||||
}
|
||||
case routeAddDependency:
|
||||
return CupertinoPageRoute(builder: (context) => const AddDependenyPage());
|
||||
return CupertinoPageRoute(builder: (context) => const AddDependenyPage());
|
||||
case routeAddEnv:
|
||||
if (settings.arguments != null) {
|
||||
return CupertinoPageRoute(
|
||||
@@ -91,6 +93,12 @@ class Routes {
|
||||
path: (settings.arguments as Map)["path"],
|
||||
),
|
||||
);
|
||||
case routeTaskDetail:
|
||||
return CupertinoPageRoute(
|
||||
builder: (context) => TaskDetailPage(
|
||||
settings.arguments as TaskBean,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
1216
lib/base/ui/ql_context_menu.dart
Normal file
1216
lib/base/ui/ql_context_menu.dart
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user