mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
fix bug
This commit is contained in:
@@ -87,7 +87,7 @@ class Api {
|
||||
|
||||
static Future<HttpResponse<NullResponse>> stopTasks(List<String> crons) async {
|
||||
return await Http.put<NullResponse>(
|
||||
Url.runTasks,
|
||||
Url.stopTasks,
|
||||
crons,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
),
|
||||
FlipCard(
|
||||
key: cardKey,
|
||||
flipOnTouch: false,
|
||||
onFlipDone: (back) {
|
||||
useSecretLogin = back;
|
||||
setState(() {});
|
||||
@@ -298,13 +299,13 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
loginByUserName() ? "client_id登录" : "用户名密码登录",
|
||||
loginByUserName() ? "client_id登录" : "账号登录",
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -48,6 +48,7 @@ class TaskViewModel extends BaseViewModel {
|
||||
HttpResponse<NullResponse> 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<NullResponse> result = await Api.stopTasks([cron]);
|
||||
if (result.success) {
|
||||
list.firstWhere((element) => element.sId == cron).status = 1;
|
||||
sortList();
|
||||
notifyListeners();
|
||||
} else {
|
||||
failToast(result.message, notify: true);
|
||||
|
||||
Reference in New Issue
Block a user