From db2b1a9419a970cf1672bd07b62c13ef9837658a Mon Sep 17 00:00:00 2001 From: sindhu Date: Thu, 13 Mar 2025 13:54:03 +0700 Subject: [PATCH] step 21 : edit form TCP Server --- v1/js/settings.js | 58 ++++++++++- v1/settings.html | 241 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 295 insertions(+), 4 deletions(-) diff --git a/v1/js/settings.js b/v1/js/settings.js index f247d7b..a78345f 100644 --- a/v1/js/settings.js +++ b/v1/js/settings.js @@ -33,28 +33,58 @@ document.addEventListener('alpine:init', () => { namaInterface: 'XN550', idInstrument: 1, namaInstrument: 'Hema 01', + server: '', + idSerial: -1, + namaSerial: '', + speed: '', + idParity: -1, + namaParity: '', + idDataBit: -1, + namaDataBit: '', + idStopBit: -1, + namaStopBit: '' }, { idSetting: 2, idJenis: 2, namaJenis: 'TCP Client', info: 'Server 192.168.0.1, Port 4000', - port: 'Server 192.168.0.1, Port 4000', + port: '4000', idInterface: 2, namaInterface: 'Axsym', idInstrument: 2, namaInstrument: 'Axsym', + server: '192.168.0.1', + idSerial: 1, + namaSerial: 'ttyS0', + speed: '', + idParity: -1, + namaParity: '', + idDataBit: -1, + namaDataBit: '', + idStopBit: -1, + namaStopBit: '' }, { idSetting: 3, idJenis: 3, namaJenis: 'RS232', info: 'ttyS01, 9600, N, 8, 1', - port: 'ttyS01, 9600, N, 8, 1', + port: '', idInterface: 3, namaInterface: 'C311', idInstrument: 3, namaInstrument: 'Cobas C311', + server: '', + idSerial: 1, + namaSerial: 'ttyS0', + speed: '19200', + idParity: 1, + namaParity: 'None', + idDataBit: 2, + namaDataBit: '6', + idStopBit: 2, + namaStopBit: '1' }, ], selectedJenis: { @@ -196,7 +226,7 @@ document.addEventListener('alpine:init', () => { idInstrument: -1, namaInstrument: 'Instrument' } - this.selectedSerial = { + this.selectedSerial = { idSerial: -1, namaSerial: 'Serial' }, @@ -261,6 +291,28 @@ document.addEventListener('alpine:init', () => { this.openStopBit = false; this.selectedStopBit = item; }, + openModalEdit(item) { + // tcp server + this.selectedJenis = { + idJenis: item.idJenis, + namaJenis: item.namaJenis, + }, + this.port = item.port + this.selectedInterface = { + idInterface: item.idInterface, + namaInterface: item.namaInterface + } + this.selectedInstrument = { + idInstrument: item.idInstrument, + namaInstrument: item.namaInstrument + } + // tcp client + + this.showDialogEdit = !this.showDialogEdit; + }, + closeDialogEdit() { + this.showDialogEdit = !this.showDialogEdit; + } // 2. Fungsi End })) }) \ No newline at end of file diff --git a/v1/settings.html b/v1/settings.html index 56feeff..6ae2f82 100644 --- a/v1/settings.html +++ b/v1/settings.html @@ -147,7 +147,8 @@ - + @@ -598,6 +599,244 @@ + +
+
+ +
+ +
+

edit

+
+ +
+
+
+ + + +
+ + +
+
    + +
+
+ + + + + + + + + + + +
+
+ +
+
+ + +
+
+
+
+
+ +

Setting