mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
同步ios的功能
This commit is contained in:
@@ -206,7 +206,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
|
||||
taskBean.schedule = _cronController.text;
|
||||
HttpResponse<NullResponse> response = await Api.addTask(
|
||||
_nameController.text, _commandController.text, _cronController.text,
|
||||
id: taskBean.sId);
|
||||
id: taskBean.id,);
|
||||
|
||||
if (response.success) {
|
||||
(widget.taskBean?.sId == null) ? "新增成功" : "修改成功".toast();
|
||||
|
||||
@@ -11,6 +11,8 @@ class TaskBean {
|
||||
String? schedule;
|
||||
bool? saved;
|
||||
String? sId;
|
||||
int? id;
|
||||
String? _id;
|
||||
int? created;
|
||||
int? status;
|
||||
String? timestamp;
|
||||
@@ -24,20 +26,22 @@ class TaskBean {
|
||||
|
||||
TaskBean(
|
||||
{this.name,
|
||||
this.command,
|
||||
this.schedule,
|
||||
this.saved,
|
||||
this.sId,
|
||||
this.created,
|
||||
this.status,
|
||||
this.timestamp,
|
||||
this.isSystem,
|
||||
this.isDisabled,
|
||||
this.logPath,
|
||||
this.isPinned,
|
||||
this.lastExecutionTime,
|
||||
this.lastRunningTime,
|
||||
this.pid});
|
||||
this.command,
|
||||
this.schedule,
|
||||
this.saved,
|
||||
this.sId,
|
||||
this.created,
|
||||
this.status,
|
||||
this.timestamp,
|
||||
this.isSystem,
|
||||
this.isDisabled,
|
||||
this.logPath,
|
||||
this.isPinned,
|
||||
this.lastExecutionTime,
|
||||
this.lastRunningTime,
|
||||
this.pid});
|
||||
|
||||
get nId => _id;
|
||||
|
||||
TaskBean.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
@@ -45,6 +49,8 @@ class TaskBean {
|
||||
command = json['command'].toString();
|
||||
schedule = json['schedule'].toString();
|
||||
saved = json['saved'];
|
||||
id = json['id'];
|
||||
_id = json['_id'];
|
||||
sId = json.containsKey('_id') ? json['_id'].toString() : (json.containsKey('id') ? json['id'].toString() : "");
|
||||
created = int.tryParse(json['created'].toString());
|
||||
status = json['status'];
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:qinglong_app/base/base_state_widget.dart';
|
||||
import 'package:qinglong_app/base/routes.dart';
|
||||
import 'package:qinglong_app/base/single_account_page.dart';
|
||||
import 'package:qinglong_app/base/theme.dart';
|
||||
import 'package:qinglong_app/module/task/intime_log/intime_log_page.dart';
|
||||
import 'package:qinglong_app/module/task/task_bean.dart';
|
||||
|
||||
Reference in New Issue
Block a user