diff --git a/stage_ui/console_core/backend/test_modbus_session_frontend_contract.py b/stage_ui/console_core/backend/test_modbus_session_frontend_contract.py index 1618c5d..7a8138f 100644 --- a/stage_ui/console_core/backend/test_modbus_session_frontend_contract.py +++ b/stage_ui/console_core/backend/test_modbus_session_frontend_contract.py @@ -38,6 +38,18 @@ class ModbusSessionFrontendContractTest(unittest.TestCase): self.assertNotIn("__modbusSetToggle('restartItscreen'", body) self.assertIn("automatically pauses production polling", body) + def test_running_itscreen_uses_the_centered_platform_confirmation(self): + ensure_session = re.search( + r"async function modbusEnsureSession\(options = \{\}\) \{(?P.*?)\n \}", + SOURCE, + re.S, + ) + self.assertIsNotNone(ensure_session) + body = ensure_session.group("body") + self.assertIn("const confirmed = await confirmAction(", body) + self.assertIn('t("Temporarily stop it-screen?")', body) + self.assertNotIn("window.confirm", body) + if __name__ == "__main__": unittest.main() diff --git a/stage_ui/console_core/frontend/console.i18n.js b/stage_ui/console_core/frontend/console.i18n.js index 0a2a448..cd7293c 100644 --- a/stage_ui/console_core/frontend/console.i18n.js +++ b/stage_ui/console_core/frontend/console.i18n.js @@ -102,7 +102,8 @@ "Restart it-screen on release": "Перезапускать it-screen после освобождения порта", "it-screen service was stopped temporarily for Modbus scanning and writing.": "Сервис it-screen был временно остановлен для сканирования и записи Modbus.", "it-screen service was restarted after the Modbus session.": "Сервис it-screen был перезапущен после Modbus-сеанса.", - "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.\n\nContinue?": "it-screen сейчас работает на этом последовательном порту. Для действия «{action}» сервис it-screen будет временно остановлен, потому что результаты сканирования и записи ненадёжны, пока it-screen активен.\n\nПродолжить?", + "Temporarily stop it-screen?": "Временно остановить it-screen?", + "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.": "it-screen сейчас работает на этом последовательном порту. Для действия «{action}» сервис it-screen будет временно остановлен, потому что результаты сканирования и записи ненадёжны, пока it-screen активен.", "{action} was cancelled because it-screen is still running.": "Действие «{action}» отменено, потому что it-screen всё ещё запущен.", "it-screen did not stop in time for {action}.": "Сервис it-screen не остановился вовремя для действия «{action}».", "Not available": "Недоступно", @@ -626,7 +627,8 @@ "Restart it-screen on release": "Uruchom ponownie it-screen po zwolnieniu portu", "it-screen service was stopped temporarily for Modbus scanning and writing.": "Usługa it-screen została tymczasowo zatrzymana na czas skanowania i zapisu Modbus.", "it-screen service was restarted after the Modbus session.": "Usługa it-screen została ponownie uruchomiona po sesji Modbus.", - "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.\n\nContinue?": "it-screen działa obecnie na tej ścieżce szeregowej. Operacja „{action}” tymczasowo zatrzyma it-screen, ponieważ wyniki skanowania i zapisu są niewiarygodne, gdy it-screen jest aktywny.\n\nKontynuować?", + "Temporarily stop it-screen?": "Tymczasowo zatrzymać it-screen?", + "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.": "it-screen działa obecnie na tej ścieżce szeregowej. Operacja „{action}” tymczasowo zatrzyma it-screen, ponieważ wyniki skanowania i zapisu są niewiarygodne, gdy it-screen jest aktywny.", "{action} was cancelled because it-screen is still running.": "Operacja „{action}” została anulowana, ponieważ it-screen nadal działa.", "it-screen did not stop in time for {action}.": "Usługa it-screen nie zatrzymała się na czas dla operacji „{action}”.", "Not available": "Niedostępne", @@ -1081,7 +1083,8 @@ "Restart it-screen on release": "أعد تشغيل it-screen بعد تحرير المنفذ", "it-screen service was stopped temporarily for Modbus scanning and writing.": "تم إيقاف خدمة it-screen مؤقتًا أثناء فحص وكتابة Modbus.", "it-screen service was restarted after the Modbus session.": "تمت إعادة تشغيل خدمة it-screen بعد جلسة Modbus.", - "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.\n\nContinue?": "خدمة it-screen تعمل حاليًا على هذا المسار التسلسلي. سيؤدي الإجراء \"{action}\" إلى إيقاف it-screen مؤقتًا لأن نتائج الفحص والكتابة تكون غير موثوقة أثناء نشاط it-screen.\n\nهل تريد المتابعة؟", + "Temporarily stop it-screen?": "هل تريد إيقاف it-screen مؤقتًا؟", + "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.": "خدمة it-screen تعمل حاليًا على هذا المسار التسلسلي. سيؤدي الإجراء \"{action}\" إلى إيقاف it-screen مؤقتًا لأن نتائج الفحص والكتابة تكون غير موثوقة أثناء نشاط it-screen.", "{action} was cancelled because it-screen is still running.": "تم إلغاء الإجراء \"{action}\" لأن خدمة it-screen ما زالت قيد التشغيل.", "it-screen did not stop in time for {action}.": "لم تتوقف خدمة it-screen في الوقت المناسب لتنفيذ الإجراء \"{action}\".", "Not available": "غير متاح", @@ -1541,7 +1544,8 @@ "Restart it-screen on release": "रिलीज़ के बाद it-screen फिर से चालू करें", "it-screen service was stopped temporarily for Modbus scanning and writing.": "Modbus स्कैनिंग और लिखने के लिए it-screen सेवा अस्थायी रूप से रोकी गई थी।", "it-screen service was restarted after the Modbus session.": "Modbus सत्र के बाद it-screen सेवा फिर से शुरू की गई।", - "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.\n\nContinue?": "इस serial path पर it-screen अभी चल रहा है। \"{action}\" के लिए it-screen को अस्थायी रूप से रोका जाएगा, क्योंकि it-screen सक्रिय रहने पर scan और write के परिणाम भरोसेमंद नहीं होते।\n\nक्या जारी रखें?", + "Temporarily stop it-screen?": "क्या it-screen को अस्थायी रूप से रोकें?", + "it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.": "इस serial path पर it-screen अभी चल रहा है। \"{action}\" के लिए it-screen को अस्थायी रूप से रोका जाएगा, क्योंकि it-screen सक्रिय रहने पर scan और write के परिणाम भरोसेमंद नहीं होते।", "{action} was cancelled because it-screen is still running.": "\"{action}\" रद्द कर दिया गया क्योंकि it-screen अभी भी चल रहा है।", "it-screen did not stop in time for {action}.": "\"{action}\" के लिए it-screen सेवा समय पर बंद नहीं हुई।", "Not available": "उपलब्ध नहीं", diff --git a/stage_ui/console_core/frontend/console.js b/stage_ui/console_core/frontend/console.js index 6d62608..fed6d4c 100644 --- a/stage_ui/console_core/frontend/console.js +++ b/stage_ui/console_core/frontend/console.js @@ -4073,7 +4073,11 @@ const currentPortInfo = modbusSelectedPortStatus() || {}; const itscreenConflict = !!(currentPortInfo.itscreen_running && String(log.port || "").endsWith("ttyS3")); if (itscreenConflict) { - const confirmed = window.confirm(t("it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.\n\nContinue?", { action: actionLabel })); + const confirmed = await confirmAction( + t("Temporarily stop it-screen?"), + t("it-screen is running on this serial path. {action} will stop it-screen temporarily because scan and write results are unreliable while it-screen is active.", { action: actionLabel }), + t("Continue") + ); if (!confirmed) { appendModbusLog(t("{action} was cancelled because it-screen is still running.", { action: actionLabel }), "warn"); return false;