Звонки: дольше показывать статус занято; deployServer проверяет sudo -n

This commit is contained in:
AidarKC 2026-05-02 19:05:54 +03:00
parent c0c29b74ab
commit e921b06826
3 changed files with 31 additions and 5 deletions

View File

@ -1,2 +1,2 @@
client.version=1.2.38 client.version=1.2.39
server.version=1.2.32 server.version=1.2.33

View File

@ -853,8 +853,23 @@ async function finalizeCall(call, {
call.phase = 'ended'; call.phase = 'ended';
call.statusText = 'Звонок завершён'; call.statusText = 'Звонок завершён';
if (String(localReasonCode || '') === 'busy') {
call.statusText = 'Пользователь занят';
}
notifyCallState(); notifyCallState();
const finalHoldMs = String(localReasonCode || '') === 'busy' ? 2600 : 0;
if (finalHoldMs > 0) {
window.setTimeout(() => {
calls.delete(call.callId);
if (activeCallId === call.callId) {
activeCallId = '';
}
notifyCallState();
}, finalHoldMs);
return;
}
calls.delete(call.callId); calls.delete(call.callId);
if (activeCallId === call.callId) { if (activeCallId === call.callId) {
activeCallId = ''; activeCallId = '';

View File

@ -9,16 +9,18 @@ import java.util.jar.JarFile;
public class IT_DeployRestartNoCleanNoTestsMain { public class IT_DeployRestartNoCleanNoTestsMain {
// ====== НАСТРОЙКИ (можно переопределять systemProperty) ====== // ====== НАСТРОЙКИ (можно переопределять systemProperty) ======
private static final String REMOTE_HOST = System.getProperty("it.remoteHost", "194.87.0.247"); private static final String REMOTE_HOST = System.getProperty("it.remoteHost", "shineup.me");
private static final String REMOTE_USER = System.getProperty("it.remoteUser", "user"); private static final String REMOTE_USER = System.getProperty("it.remoteUser", "player");
private static final String REMOTE_DIR = System.getProperty("it.remoteDir", "/home/user/docker/shine-server"); private static final String REMOTE_DIR = System.getProperty("it.remoteDir", "/home/player/SHiNE/shine-server");
private static final String REMOTE_JAR = REMOTE_DIR + "/shine-server.jar"; private static final String REMOTE_JAR = REMOTE_DIR + "/shine-server.jar";
private static final String SERVICE_NAME = System.getProperty("it.service", "shine-server"); private static final String SERVICE_NAME = System.getProperty("it.service", "shine-server");
private static final String LOCAL_JAR = System.getProperty("it.localJar", "build/libs/shine-server.jar"); private static final String LOCAL_JAR = System.getProperty("it.localJar", "build/libs/shine-server.jar");
public static void main(String[] args) { public static void main(String[] args) {
ensureSudoNoPasswordOrThrow();
// 1) stop service на сервере // 1) stop service на сервере
sshStrict("sudo systemctl stop " + SERVICE_NAME + " || true"); sshStrict("sudo systemctl stop " + SERVICE_NAME + " || true");
@ -40,6 +42,15 @@ public class IT_DeployRestartNoCleanNoTestsMain {
System.out.println("deploy_no_clean_no_tests_done"); System.out.println("deploy_no_clean_no_tests_done");
} }
private static void ensureSudoNoPasswordOrThrow() {
int code = ssh("sudo -n true");
if (code == 0) return;
throw new RuntimeException(
"Remote sudo requires password for " + REMOTE_USER + "@" + REMOTE_HOST
+ ". Configure NOPASSWD for service control or run deploy with privileged user."
);
}
private static void waitRemotePort7070() { private static void waitRemotePort7070() {
for (int i = 0; i < 50; i++) { for (int i = 0; i < 50; i++) {
int code = ssh("ss -ltnp | grep -q ':7070'"); int code = ssh("ss -ltnp | grep -q ':7070'");