mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
修改bug
This commit is contained in:
4
lib/module/env/env_viewmodel.dart
vendored
4
lib/module/env/env_viewmodel.dart
vendored
@@ -3,6 +3,7 @@ import 'package:qinglong_app/base/base_viewmodel.dart';
|
|||||||
import 'package:qinglong_app/base/http/api.dart';
|
import 'package:qinglong_app/base/http/api.dart';
|
||||||
import 'package:qinglong_app/base/http/http.dart';
|
import 'package:qinglong_app/base/http/http.dart';
|
||||||
import 'package:qinglong_app/module/env/env_bean.dart';
|
import 'package:qinglong_app/module/env/env_bean.dart';
|
||||||
|
import 'package:qinglong_app/utils/extension.dart';
|
||||||
|
|
||||||
var envProvider = ChangeNotifierProvider((ref) => EnvViewModel());
|
var envProvider = ChangeNotifierProvider((ref) => EnvViewModel());
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ class EnvViewModel extends BaseViewModel {
|
|||||||
Future<void> delEnv(String id) async {
|
Future<void> delEnv(String id) async {
|
||||||
HttpResponse<NullResponse> result = await Api.delEnv(id);
|
HttpResponse<NullResponse> result = await Api.delEnv(id);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
"删除成功".toast();
|
||||||
list.removeWhere((element) => element.sId == id);
|
list.removeWhere((element) => element.sId == id);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
} else {
|
} else {
|
||||||
@@ -53,6 +55,7 @@ class EnvViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> response = await Api.enableEnv(sId);
|
HttpResponse<NullResponse> response = await Api.enableEnv(sId);
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
"启用成功".toast();
|
||||||
list.firstWhere((element) => element.sId == sId).status = 0;
|
list.firstWhere((element) => element.sId == sId).status = 0;
|
||||||
success();
|
success();
|
||||||
} else {
|
} else {
|
||||||
@@ -62,6 +65,7 @@ class EnvViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> response = await Api.disableEnv(sId);
|
HttpResponse<NullResponse> response = await Api.disableEnv(sId);
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
"禁用成功".toast();
|
||||||
list.firstWhere((element) => element.sId == sId).status = 1;
|
list.firstWhere((element) => element.sId == sId).status = 1;
|
||||||
success();
|
success();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -314,7 +314,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
Padding(
|
Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40,),
|
padding: const EdgeInsets.symmetric(horizontal: 40,),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width - 80,
|
width: MediaQuery.of(context).size.width - 80,
|
||||||
@@ -324,7 +325,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
|||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 5,
|
vertical: 5,
|
||||||
),
|
),
|
||||||
color: canClickLoginBtn() ? ref.watch(themeProvider).themeColor.buttonBgColor() : Theme.of(context).primaryColor.withOpacity(0.4),
|
color: canClickLoginBtn() ? primaryColor : primaryColor.withOpacity(0.4),
|
||||||
child: isLoading
|
child: isLoading
|
||||||
? const CupertinoActivityIndicator()
|
? const CupertinoActivityIndicator()
|
||||||
: const Text(
|
: const Text(
|
||||||
|
|||||||
@@ -152,9 +152,12 @@ class _TaskDetailPageState extends ConsumerState<TaskDetailPage> {
|
|||||||
[
|
[
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () async{
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
startCron(context, ref);
|
await startCron(context, ref);
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -177,6 +180,7 @@ class _TaskDetailPageState extends ConsumerState<TaskDetailPage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
showLog();
|
showLog();
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> response = await Api.unpinTask(sId);
|
HttpResponse<NullResponse> response = await Api.unpinTask(sId);
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
"取消置顶成功".toast();
|
||||||
|
list.firstWhere((element) => element.sId == sId).isPinned = 0;
|
||||||
sortList();
|
sortList();
|
||||||
success();
|
success();
|
||||||
} else {
|
} else {
|
||||||
@@ -101,6 +103,8 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> response = await Api.pinTask(sId);
|
HttpResponse<NullResponse> response = await Api.pinTask(sId);
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
"置顶成功".toast();
|
||||||
|
list.firstWhere((element) => element.sId == sId).isPinned = 1;
|
||||||
sortList();
|
sortList();
|
||||||
success();
|
success();
|
||||||
} else {
|
} else {
|
||||||
@@ -114,6 +118,7 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> response = await Api.disableTask(sId);
|
HttpResponse<NullResponse> response = await Api.disableTask(sId);
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
"禁用成功".toast();
|
||||||
list.firstWhere((element) => element.sId == sId).isDisabled = 1;
|
list.firstWhere((element) => element.sId == sId).isDisabled = 1;
|
||||||
sortList();
|
sortList();
|
||||||
success();
|
success();
|
||||||
@@ -124,6 +129,7 @@ class TaskViewModel extends BaseViewModel {
|
|||||||
HttpResponse<NullResponse> response = await Api.enableTask(sId);
|
HttpResponse<NullResponse> response = await Api.enableTask(sId);
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
"启用成功".toast();
|
||||||
list.firstWhere((element) => element.sId == sId).isDisabled = 0;
|
list.firstWhere((element) => element.sId == sId).isDisabled = 0;
|
||||||
sortList();
|
sortList();
|
||||||
success();
|
success();
|
||||||
|
|||||||
Reference in New Issue
Block a user