Merge branch 'master' into soft-reset

pull/269/head
Inex Code 2023-08-14 05:34:18 +03:00
commit 6e241ff4d2
29 changed files with 78 additions and 50 deletions

View File

@ -60,7 +60,7 @@
"title": "Tətbiq parametrləri",
"dark_theme_title": "Qaranlıq mövzu",
"reset_config_title": "Tətbiq Sıfırlayın",
"reset_config_description": "API və Super İstifadəçi Açarlarını sıfırlayın",
"reset_config_description": "API və Super İstifadəçi Açarlarını sıfırlayın.",
"delete_server_title": "Serveri silin",
"dark_theme_description": "Rəng mövzusunu dəyişdirin",
"delete_server_description": "Əməliyyat serveri siləcək. Bundan sonra o, əlçatmaz olacaq.",

View File

@ -259,7 +259,7 @@
"privacy_policy": "Палітыка прыватнасці"
},
"application_settings": {
"reset_config_description": "Скінуць API ключы i суперкарыстальніка",
"reset_config_description": "Скінуць API ключы i суперкарыстальніка.",
"delete_server_description": "Дзеянне прывядзе да выдалення сервера. Пасля гэтага ён будзе недаступны.",
"title": "Налады праграмы",
"dark_theme_title": "Цёмная тэма",

View File

@ -60,7 +60,7 @@
"title": "Nastavení aplikace",
"dark_theme_title": "Tmavé téma",
"reset_config_title": "Obnovení konfigurace aplikace",
"reset_config_description": "Obnovení klíčů api a uživatele root",
"reset_config_description": "Obnovení klíčů API a uživatele root.",
"delete_server_title": "Odstranit server",
"dark_theme_description": "Přepnutí tématu aplikace",
"delete_server_description": "Tím odstraníte svůj server. Nebude již přístupný.",

View File

@ -64,7 +64,7 @@
"dark_theme_title": "Dunkles Thema",
"dark_theme_description": "Ihr Anwendungsdesign wechseln",
"reset_config_title": "Anwendungseinstellungen zurücksetzen",
"reset_config_description": "API Sclüssel und root Benutzer zurücksetzen",
"reset_config_description": "API Sclüssel und root Benutzer zurücksetzen.",
"delete_server_title": "Server löschen",
"delete_server_description": "Das wird Ihren Server löschen. Es wird nicht mehr zugänglich sein.",
"system_dark_theme_title": "Standard-Systemthema",

View File

@ -68,7 +68,7 @@
"dark_theme_description": "Switch your application theme",
"dangerous_settings": "Dangerous settings",
"reset_config_title": "Reset application config",
"reset_config_description": "Reset api keys and root user",
"reset_config_description": "Resets API keys and root user.",
"delete_server_title": "Delete server",
"delete_server_description": "This removes your server. It will be no longer accessible."
},

View File

@ -38,7 +38,7 @@
"application_settings": {
"reset_config_title": "Restablecer la configuración de la aplicación",
"dark_theme_description": "Cambia el tema de tu aplicación",
"reset_config_description": "Restablecer claves api y usuario root",
"reset_config_description": "Restablecer claves API y usuario root.",
"delete_server_title": "Eliminar servidor",
"delete_server_description": "Esto elimina su servidor. Ya no será accesible.",
"title": "Ajustes de la aplicación",
@ -89,4 +89,4 @@
"about_us_page": {
"title": "Sobre nosotros"
}
}
}

View File

@ -64,7 +64,7 @@
"delete_server_title": "Supprimer le serveur",
"delete_server_description": "Cela va supprimer votre serveur. Celui-ci ne sera plus accessible.",
"dark_theme_title": "Thème sombre",
"reset_config_description": "Réinitialiser les clés API et l'utilisateur root"
"reset_config_description": "Réinitialiser les clés API et l'utilisateur root."
},
"ssh": {
"title": "Clés SSH",

View File

@ -66,7 +66,7 @@
"dark_theme_description": "Lietojumprogrammas dizaina pārslēgšana",
"dangerous_settings": "Bīstamie iestatījumi",
"reset_config_title": "Atiestatīt lietojumprogrammas konfigurāciju",
"reset_config_description": "Atiestatīt API atslēgas un saknes lietotāju",
"reset_config_description": "Atiestatīt API atslēgas un saknes lietotāju.",
"delete_server_title": "Izdzēst serveri",
"delete_server_description": "Šis izdzēš jūsu serveri. Tas vairs nebūs pieejams."
},
@ -215,4 +215,4 @@
"not_ready_card": {
"in_menu": "Serveris vēl nav iestatīts. Lūdzu, pabeidziet iestatīšanu, izmantojot iestatīšanas vedni, lai turpinātu darbu."
}
}
}

