mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-02-11 07:03:07 +01:00
add buildname to cibuild, use the firmware name for file names
This commit is contained in:
@@ -803,6 +803,13 @@ resources:
|
||||
|
||||
config:
|
||||
children:
|
||||
- type: string
|
||||
label: 'Build Name'
|
||||
key: buildname
|
||||
target: "define:GWBUILD_NAME"
|
||||
help: "Set a name to identify your build. Will also become the name for the generated files and the firmware type in the image. Max 31 characters."
|
||||
max: 31
|
||||
allowed: "0-9A-Za-z_-"
|
||||
- type: select
|
||||
target: environment
|
||||
label: 'Board'
|
||||
|
||||
@@ -234,7 +234,11 @@ class PipelineInfo{
|
||||
}
|
||||
const downloadConfig=()=>{
|
||||
let name=configName;
|
||||
if (isModified) name=name.replace(/[0-9]*$/,'')+formatDate(undefined,true);
|
||||
const buildname=config["root:buildname"]
|
||||
if (buildname && name != buildname){
|
||||
name+="-"+buildname+"-";
|
||||
}
|
||||
name=name.replace(/[0-9]*$/,'')+formatDate(undefined,true);
|
||||
name+=".json";
|
||||
fileDownload(JSON.stringify(config),name);
|
||||
}
|
||||
@@ -521,6 +525,34 @@ class PipelineInfo{
|
||||
addDescription(config,inputFrame);
|
||||
initialConfig=expandedValues[0];
|
||||
}
|
||||
if (config.type === 'string'){
|
||||
let ip=addEl('input','t'+config.type,inputFrame);
|
||||
addDescription(config,inputFrame);
|
||||
ip.value=current?current:"";
|
||||
ip.addEventListener('change',(ev)=>{
|
||||
let value=ev.target.value;
|
||||
let modified=false;
|
||||
if (config.max){
|
||||
if (value && value.length > config.max){
|
||||
modified=true;
|
||||
value=value.substring(0,config.max);
|
||||
}
|
||||
}
|
||||
if (config.allowed){
|
||||
let check=new RegExp("[^"+config.allowed+"]","g");
|
||||
let nv=value.replace(check,"");
|
||||
if (nv != value){
|
||||
modified=true;
|
||||
value=nv;
|
||||
}
|
||||
}
|
||||
if (modified){
|
||||
ev.target.value=value;
|
||||
}
|
||||
callback(Object.assign({},config,{key: value,value:value}),false);
|
||||
|
||||
});
|
||||
}
|
||||
let childFrame=addEl('div','childFrame',frame);
|
||||
if (initialConfig !== undefined){
|
||||
callback(initialConfig,true,childFrame);
|
||||
|
||||
Reference in New Issue
Block a user