Перевёл управление доступом
This commit is contained in:
parent
40bb982c74
commit
badbf6c986
1 changed files with 30 additions and 30 deletions
|
|
@ -47,7 +47,7 @@ class GroupACLController extends GetxController {
|
||||||
|
|
||||||
final respData = resp.data;
|
final respData = resp.data;
|
||||||
if (respData == null) {
|
if (respData == null) {
|
||||||
throw Exception("No data in response");
|
throw Exception("В ответе нет данных");
|
||||||
}
|
}
|
||||||
|
|
||||||
_tables.clear();
|
_tables.clear();
|
||||||
|
|
@ -56,18 +56,18 @@ class GroupACLController extends GetxController {
|
||||||
final respData = e.response?.data;
|
final respData = e.response?.data;
|
||||||
if (respData != null) {
|
if (respData != null) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to get tables",
|
"Ошибка запроса таблиц",
|
||||||
"${respData['error']}",
|
"${respData['error']}",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to get tables",
|
"Ошибка запроса таблиц",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to get tables",
|
"Ошибка запроса таблиц",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -96,7 +96,7 @@ class GroupACLController extends GetxController {
|
||||||
|
|
||||||
final respData = resp.data;
|
final respData = resp.data;
|
||||||
if (respData == null) {
|
if (respData == null) {
|
||||||
throw Exception("No data in response");
|
throw Exception("В ответе нет данных");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (respData.isNotEmpty) {
|
if (respData.isNotEmpty) {
|
||||||
|
|
@ -111,18 +111,18 @@ class GroupACLController extends GetxController {
|
||||||
final respData = e.response?.data;
|
final respData = e.response?.data;
|
||||||
if (respData != null) {
|
if (respData != null) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to get tables access",
|
"Ошибка запроса информации доступа к таблицам",
|
||||||
"${respData['error']}",
|
"${respData['error']}",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to get tables access",
|
"Ошибка запроса информации доступа к таблицам",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to get tables access",
|
"Ошибка запроса информации доступа к таблицам",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -187,7 +187,7 @@ class GroupACLController extends GetxController {
|
||||||
|
|
||||||
final respData = resp.data;
|
final respData = resp.data;
|
||||||
if (respData == null) {
|
if (respData == null) {
|
||||||
throw Exception("No data in response");
|
throw Exception("В ответе нет данных");
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshTableAccess(table);
|
refreshTableAccess(table);
|
||||||
|
|
@ -195,18 +195,18 @@ class GroupACLController extends GetxController {
|
||||||
final respData = e.response?.data;
|
final respData = e.response?.data;
|
||||||
if (respData != null) {
|
if (respData != null) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to update tables access",
|
"Ошибка обновления информации доступа к таблицам",
|
||||||
"${respData['error']}",
|
"${respData['error']}",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to update tables access",
|
"Ошибка обновления информации доступа к таблицам",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to update tables access",
|
"Ошибка обновления информации доступа к таблицам",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +234,7 @@ class GroupACLController extends GetxController {
|
||||||
|
|
||||||
final confirm = await Get.dialog<bool>(
|
final confirm = await Get.dialog<bool>(
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
title: const Text("Allowed columns"),
|
title: const Text("Разрешённые колонки"),
|
||||||
content: Obx(
|
content: Obx(
|
||||||
() => Wrap(
|
() => Wrap(
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -244,7 +244,7 @@ class GroupACLController extends GetxController {
|
||||||
selectedColumns[column] = !selectedColumns[column]!;
|
selectedColumns[column] = !selectedColumns[column]!;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: const Text("Swap all"),
|
child: const Text("Перевернуть"),
|
||||||
),
|
),
|
||||||
...selectedColumns.entries.map((e) {
|
...selectedColumns.entries.map((e) {
|
||||||
return CheckboxListTile(
|
return CheckboxListTile(
|
||||||
|
|
@ -259,11 +259,11 @@ class GroupACLController extends GetxController {
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Get.back(result: false),
|
onPressed: () => Get.back(result: false),
|
||||||
child: const Text("Cancel"),
|
child: const Text("Отменить"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Get.back(result: true),
|
onPressed: () => Get.back(result: true),
|
||||||
child: const Text("Ok"),
|
child: const Text("Ок"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -274,12 +274,12 @@ class GroupACLController extends GetxController {
|
||||||
if (selectedColumns.values.every((e) => !e)) {
|
if (selectedColumns.values.every((e) => !e)) {
|
||||||
await Get.dialog(
|
await Get.dialog(
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
title: const Text("Error"),
|
title: const Text("Ошибка"),
|
||||||
content: const Text("At least one column must be selected"),
|
content: const Text("Необходимо выбрать хотя бы одну колонку"),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Get.back(),
|
onPressed: () => Get.back(),
|
||||||
child: const Text("Ok"),
|
child: const Text("Ок"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -306,7 +306,7 @@ class GroupACLController extends GetxController {
|
||||||
|
|
||||||
final respData = resp.data;
|
final respData = resp.data;
|
||||||
if (respData == null) {
|
if (respData == null) {
|
||||||
throw Exception("No data in response");
|
throw Exception("В ответе нет данных");
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshTableAccess(table);
|
refreshTableAccess(table);
|
||||||
|
|
@ -314,18 +314,18 @@ class GroupACLController extends GetxController {
|
||||||
final respData = e.response?.data;
|
final respData = e.response?.data;
|
||||||
if (respData != null) {
|
if (respData != null) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to update tables access",
|
"Ошибка обновления информации доступа к таблицам",
|
||||||
"${respData['error']}",
|
"${respData['error']}",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to update tables access",
|
"Ошибка обновления информации доступа к таблицам",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error trying to update tables access",
|
"Ошибка обновления информации доступа к таблицам",
|
||||||
"$e",
|
"$e",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -338,16 +338,16 @@ class GroupACLDialog extends GetView<GroupACLController> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Group ACL'),
|
title: const Text('Доступ группы'),
|
||||||
content: Obx(
|
content: Obx(
|
||||||
() => DataTable2(
|
() => DataTable2(
|
||||||
columns: const [
|
columns: const [
|
||||||
DataColumn2(label: Text('Table'), size: ColumnSize.L),
|
DataColumn2(label: Text('Таблица'), size: ColumnSize.L),
|
||||||
DataColumn2(label: Text('Read'), size: ColumnSize.S),
|
DataColumn2(label: Text('Чтение'), size: ColumnSize.S),
|
||||||
DataColumn2(label: Text('Write'), size: ColumnSize.S),
|
DataColumn2(label: Text('Запись'), size: ColumnSize.S),
|
||||||
DataColumn2(label: Text('Allowed columns'), size: ColumnSize.S),
|
DataColumn2(label: Text('Колонки'), size: ColumnSize.S),
|
||||||
],
|
],
|
||||||
empty: const Text("No tables"),
|
empty: const Text("Нет таблиц"),
|
||||||
rows: controller.access.entries.map((e) {
|
rows: controller.access.entries.map((e) {
|
||||||
final table = controller.tables.firstWhere(
|
final table = controller.tables.firstWhere(
|
||||||
(element) => element.tableId == e.key,
|
(element) => element.tableId == e.key,
|
||||||
|
|
@ -390,7 +390,7 @@ class GroupACLDialog extends GetView<GroupACLController> {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
child: const Text('Close'),
|
child: const Text("Закрыть"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue