step 21 : edit form TCP Server

This commit is contained in:
sindhu
2025-03-13 13:54:03 +07:00
parent ecde1a2a52
commit db2b1a9419
2 changed files with 295 additions and 4 deletions

View File

@@ -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
}))
})