fix monitor state loading into UI for edit

axis-lock
Moe 2023-06-30 10:49:11 -07:00
parent 5d50f0d407
commit fa8804a30d
1 changed files with 2 additions and 1 deletions

View File

@ -143,13 +143,14 @@ $(document).ready(function(){
var drawMonitor = function(preloadedData){
var MonitorSettings = definitions['Monitor Settings']
var html = ''
var monitorId = preloadedData ? preloadedData.mid : ''
Object.keys(MonitorSettings.blocks).forEach(function(blockKey){
var block = MonitorSettings.blocks[blockKey]
html += drawBlock(block,preloadedData)
})
var monitorSelect = `<select class="form-select state-monitor-row-select mb-2">`
$.each(loadedMonitors,function(n,monitor){
monitorSelect += `<option value="${monitor.mid}">${monitor.name} (${monitor.mid})</option>`
monitorSelect += `<option ${monitorId === monitor.mid ? 'selected' : ''} value="${monitor.mid}">${monitor.name} (${monitor.mid})</option>`
})
monitorSelect += `</select>`
var fullHtml = `<div class="form-group state-monitor-row">