Перевёл ассеты
This commit is contained in:
parent
7f7bbd9441
commit
8a3030addf
1 changed files with 44 additions and 43 deletions
|
|
@ -52,7 +52,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final respData = resp.data;
|
||||
if (respData == null) {
|
||||
throw Exception("No data in response");
|
||||
throw Exception("В ответе нет данных");
|
||||
}
|
||||
|
||||
_assetsList.clear();
|
||||
|
|
@ -61,18 +61,18 @@ class AssetsPagePanelController extends GetxController {
|
|||
final respData = e.response?.data;
|
||||
if (respData != null) {
|
||||
Get.snackbar(
|
||||
"Error trying to get assets",
|
||||
"Ошибка получения ресурсов",
|
||||
"${respData['error']}",
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error trying to get assets",
|
||||
"Ошибка получения ресурсов",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
Get.snackbar(
|
||||
"Error trying to get assets",
|
||||
"Ошибка получения ресурсов",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final respData = resp.data;
|
||||
if (respData == null) {
|
||||
throw Exception("No data in response");
|
||||
throw Exception("В ответе нет данных");
|
||||
}
|
||||
|
||||
_tagsList.clear();
|
||||
|
|
@ -93,18 +93,18 @@ class AssetsPagePanelController extends GetxController {
|
|||
final respData = e.response?.data;
|
||||
if (respData != null) {
|
||||
Get.snackbar(
|
||||
"Error trying to get tags",
|
||||
"Ошибка получения тегов",
|
||||
"${respData['error']}",
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error trying to get tags",
|
||||
"Ошибка получения тегов",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
Get.snackbar(
|
||||
"Error trying to get tags",
|
||||
"Ошибка получения тегов",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
|
|
@ -145,11 +145,11 @@ class AssetsPagePanelController extends GetxController {
|
|||
Get.back(result: file);
|
||||
},
|
||||
onError: (value) {
|
||||
Get.snackbar("Error", value.toString());
|
||||
Get.snackbar("Ошибка", value.toString());
|
||||
},
|
||||
);
|
||||
},
|
||||
child: const Text("Drop file here")
|
||||
child: const Text("Перенеите файл сюда")
|
||||
.paddingAll(8)
|
||||
.fittedBox()
|
||||
.constrained(height: 200, width: 200),
|
||||
|
|
@ -157,7 +157,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Get.back(result: null),
|
||||
child: const Text("Cancel"),
|
||||
child: const Text("Отменить"),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
@ -195,7 +195,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final respData = resp.data;
|
||||
if (respData == null) {
|
||||
throw Exception("No data in response");
|
||||
throw Exception("В ответе нет данных");
|
||||
}
|
||||
|
||||
refreshData();
|
||||
|
|
@ -203,18 +203,18 @@ class AssetsPagePanelController extends GetxController {
|
|||
final respData = e.response?.data;
|
||||
if (respData != null) {
|
||||
Get.snackbar(
|
||||
"Error trying to put asset",
|
||||
"Ошибка загрузки ресурса",
|
||||
"${respData['error']}",
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error trying to put asset",
|
||||
"Ошибка загрузки ресурса",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
Get.snackbar(
|
||||
"Error trying to put asset",
|
||||
"Ошибка загрузки ресурса",
|
||||
"$e",
|
||||
);
|
||||
} finally {
|
||||
|
|
@ -228,7 +228,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final confirm = await Get.dialog<bool>(
|
||||
AlertDialog(
|
||||
title: const Text("Edit asset"),
|
||||
title: const Text("Изменение ресурса"),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
|
|
@ -237,7 +237,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
controller: TextEditingController(text: description.value),
|
||||
onChanged: (value) => description.value = value,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Description",
|
||||
labelText: "Описание",
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
|
|
@ -245,7 +245,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
onChanged: (value) => tags.value =
|
||||
value.split(",").map((e) => e.trim()).toList(growable: false),
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Tags",
|
||||
labelText: "Теги",
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
|
@ -259,17 +259,17 @@ class AssetsPagePanelController extends GetxController {
|
|||
),
|
||||
ElevatedButton(
|
||||
onPressed: () => previewAsset(e),
|
||||
child: const Text("View asset")),
|
||||
child: const Text("Предпросмотр")),
|
||||
],
|
||||
).constrained(width: Get.width * 0.5, height: Get.width * 0.5),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Get.back(result: false),
|
||||
child: const Text("Cancel"),
|
||||
child: const Text("Отменить"),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get.back(result: true),
|
||||
child: const Text("Confirm"),
|
||||
child: const Text("Подтвердить"),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -287,7 +287,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final respData = resp.data;
|
||||
if (respData == null) {
|
||||
throw Exception("No data in response");
|
||||
throw Exception("В ответе нет данных");
|
||||
}
|
||||
|
||||
refreshData();
|
||||
|
|
@ -295,18 +295,18 @@ class AssetsPagePanelController extends GetxController {
|
|||
final respData = e.response?.data;
|
||||
if (respData != null) {
|
||||
Get.snackbar(
|
||||
"Error trying to edit asset",
|
||||
"Ошибка изменения ресурса",
|
||||
"${respData['error']}",
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error trying to edit asset",
|
||||
"Ошибка изменения ресурса",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
Get.snackbar(
|
||||
"Error trying to edit asset",
|
||||
"Ошибка изменения ресурса",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
|
|
@ -318,23 +318,24 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final confirm = await Get.dialog<bool>(
|
||||
AlertDialog(
|
||||
title: const Text("Remove asset"),
|
||||
title: const Text("Удаление ресурса"),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text("You are about to remove an asset."),
|
||||
const Text(
|
||||
"Вы планируете удалить ресурс. Это действие нельзя отменить."),
|
||||
Obx(
|
||||
() => CheckboxListTile(
|
||||
value: checkReferences.value,
|
||||
onChanged: (value) => checkReferences.value = value ?? false,
|
||||
title: const Text("Check references"),
|
||||
title: const Text("Проверить ссылки"),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => CheckboxListTile(
|
||||
value: deleteReferencing.value,
|
||||
onChanged: (value) => deleteReferencing.value = value ?? false,
|
||||
title: const Text("Delete referencing"),
|
||||
title: const Text("Удалить ссылающиеся сущности"),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -342,11 +343,11 @@ class AssetsPagePanelController extends GetxController {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Get.back(result: false),
|
||||
child: const Text("Cancel"),
|
||||
child: const Text("Отменить"),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get.back(result: true),
|
||||
child: const Text("Remove"),
|
||||
child: const Text("Удалить"),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -363,7 +364,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
|
||||
final respData = resp.data;
|
||||
if (respData == null) {
|
||||
throw Exception("No data in response");
|
||||
throw Exception("В ответе нет данных");
|
||||
}
|
||||
|
||||
refreshData();
|
||||
|
|
@ -371,18 +372,18 @@ class AssetsPagePanelController extends GetxController {
|
|||
final respData = e.response?.data;
|
||||
if (respData != null) {
|
||||
Get.snackbar(
|
||||
"Error trying to remove asset",
|
||||
"Ошибка удаления ресурса",
|
||||
"${respData['error']}",
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error trying to remove asset",
|
||||
"Ошибка удаления ресурса",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
Get.snackbar(
|
||||
"Error trying to remove asset",
|
||||
"Ошибка удаления ресурса",
|
||||
"$e",
|
||||
);
|
||||
}
|
||||
|
|
@ -404,7 +405,7 @@ class AssetsPagePanelController extends GetxController {
|
|||
url: "${ApiController.to.endPoint}/assets/${e.fid}",
|
||||
)
|
||||
else
|
||||
const Text("Unsupported media type")
|
||||
const Text("На данный момент этот тип не поддерживает предпросмотр")
|
||||
.fontSize(16)
|
||||
.paddingAll(8)
|
||||
.card()
|
||||
|
|
@ -439,7 +440,7 @@ class AssetsPagePanel extends GetView<AssetsPagePanelController> {
|
|||
elevation: 0,
|
||||
title: Row(
|
||||
children: [
|
||||
const Text("Tags:"),
|
||||
const Text("Теги:"),
|
||||
Obx(
|
||||
() => FastChipsInput(
|
||||
name: "FastChipsInput",
|
||||
|
|
@ -496,13 +497,13 @@ class AssetsPagePanel extends GetView<AssetsPagePanelController> {
|
|||
horizontalScrollController: controller.scrollController,
|
||||
columns: const [
|
||||
DataColumn2(label: Text(""), fixedWidth: 16),
|
||||
DataColumn2(label: Text("Filename"), size: ColumnSize.M),
|
||||
DataColumn2(label: Text("Description"), size: ColumnSize.L),
|
||||
DataColumn2(label: Text("File ID"), size: ColumnSize.M),
|
||||
DataColumn2(label: Text("Tags"), size: ColumnSize.L),
|
||||
DataColumn2(label: Text("Actions")),
|
||||
DataColumn2(label: Text("Имя файла"), size: ColumnSize.M),
|
||||
DataColumn2(label: Text("Описание"), size: ColumnSize.L),
|
||||
DataColumn2(label: Text("ID файла"), size: ColumnSize.M),
|
||||
DataColumn2(label: Text("Теги"), size: ColumnSize.L),
|
||||
DataColumn2(label: Text("Действия")),
|
||||
],
|
||||
empty: const Text("No assets found"),
|
||||
empty: const Text("Ресурсы не найдены"),
|
||||
rows: controller.assetsList
|
||||
.where((element) {
|
||||
if (controller.filterTags.isEmpty) return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue