diff --git a/webinstall/build.yaml b/webinstall/build.yaml index 1c49b6c..dc7d86e 100644 --- a/webinstall/build.yaml +++ b/webinstall/build.yaml @@ -127,16 +127,19 @@ types: - 2 - &serial1 - type: frame + type: checkbox label: 'Serial 1' key: serial1 - children: - - <<: *gpiopin - key: RX - target: "define:GWSERIAL_RX" - - <<: *gpiopin - key: TX - target: "define:GWSERIAL_TX" + values: + - type: frame + key: true + children: + - <<: *gpiopin + key: RX + target: "define:GWSERIAL_RX" + - <<: *gpiopin + key: TX + target: "define:GWSERIAL_TX" resources: default: &esp32default diff --git a/webinstall/cibuild.css b/webinstall/cibuild.css index 15b0946..5411a19 100644 --- a/webinstall/cibuild.css +++ b/webinstall/cibuild.css @@ -49,6 +49,8 @@ height: 1.5em; opacity: 1; z-index: unset; + appearance: auto; + float:none; } .configui .buttons { @@ -139,15 +141,18 @@ margin-top: 0.3em; } -.configui .selector.tdropdown { +.configui .tcheckbox .inputFrame, +.configui .tdropdown .inputFrame { display: flex; flex-direction: row; align-items: center; } -.configui .title.tdropdown { +.configui .title.tdropdown, +.configui .title.tcheckbox { width: 10em; font-weight: normal !important; } + .configui form#upload { width: 0; height: 0; diff --git a/webinstall/cibuild.js b/webinstall/cibuild.js index 63e4b47..10a36d3 100644 --- a/webinstall/cibuild.js +++ b/webinstall/cibuild.js @@ -296,7 +296,8 @@ class PipelineInfo{ let level=name.replace(rep,''); let frame=addEl('div','selector level'+level.length+' t'+config.type,parent); frame.setAttribute(PATH_ATTR,name); - let title=addEl('div','title t'+config.type,frame,config.label); + let inputFrame=addEl('div','inputFrame',frame); + let title=addEl('div','title t'+config.type,inputFrame,config.label); let initialConfig=undefined if (config.type === 'frame' || config.type === undefined){ initialConfig=config; @@ -306,7 +307,7 @@ class PipelineInfo{ for (let idx=0;idx 0 && config.type === 'dropdown'){ + let sel=addEl('select','t'+config.type,inputFrame); for (let idx=0;idx 0 && config.type === 'checkbox'){ + let act=undefined; + let inact=undefined; + expandedValues.forEach((ev)=>{ + if (ev.key === true || ev.key === undefined){ + act=ev; + if (act.key === undefined) act.key=true; + return; + } + inact=ev; + }); + if (act !== undefined){ + if (inact === undefined) inact={key:false}; + let cb=addEl('input','t'+config.type,inputFrame); + cb.setAttribute('type','checkbox'); + if (current) { + cb.setAttribute('checked',true); + initialConfig=act; + } + else{ + initialConfig=inact; + } + cb.addEventListener('change',(ev)=>{ + if (ev.target.checked){ + callback(act,false); + } + else + { + callback(inact,false); + } + }); + } + } let childFrame=addEl('div','childFrame',frame); if (initialConfig !== undefined){ callback(initialConfig,true,childFrame);