- {Object.keys(schema.properties[schemaKey].patternProperties).map((regexPattern, rIndex) => {
- const pattern = new RegExp(regexPattern);
- if(rIndex < LOOP_LIMIT && yaml[schemaKey]) {
- return Object.keys(yaml[schemaKey]).map((matchedPattern, mIndex) => {
- if(mIndex < LOOP_LIMIT && pattern.test(matchedPattern)){
- return
-
-
- {matchedPattern}
-
-
- {Object.keys(yaml[schemaKey][matchedPattern]).map((schemaProperty, sIndex) => {
-
- if(sIndex < LOOP_LIMIT && schemaProperty.length > 0){
- return
-
- {typeof yaml[schemaKey][matchedPattern][schemaProperty] === "boolean" && {
- // console.log('new yaml:', JSON.stringify({...yaml, [keys[i]]: {...yaml[keys[i]], [toMatch[k]]: {...yaml[keys[i]][toMatch[k]], [matchedProps[l]]: !yaml[keys[i]][toMatch[k]][matchedProps[l]]}}}));
- const newYaml = {...yaml, [schemaKey]: {...yaml[schemaKey], [matchedPattern]: {...yaml[schemaKey][matchedPattern], [schemaProperty]: !yaml[schemaKey][matchedPattern][schemaProperty]}}};
- setLocalYaml(newYaml);
- await window.electron.ipcRenderer.setConfigByKeyAndValidate(`${schemaKey}.${matchedPattern}.${schemaProperty}`, !yaml[schemaKey][matchedPattern][schemaProperty])
- dispatch(setYaml(newYaml));
- dispatch(setNetworkingStatus(false));
- }}/>}
- />}
- {typeof yaml[schemaKey][matchedPattern][schemaProperty] === "number" && {
- if(!Number.isNaN(Number(e.target.value))){
- const newYaml = {...yaml, [schemaKey]: {...yaml[schemaKey], [matchedPattern]: {...yaml[schemaKey][matchedPattern], [schemaProperty]: Number(e.target.value)}}};
- setLocalYaml(newYaml);
- await window.electron.ipcRenderer.setConfigByKeyAndValidate(`${schemaKey}.${matchedPattern}.${schemaProperty}`, Number(e.target.value))
- dispatch(setYaml(newYaml));
- dispatch(setNetworkingStatus(false));
- }
- }}
- />}
-
- }
- return null;
- })}
- }
- return null;
- })
- }
- return null;
- })
+