{Object.keys(config[configKey]).map(configOption => {
const configOptionInfo = config[configKey][configOption];
+ if (configOption == "sectionDesc0") {
+ if (configOptionInfo === "") {
+ return;
+ }
+ return (
+
+ )
+ }
const configOptionKey = configKey === '' ? configOption : `${configKey}.${configOption}`;
- const showOptionName = configOption.replace('#','').trim()
+ const showOptionName = configOption.replace('#', '').trim()
return (
{showOptionName}
-
+
{getInput(configOptionKey, configOptionInfo.value)}
)
@@ -147,6 +176,8 @@ const ConfigEditorPage: React.FC = () => {
))
}
+ const URL_REGEX = /https?:\/\/(([0-9a-z.]+\.[a-z]+)|(([0-9]{1,3}\.){3}[0-9]{1,3}))(:[0-9]+)?(\/[0-9a-z%\/.\-_]*)?(\?[0-9a-z=&%_\-]*)?(#[0-9a-z=&%_\-]*)?/ig;
+
const handleExport = () => {
let newConfig = config;
const lines = newConfig.split('\n');
@@ -160,8 +191,8 @@ const ConfigEditorPage: React.FC = () => {
const option = currentObj[nestedKey];
const oldValue = option.value;
const index = option.line;
- const newKey = nestedKey.replace('#','').trim();
- lines[index] = lines[index].replace(` ${nestedKey}: ${oldValue}`,` ${newKey}: ${value}`);
+ const newKey = nestedKey.replace('#', '').trim();
+ lines[index] = lines[index].replace(` ${nestedKey}: ${oldValue}`, ` ${newKey}: ${value}`);
} else {
currentObj = currentObj[nestedKey];
}
@@ -176,7 +207,7 @@ const ConfigEditorPage: React.FC = () => {
function getInput(name, value) {
const handleChange = (event) => {
- const { id, value, type, checked } = event.target;
+ const {id, value, type, checked} = event.target;
editedConfig.current = {
...editedConfig.current,
@@ -188,7 +219,8 @@ const ConfigEditorPage: React.FC = () => {
// Handle all the dropdowns
case 'remote.auth-type':
return (
-