Выпуск WDTT Plus v5

This commit is contained in:
Ivan4537 committed 2026-07-05 12:55:37 +03:00
1 parent 87e9892cab
commit ce393e151a
8 files changed
+1785 -89

No files matched your search

@@ -653,6 +653,7 @@ fun MainScreen(
val permissionOnboardingComplete by settingsStore.permissionOnboardingComplete.collectAsStateWithLifecycle(initialValue = false)
val migrationNoticeV2Shown by settingsStore.migrationNoticeV2Shown.collectAsStateWithLifecycle(initialValue = true)
val migrationNoticeV3Shown by settingsStore.migrationNoticeV3Shown.collectAsStateWithLifecycle(initialValue = true)
val migrationNoticeV5Shown by settingsStore.migrationNoticeV5Shown.collectAsStateWithLifecycle(initialValue = true)
val isAdminInterface = interfaceRole == "admin"
val isUpdatedInstall = remember(context) {
runCatching {
@@ -1041,6 +1042,38 @@ fun MainScreen(
)
}
if (
BuildConfig.VERSION_CODE == 5 &&
isAdminInterface &&
isUpdatedInstall &&
!migrationNoticeV5Shown
) {
AlertDialog(
onDismissRequest = {},
properties = DialogProperties(
dismissOnBackPress = false,
dismissOnClickOutside = false
),
title = { Text("Обновите серверную часть") },
text = {
Text(
"Чтобы управление выходным IP, бесплатным WARP и новыми проверками корректно работало в приложении и Telegram-боте, выполните установку сервера во вкладке «Деплой».\n\n" +
"Выберите установку с сохранением данных. Клиенты, доступы и настройки сохранятся.\n\n" +
"Установку с нуля выполнять не нужно."
)
},
confirmButton = {
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
Button(
onClick = { scope.launch { settingsStore.saveMigrationNoticeV5Shown() } }
) {
Text("Хорошо")
}
}
}
)
}
if (showTransferCenter) {
TransferCenterDialog(
settingsStore = settingsStore,
@@ -313,6 +313,7 @@ class SettingsStore(context: Context) {
private val UPDATE_DIALOG_LAST_ACTION_AT = longPreferencesKey("update_dialog_last_action_at")
private val MIGRATION_NOTICE_V2_SHOWN = booleanPreferencesKey("migration_notice_v2_shown")
private val MIGRATION_NOTICE_V3_SHOWN = booleanPreferencesKey("migration_notice_v3_shown")
private val MIGRATION_NOTICE_V5_SHOWN = booleanPreferencesKey("migration_notice_v5_shown")
private val DEPLOY_CLIENTS_SECTION_EXPANDED = booleanPreferencesKey("deploy_clients_section_expanded")
private val DEPLOY_OUTBOUND_SECTION_EXPANDED = booleanPreferencesKey("deploy_outbound_section_expanded")
private val DEPLOY_MIGRATION_SECTION_EXPANDED = booleanPreferencesKey("deploy_migration_section_expanded")
@@ -537,6 +538,7 @@ class SettingsStore(context: Context) {
val updateDialogLastActionAt: Flow<Long> = dataStore.data.map { it[UPDATE_DIALOG_LAST_ACTION_AT] ?: 0L }
val migrationNoticeV2Shown: Flow<Boolean> = dataStore.data.map { it[MIGRATION_NOTICE_V2_SHOWN] ?: false }
val migrationNoticeV3Shown: Flow<Boolean> = dataStore.data.map { it[MIGRATION_NOTICE_V3_SHOWN] ?: false }
val migrationNoticeV5Shown: Flow<Boolean> = dataStore.data.map { it[MIGRATION_NOTICE_V5_SHOWN] ?: false }
val deployClientsSectionExpanded: Flow<Boolean> = dataStore.data.map { it[DEPLOY_CLIENTS_SECTION_EXPANDED] ?: true }
val deployOutboundSectionExpanded: Flow<Boolean> = dataStore.data.map { it[DEPLOY_OUTBOUND_SECTION_EXPANDED] ?: false }
val deployMigrationSectionExpanded: Flow<Boolean> = dataStore.data.map { it[DEPLOY_MIGRATION_SECTION_EXPANDED] ?: false }
@@ -649,6 +651,12 @@ class SettingsStore(context: Context) {
}
}
suspend fun saveMigrationNoticeV5Shown() {
dataStore.edit { prefs ->
prefs[MIGRATION_NOTICE_V5_SHOWN] = true
}
}
suspend fun saveDeployClientsSectionExpanded(expanded: Boolean) {
dataStore.edit { prefs ->
prefs[DEPLOY_CLIENTS_SECTION_EXPANDED] = expanded
File diff suppressed because it is too large. Load diff