View File

@ -64,7 +64,7 @@
"dark_theme_title": "Ciemny motyw aplikacji",
"dark_theme_description": "Zmień kolor motywu aplikacji",
"reset_config_title": "Resetowanie",
"reset_config_description": "Zresetuj klucze API i użytkownika root",
"reset_config_description": "Zresetuj klucze API i użytkownika root.",
"delete_server_title": "Usuń serwer",
"delete_server_description": "Ta czynność usunie serwer. Po tym będzie niedostępny.",
"system_dark_theme_description": "Użyj jasnego lub ciemnego motywu w zależności od ustawień systemu",

View File

@ -65,7 +65,7 @@
"dark_theme_title": "Тёмная тема",
"dark_theme_description": "Сменить цветовую тему",
"reset_config_title": "Сброс настроек",
"reset_config_description": "Сбросить API ключи, а также root пользователя",
"reset_config_description": "Сбросить API ключи и root пользователя.",
"delete_server_title": "Удалить сервер",
"delete_server_description": "Действие приведёт к удалению сервера. После этого он будет недоступен.",
"system_dark_theme_title": "Системная тема по-умолчанию",

View File

@ -114,7 +114,7 @@
"dark_theme_title": "Temná téma",
"dark_theme_description": "Zmeniť tému aplikácie",
"reset_config_title": "Resetovať nastavenia aplikácie",
"reset_config_description": "Resetovať kľúče API a užívateľa root",
"reset_config_description": "Resetovať kľúče API a užívateľa root.",
"delete_server_title": "Zmazať server",
"delete_server_description": "Tým sa odstráni váš server. Už nebude prístupným.",
"system_dark_theme_description": "Použitie svetlej alebo tmavej témy v závislosti od nastavení systému",

View File

@ -67,7 +67,6 @@
"dark_theme_description": "Spreminjanje barvne teme",
"dangerous_settings": "Nevarne nastavitve",
"reset_config_title": "Ponastavitev konfiguracije aplikacije",
"reset_config_description": "Сбросить API ключи, а также root пользователя",
"delete_server_title": "Brisanje strežnika",
"delete_server_description": "To dejanje povzroči izbris strežnika. Nato bo nedosegljiv."
},
@ -254,4 +253,4 @@
"title": "VPN Strežnik",
"subtitle": "Zasebni strežnik VPN"
}
}
}

View File

@ -59,7 +59,7 @@
"title": "การตั้งค่าแอปพลิเคชัน",
"dark_theme_title": "ธีมมืด",
"reset_config_title": "รีเซ็ตค่าดั้งเดิมการตั้งค่าของแอปพลิเคชั่น",
"reset_config_description": "รีเซ็ต api key และผู้ใช้งาน root",
"reset_config_description": "รีเซ็ต API key และผู้ใช้งาน root",
"delete_server_title": "ลบเซิฟเวอร์"
},
"ssh": {

View File

@ -41,7 +41,7 @@
"reset_config_title": "Скинути налаштування",
"dark_theme_title": "Темна тема",
"dark_theme_description": "Змінити тему додатка",
"reset_config_description": "Скинути API ключі та root користувача",
"reset_config_description": "Скинути API ключі та root користувача.",
"delete_server_title": "Видалити сервер",
"delete_server_description": "Це видалить ваш сервер. Він більше не буде доступний."
},

View File

