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 {
|
static Future<HttpResponse<NullResponse>> stopTasks(List<String> crons) async {
|
||||||
return await Http.put<NullResponse>(
|
return await Http.put<NullResponse>(
|
||||||
Url.runTasks,
|
Url.stopTasks,
|
||||||
crons,
|
crons,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
|||||||
),
|
),
|
||||||
FlipCard(
|
FlipCard(
|
||||||
key: cardKey,
|
key: cardKey,
|
||||||
|
flipOnTouch: false,
|
||||||
onFlipDone: (back) {
|
onFlipDone: (back) {
|
||||||
useSecretLogin = back;
|
useSecretLogin = back;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
@@ -298,13 +299,13 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
loginByUserName() ? "client_id登录" : "用户名密码登录",
|
loginByUserName() ? "client_id登录" : "账号登录",
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -178,7 +178,11 @@ class TaskItemCell extends StatelessWidget {
|
|||||||
trailingIcon: bean.status! == 1 ? CupertinoIcons.memories : CupertinoIcons.stop_circle,
|
trailingIcon: bean.status! == 1 ? CupertinoIcons.memories : CupertinoIcons.stop_circle,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
startCron(context, ref);
|
if (bean.status! == 1) {
|
||||||
|
startCron(context, ref);
|
||||||
|
} else {
|
||||||
|
stopCron(context, ref);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
QLCupertinoContextMenuAction(
|
QLCupertinoContextMenuAction(
|
||||||
@@ -236,8 +240,8 @@ class TaskItemCell extends StatelessWidget {
|
|||||||
top: 5,
|
top: 5,
|
||||||
bottom: isDark ? 5 : 20,
|
bottom: isDark ? 5 : 20,
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: SizedBox(
|
||||||
borderRadius: BorderRadius.circular(15),
|
height: 200,
|
||||||
child: TaskDetailPage(
|
child: TaskDetailPage(
|
||||||
bean,
|
bean,
|
||||||
hideAppbar: true,
|
hideAppbar: true,
|
||||||
@@ -266,33 +270,40 @@ class TaskItemCell extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Row(
|
||||||
color: Colors.transparent,
|
mainAxisSize: MainAxisSize.max,
|
||||||
child: Text(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
bean.name ?? "",
|
children: [
|
||||||
maxLines: 1,
|
bean.status == 1
|
||||||
overflow: TextOverflow.ellipsis,
|
? const SizedBox.shrink()
|
||||||
style: TextStyle(
|
: const SizedBox(
|
||||||
overflow: TextOverflow.ellipsis,
|
width: 15,
|
||||||
color: ref.watch(themeProvider).themeColor.titleColor(),
|
height: 15,
|
||||||
fontSize: 18,
|
child: CircularProgressIndicator(
|
||||||
|
strokeWidth: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 5,
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
),
|
child: Material(
|
||||||
),
|
color: Colors.transparent,
|
||||||
const SizedBox(
|
child: Text(
|
||||||
width: 5,
|
bean.name ?? "",
|
||||||
),
|
maxLines: 1,
|
||||||
bean.status == 1
|
overflow: TextOverflow.ellipsis,
|
||||||
? const SizedBox.shrink()
|
style: TextStyle(
|
||||||
: const SizedBox(
|
overflow: TextOverflow.ellipsis,
|
||||||
width: 15,
|
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||||
height: 15,
|
fontSize: 18,
|
||||||
child: CircularProgressIndicator(
|
),
|
||||||
strokeWidth: 2,
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> result = await Api.startTasks([cron]);
|
HttpResponse<NullResponse> result = await Api.startTasks([cron]);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
list.firstWhere((element) => element.sId == cron).status = 0;
|
list.firstWhere((element) => element.sId == cron).status = 0;
|
||||||
|
sortList();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
} else {
|
} else {
|
||||||
failToast(result.message, notify: true);
|
failToast(result.message, notify: true);
|
||||||
@@ -58,6 +59,7 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> result = await Api.stopTasks([cron]);
|
HttpResponse<NullResponse> result = await Api.stopTasks([cron]);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
list.firstWhere((element) => element.sId == cron).status = 1;
|
list.firstWhere((element) => element.sId == cron).status = 1;
|
||||||
|
sortList();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
} else {
|
} else {
|
||||||
failToast(result.message, notify: true);
|
failToast(result.message, notify: true);
|
||||||
|
|||||||
Reference in New Issue
Block a user