webapp: Nicer cmt frequency input

This commit is contained in:
Thomas Basler 2023-03-31 19:33:43 +02:00
parent 50ce7f014d
commit 1e7b16adb9
4 changed files with 28 additions and 5 deletions

View File

@ -329,6 +329,7 @@
"CmtPaLevelHint": "Verwendet für HMS/HMT-Wechselrichter. Stellen Sie sicher, dass Ihre Stromversorgung stabil genug ist, bevor Sie die Sendeleistung erhöhen.", "CmtPaLevelHint": "Verwendet für HMS/HMT-Wechselrichter. Stellen Sie sicher, dass Ihre Stromversorgung stabil genug ist, bevor Sie die Sendeleistung erhöhen.",
"CmtFrequency": "CMT2300A Frequenz:", "CmtFrequency": "CMT2300A Frequenz:",
"CmtFrequencyHint": "Stelle sicher, dass du nur Frequenzen verwendet werden welche im entsprechenden Land erlaubt sind!", "CmtFrequencyHint": "Stelle sicher, dass du nur Frequenzen verwendet werden welche im entsprechenden Land erlaubt sind!",
"CmtFrequencyWarning": "Die ausgewählte Frequenz befindet außerhalb des in der EU zugelassenen Bereiches. Vergewissere dich, dass mit dieser Auswahl keine lokalen Regularien verletzt werden.",
"khz": "kHz", "khz": "kHz",
"Save": "Speichern", "Save": "Speichern",
"Min": "Minimum ({db} dBm)", "Min": "Minimum ({db} dBm)",

View File

@ -329,6 +329,7 @@
"CmtPaLevelHint": "Used for HMS/HMT-Inverters. Make sure your power supply is stable enough before increasing the transmit power.", "CmtPaLevelHint": "Used for HMS/HMT-Inverters. Make sure your power supply is stable enough before increasing the transmit power.",
"CmtFrequency": "CMT2300A Frequency:", "CmtFrequency": "CMT2300A Frequency:",
"CmtFrequencyHint": "Make sure to only use frequencies that are allowed in the respective country!", "CmtFrequencyHint": "Make sure to only use frequencies that are allowed in the respective country!",
"CmtFrequencyWarning": "The selected frequency is outside the range allowed in the EU. Make sure that this selection does not violate any local regulations.",
"khz": "kHz", "khz": "kHz",
"Save": "Save", "Save": "Save",
"Min": "Minimum ({db} dBm)", "Min": "Minimum ({db} dBm)",

View File

@ -329,6 +329,7 @@
"CmtPaLevelHint": "Used for HMS/HMT-Inverters. Assurez-vous que votre alimentation est suffisamment stable avant d'augmenter la puissance d'émission.", "CmtPaLevelHint": "Used for HMS/HMT-Inverters. Assurez-vous que votre alimentation est suffisamment stable avant d'augmenter la puissance d'émission.",
"CmtFrequency": "CMT2300A Frequency:", "CmtFrequency": "CMT2300A Frequency:",
"CmtFrequencyHint": "Stelle sicher, dass du nur Frequenzen verwendet werden welche im entsprechenden Land erlaubt sind!", "CmtFrequencyHint": "Stelle sicher, dass du nur Frequenzen verwendet werden welche im entsprechenden Land erlaubt sind!",
"CmtFrequencyWarning": "The selected frequency is outside the range allowed in the EU. Make sure that this selection does not violate any local regulations.",
"khz": "kHz", "khz": "kHz",
"Save": "Sauvegarder", "Save": "Sauvegarder",
"Min": "Minimum ({db} dBm)", "Min": "Minimum ({db} dBm)",

View File

@ -44,12 +44,24 @@
</div> </div>
</div> </div>
<InputElement :label="$t('dtuadmin.CmtFrequency')" <div class="row mb-3" v-if="dtuConfigList.cmt_enabled">
<label for="cmtFrequency" class="col-sm-2 col-form-label">
{{ $t('dtuadmin.CmtFrequency') }}
<BIconInfoCircle v-tooltip :title="$t('dtuadmin.CmtFrequencyHint')" />
</label>
<div class="col-sm-10">
<div class="input-group mb-3">
<input type="range" class="form-control form-range"
v-model="dtuConfigList.cmt_frequency" v-model="dtuConfigList.cmt_frequency"
type="number" min="860250" max="923500" min="860250" max="923500" step="250"
:postfix="$t('dtuadmin.khz')" id="cmtFrequency" aria-describedby="basic-addon2"
:tooltip="$t('dtuadmin.CmtFrequencyHint')" style="height: unset;" />
v-if="dtuConfigList.cmt_enabled"/> <span class="input-group-text" id="basic-addon2">{{ cmtFrequencyText }}</span>
</div>
<div class="alert alert-danger" role="alert" v-html="$t('dtuadmin.CmtFrequencyWarning')" v-if="cmtIsOutOfEu"></div>
</div>
</div>
</CardElement> </CardElement>
<button type="submit" class="btn btn-primary mb-3">{{ $t('dtuadmin.Save') }}</button> <button type="submit" class="btn btn-primary mb-3">{{ $t('dtuadmin.Save') }}</button>
</form> </form>
@ -98,6 +110,14 @@ export default defineComponent({
created() { created() {
this.getDtuConfig(); this.getDtuConfig();
}, },
computed: {
cmtFrequencyText() {
return this.$n(this.dtuConfigList.cmt_frequency / 1000, "decimalTwoDigits") + " MHz";
},
cmtIsOutOfEu() {
return this.dtuConfigList.cmt_frequency < 863000 || this.dtuConfigList.cmt_frequency > 870000;
}
},
methods: { methods: {
getDtuConfig() { getDtuConfig() {
this.dataLoading = true; this.dataLoading = true;