From 6ea2c3356c3e4d8ce49ea39699cbd0b33a501398 Mon Sep 17 00:00:00 2001 From: sindhu Date: Thu, 13 Mar 2025 09:54:21 +0700 Subject: [PATCH] step 16 : percantik dropdown jenis --- v1/js/settings.js | 121 +++++++++++++++++++++++++++++++++ v1/settings.html | 167 ++++++++++++++++------------------------------ 2 files changed, 179 insertions(+), 109 deletions(-) create mode 100644 v1/js/settings.js diff --git a/v1/js/settings.js b/v1/js/settings.js new file mode 100644 index 0000000..a7287c3 --- /dev/null +++ b/v1/js/settings.js @@ -0,0 +1,121 @@ +document.addEventListener('alpine:init', () => { + Alpine.data('settingsPage', () => ({ + // 1. Inisialisasi Start + showDialogAdd: false, + objAddForm: { + // idJenis 1 + port: '', + idInterface: -1, + namaInterface: '', + idInstrument: -1, + namaInstrument: '', + }, + dataSetting: [ + { + idSetting: 1, + idJenis: 1, + namaJenis: 'TCP Server', + info: 'Port 5001', + port: '5001', + idInterface: 1, + namaInterface: 'XN550', + idInstrument: 1, + namaInstrument: 'Hema 01', + }, + { + idSetting: 2, + idJenis: 2, + namaJenis: 'TCP Client', + info: 'Server 192.168.0.1, Port 4000', + port: 'Server 192.168.0.1, Port 4000', + idInterface: 2, + namaInterface: 'Axsym', + idInstrument: 2, + namaInstrument: 'Axsym', + }, + { + idSetting: 3, + idJenis: 3, + namaJenis: 'RS232', + info: 'ttyS01, 9600, N, 8, 1', + port: 'ttyS01, 9600, N, 8, 1', + idInterface: 3, + namaInterface: 'C311', + idInstrument: 3, + namaInstrument: 'Cobas C311', + }, + ], + selectedJenis: { + idJenis: -1, + namaJenis: 'Jenis' + }, + openJenis: false, + dataJenis: [ + { + idJenis: 1, + namaJenis: 'TCP Server', + }, + { + idJenis: 2, + namaJenis: 'TCP Client', + }, + { + idJenis: 3, + namaJenis: 'RS232', + }, + ], + selectedInterface: { + idInterface: -1, + namaInterface: 'Interface' + }, + openInterface: false, + dataInterface: [ + { + idInterface: 1, + namaInterface: 'XN550', + }, + { + idInterface: 2, + namaInterface: 'Axsym', + }, + { + idInterface: 3, + namaInterface: 'C311', + }, + ], + selectedInstrument: { + idInstrument: -1, + namaInstrument: 'Instrument' + }, + openInstrument: false, + dataInstrument: [ + { + idInstrument: 1, + namaInstrument: 'Hema 01', + }, + { + idInstrument: 2, + namaInstrument: 'Axsym', + }, + { + idInstrument: 3, + namaInstrument: 'Cobas C311', + }, + ], + // 1. Inisialisasi End + // 2. Fungsi Start + onChangeJenis(item) { + this.openJenis = false; + this.selectedJenis = item; + // clear form + this.objAddForm = { + port: '', + idInterface: -1, + namaInterface: '', + idInstrument: -1, + namaInstrument: '', + }; + }, + // 2. Fungsi End + })) +}) \ No newline at end of file diff --git a/v1/settings.html b/v1/settings.html index a13aaf7..10249c5 100644 --- a/v1/settings.html +++ b/v1/settings.html @@ -114,101 +114,7 @@ -
+