diff --git a/lib/base/http/api.dart b/lib/base/http/api.dart index 577da93..903faac 100644 --- a/lib/base/http/api.dart +++ b/lib/base/http/api.dart @@ -87,7 +87,7 @@ class Api { static Future> stopTasks(List crons) async { return await Http.put( - Url.runTasks, + Url.stopTasks, crons, ); } diff --git a/lib/module/login/login_page.dart b/lib/module/login/login_page.dart index a8b9cfc..b9c12bf 100644 --- a/lib/module/login/login_page.dart +++ b/lib/module/login/login_page.dart @@ -149,6 +149,7 @@ class _LoginPageState extends ConsumerState { ), FlipCard( key: cardKey, + flipOnTouch: false, onFlipDone: (back) { useSecretLogin = back; setState(() {}); @@ -298,13 +299,13 @@ class _LoginPageState extends ConsumerState { }); }, child: Text( - loginByUserName() ? "client_id登录" : "用户名密码登录", + loginByUserName() ? "client_id登录" : "账号登录", style: const TextStyle( fontSize: 14, ), ), ), - SizedBox( + const SizedBox( width: 10, ), ], diff --git a/lib/module/task/task_page.dart b/lib/module/task/task_page.dart index 98c0559..5142303 100644 --- a/lib/module/task/task_page.dart +++ b/lib/module/task/task_page.dart @@ -178,7 +178,11 @@ class TaskItemCell extends StatelessWidget { trailingIcon: bean.status! == 1 ? CupertinoIcons.memories : CupertinoIcons.stop_circle, onPressed: () { Navigator.of(context).pop(); - startCron(context, ref); + if (bean.status! == 1) { + startCron(context, ref); + } else { + stopCron(context, ref); + } }, ), QLCupertinoContextMenuAction( @@ -236,8 +240,8 @@ class TaskItemCell extends StatelessWidget { top: 5, bottom: isDark ? 5 : 20, ), - child: ClipRRect( - borderRadius: BorderRadius.circular(15), + child: SizedBox( + height: 200, child: TaskDetailPage( bean, hideAppbar: true, @@ -266,33 +270,40 @@ class TaskItemCell extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( - child: Material( - color: Colors.transparent, - child: Text( - bean.name ?? "", - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - overflow: TextOverflow.ellipsis, - color: ref.watch(themeProvider).themeColor.titleColor(), - fontSize: 18, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + bean.status == 1 + ? const SizedBox.shrink() + : const SizedBox( + width: 15, + height: 15, + child: CircularProgressIndicator( + strokeWidth: 2, + ), + ), + const SizedBox( + width: 5, ), - ), - ), - ), - const SizedBox( - width: 5, - ), - bean.status == 1 - ? const SizedBox.shrink() - : const SizedBox( - width: 15, - height: 15, - child: CircularProgressIndicator( - strokeWidth: 2, + Expanded( + child: Material( + color: Colors.transparent, + child: Text( + bean.name ?? "", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + overflow: TextOverflow.ellipsis, + color: ref.watch(themeProvider).themeColor.titleColor(), + fontSize: 18, + ), + ), ), ), - const Spacer(), + ], + ), + ), Material( color: Colors.transparent, child: Text( diff --git a/lib/module/task/task_viewmodel.dart b/lib/module/task/task_viewmodel.dart index 22104fb..261e1c0 100644 --- a/lib/module/task/task_viewmodel.dart +++ b/lib/module/task/task_viewmodel.dart @@ -48,6 +48,7 @@ class TaskViewModel extends BaseViewModel { HttpResponse result = await Api.startTasks([cron]); if (result.success) { list.firstWhere((element) => element.sId == cron).status = 0; + sortList(); notifyListeners(); } else { failToast(result.message, notify: true); @@ -58,6 +59,7 @@ class TaskViewModel extends BaseViewModel { HttpResponse result = await Api.stopTasks([cron]); if (result.success) { list.firstWhere((element) => element.sId == cron).status = 1; + sortList(); notifyListeners(); } else { failToast(result.message, notify: true);