@ -21,7 +21,7 @@ class SshFormCubit extends FormCubit {
ValidationModel(
(final String newKey) =>
user.sshKeys.any((final String key) => key == newKey),
'validations.already_exists'.tr(),
'validations.already_exist'.tr(),
),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>(

View File

@ -55,6 +55,20 @@ class _ServicesMigrationPageState extends State<ServicesMigrationPage> {
});
}
bool get isVolumePicked {
bool isChangeFound = false;
for (final Service service in widget.services) {
for (final String serviceId in serviceToDisk.keys) {
if (serviceId == service.id &&
serviceToDisk[serviceId] != service.storageUsage.volume!) {
isChangeFound = true;
}
}
}
return isChangeFound;
}
/// Check the services and if a service is moved (in a serviceToDisk entry)
/// subtract the used storage from the old volume and add it to the new volume.
/// The old volume is the volume the service is currently on, shown in services list.
@ -157,40 +171,41 @@ class _ServicesMigrationPageState extends State<ServicesMigrationPage> {
),
),
const SizedBox(height: 16),
BrandButton.filled(
child: Text('storage.start_migration_button'.tr()),
onPressed: () {
if (widget.isMigration) {
context.read<ServerJobsCubit>().migrateToBinds(
serviceToDisk,
);
} else {
for (final service in widget.services) {
if (serviceToDisk[service.id] != null) {
context.read<ServicesCubit>().moveService(
service.id,
serviceToDisk[service.id]!,
);
if (widget.isMigration || (!widget.isMigration && isVolumePicked))
BrandButton.filled(
child: Text('storage.start_migration_button'.tr()),
onPressed: () {
if (widget.isMigration) {
context.read<ServerJobsCubit>().migrateToBinds(
serviceToDisk,
);
} else {
for (final service in widget.services) {
if (serviceToDisk[service.id] != null) {
context.read<ServicesCubit>().moveService(
service.id,
serviceToDisk[service.id]!,
);
}
}
}
}
context.router.popUntilRoot();
showModalBottomSheet(
context: context,
useRootNavigator: true,
isScrollControlled: true,
builder: (final BuildContext context) =>
DraggableScrollableSheet(
expand: false,
maxChildSize: 0.9,
minChildSize: 0.4,
initialChildSize: 0.6,
builder: (final context, final scrollController) =>
JobsContent(controller: scrollController),
),
);
},
),
context.router.popUntilRoot();
showModalBottomSheet(
context: context,
useRootNavigator: true,
isScrollControlled: true,
builder: (final BuildContext context) =>
DraggableScrollableSheet(
expand: false,
maxChildSize: 0.9,
minChildSize: 0.4,
initialChildSize: 0.6,
builder: (final context, final scrollController) =>
JobsContent(controller: scrollController),
),
);
},
),
const SizedBox(height: 32),
],
),

View File

@ -109,6 +109,7 @@ class ProviderInputDataPage extends StatelessWidget {
),
const SizedBox(height: 32),
CubitFormTextField(
autofocus: true,
formFieldCubit: providerCubit.apiKey,
textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70),

View File

@ -273,6 +273,7 @@ class InitializingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<BackblazeFormCubit>().keyId,
textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70),
@ -448,6 +449,7 @@ class InitializingPage extends StatelessWidget {
),
const SizedBox(height: 32),
CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<RootUserFormCubit>().userName,
textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70),

View File

@ -116,6 +116,7 @@ class ProviderInputDataPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit: providerCubit.apiKey,
textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70),

View File

@ -65,6 +65,7 @@ class RecoverByNewDeviceKeyInput extends StatelessWidget {
ignoreBreakpoints: true,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit:
context.read<RecoveryDeviceFormCubit>().tokenField,
decoration: InputDecoration(

View File

@ -76,6 +76,7 @@ class RecoverByOldToken extends StatelessWidget {
ignoreBreakpoints: true,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit:
context.read<RecoveryDeviceFormCubit>().tokenField,
decoration: InputDecoration(

View File

@ -36,6 +36,7 @@ class RecoverByRecoveryKey extends StatelessWidget {
context.read<ServerInstallationCubit>().revertRecoveryStep,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit:
context.read<RecoveryDeviceFormCubit>().tokenField,
decoration: InputDecoration(

View File

@ -36,6 +36,7 @@ class RecoveryConfirmBackblaze extends StatelessWidget {
hasFlashButton: false,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<BackblazeFormCubit>().keyId,
decoration: const InputDecoration(
border: OutlineInputBorder(),

View File

@ -39,6 +39,7 @@ class RecoveryConfirmDns extends StatelessWidget {
context.read<ServerInstallationCubit>().revertRecoveryStep,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<DnsProviderFormCubit>().apiKey,
decoration: InputDecoration(
border: const OutlineInputBorder(),

View File

@ -121,6 +121,7 @@ class SelectDomainToRecover extends StatelessWidget {
},
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit:
context.read<RecoveryDomainFormCubit>().serverDomainField,
decoration: InputDecoration(

View File

@ -38,6 +38,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
},
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<ServerProviderFormCubit>().apiKey,
decoration: InputDecoration(
border: const OutlineInputBorder(),

View File

@ -55,6 +55,7 @@ class NewUserPage extends StatelessWidget {
const SizedBox(width: 14),
IntrinsicHeight(
child: CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<UserFormCubit>().login,
decoration: InputDecoration(
labelText: 'users.login'.tr(),

View File

@ -41,6 +41,7 @@ class ResetPassword extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
CubitFormTextField(
autofocus: true,
formFieldCubit:
context.read<UserFormCubit>().password,
decoration: InputDecoration(

View File

@ -296,6 +296,7 @@ class NewSshKey extends StatelessWidget {
children: [
IntrinsicHeight(
child: CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<SshFormCubit>().key,
decoration: InputDecoration(
labelText: 'ssh.input_label'.tr(),