#60 a bit more settings

This commit is contained in:
UKDTOM 2020-08-06 21:28:08 +02:00
parent 21d4589ce9
commit e6540d3c5e
3 changed files with 33 additions and 4 deletions

View file

@ -99,7 +99,9 @@
"Settings": "Settings",
"Description": "Here you can define the settings for @:Modules.ET.Name",
"Browse": "Browse",
"SelectOutDir": "Select Output Directory"
"SelectOutDir": "Select Output Directory",
"ArraySep": "Array Separator:",
"ColumnSep": "Column Separator:"
}
},
"About": {

View file

@ -4,9 +4,24 @@
<h2 class="subtitle">{{ $t("Modules.ET.Settings.Description") }}</h2>
<br />
<div id="outDir">
<p>{{ $t("Modules.ET.Settings.SelectOutDir") }}</p>
<input id="outDirbox" name="outDirbox" v-model="outDirVal" :disabled=true v-bind:placeholder="$t('Modules.ET.Settings.SelectOutDir')">
<button v-on:click="browse">{{ $t("Modules.ET.Settings.Browse") }}</button>
</div>
</div>
<div class="form-row" id="row">
<div class="col" id="ArraySep">
<p>{{ $t("Modules.ET.Settings.ArraySep") }}</p>
<input id="ArraySep" name="ArraySep" type="text" class="form-control, col-md-auto" v-model="ArraySep" :disabled=false :maxlength=1 @change="setArraySep()">
</div>
<div class="col" id="ColumnSep">
<p>{{ $t("Modules.ET.Settings.ColumnSep") }}</p>
<input id="ColumnSep" name="ColumnSep" type="text" class="form-control, col-md-auto" v-model="ColumnSep" :disabled=false :maxlength=1 @change="setColumnSep()">
</div>
<div class="col" :hidden=true>
</div>
</div>
</section>
</template>
@ -18,7 +33,9 @@
export default {
data() {
return {
outDirVal: wtconfig.get('ET.OutPath', i18n.t('Modules.ET.Settings.SelectOutDir'))
outDirVal: wtconfig.get('ET.OutPath', i18n.t('Modules.ET.Settings.SelectOutDir')),
ArraySep: wtconfig.get('ET.ArraySep'),
ColumnSep: wtconfig.get('ET.ColumnSep')
};
},
@ -33,6 +50,12 @@
this.outDirVal = outDir[0];
log.debug(`Selected Directory is ${outDir}`);
}
},
setColumnSep: function(){
wtconfig.set('ET.ColumnSep', this.ColumnSep)
},
setArraySep: function(){
wtconfig.set('ET.ArraySep', this.ArraySep)
}
}
};
@ -42,4 +65,8 @@
#outDirbox{
margin-right:10px;
}
#row{
margin-top: 10px;
}
</style>

View file

@ -175,7 +175,7 @@ const wtutils = new class WTUtils {
}
// ET Settings
if ( wtconfig.get('ET.ArraySep', 'N/A') == 'N/A' ){
wtconfig.set('ET.ArraySep', ' - ')
wtconfig.set('ET.ArraySep', '-')
}
if ( wtconfig.get('ET.ColumnSep', 'N/A') == 'N/A' ){
wtconfig.set('ET.ColumnSep', ',')