fix(server): автосохранение конфига и форк bin-релизов
- LaunchedEffect с дебаунсом 400 мс сохраняет proxyListen/proxyConnect при изменении полей; раньше требовалось явное действие - BASE_URL для скачивания серверного бинаря переключён на форк samosvalishe/vk-turn-proxy
This commit is contained in:
1 parent
8ea4f2a9cc
commit
629d90e0fa
2 files changed
+9
-1
No files matched your search
@@ -21,7 +21,7 @@ object ServerScripts {
|
||||
if [ -f /opt/vk-turn/proxy.pid ]; then kill -9 ${'$'}(cat /opt/vk-turn/proxy.pid) 2>/dev/null; rm -f /opt/vk-turn/proxy.pid; fi
|
||||
ARCH=${'$'}(uname -m)
|
||||
if [ "${'$'}ARCH" = "x86_64" ]; then BIN="server-linux-amd64"; else BIN="server-linux-arm64"; fi
|
||||
BASE_URL="https://github.com/cacggghp/vk-turn-proxy/releases/latest/download"
|
||||
BASE_URL="https://github.com/samosvalishe/vk-turn-proxy/releases/latest/download"
|
||||
echo "Arch: ${'$'}ARCH | Binary: ${'$'}BIN"
|
||||
_dl() { URL=${'$'}1; OUT=${'$'}2
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
|
||||
@@ -82,6 +82,14 @@ fun ServerManagementScreen(
|
||||
var proxyListenPort by rememberSaveable(savedListen) { mutableStateOf(savedListen.substringAfterLast(":", "56000")) }
|
||||
var proxyConnect by rememberSaveable(savedConnect) { mutableStateOf(savedConnect) }
|
||||
|
||||
LaunchedEffect(proxyListenPort, proxyConnect) {
|
||||
kotlinx.coroutines.delay(400)
|
||||
val listen = "0.0.0.0:$proxyListenPort"
|
||||
if (listen != savedListen || proxyConnect != savedConnect) {
|
||||
viewModel.saveProxyServerConfig(listen, proxyConnect)
|
||||
}
|
||||
}
|
||||
|
||||
val context = LocalContext.current
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
val isConnected = sshState is SshConnectionState.Connected
|
||||
|
||||
Reference in new issue
Block a user