settings security alert

This commit is contained in:
Alireza Ahmadi
2024-02-19 23:04:20 +01:00
parent 577c534e4c
commit 0621eb0670

View File

@@ -51,6 +51,16 @@
show-icon closable
>
</a-alert>
<a-alert type="error" v-if="confAlerts.length>0" style="margin-bottom: 10px"
message='{{ i18n "secAlertTitle" }}'
color="red"
show-icon closable
>
<template slot="description">
{{ i18n "secAlertConf" }}
<li v-for="a in confAlerts">- [[ a ]]</li>
</template>
</a-alert>
</transition>
<a-space direction="vertical">
<a-card hoverable style="margin-bottom: .5rem;">
@@ -310,6 +320,20 @@
}
}
},
computed: {
confAlerts: {
get: function() {
if (!this.allSetting) return [];
var alerts = []
if (this.allSetting.port == 54321) alerts.push('{{ i18n "pages.settings.panelPort"}}');
panelPath = window.location.pathname.split('/').length<4
if (panelPath && this.allSetting.webBasePath == '/') alerts.push('{{ i18n "pages.settings.panelConfig"}} {{ i18n "pages.settings.panelUrlPath"}}');
subPath = this.allSetting.subURI.length >0 ? new URL(this.allSetting.subURI).pathname : this.allSetting.subPath;
if (subPath == '/sub/') alerts.push('{{ i18n "pages.settings.subSettings"}} {{ i18n "pages.settings.subPath"}}');
return alerts
}
}
},
async mounted() {
if (window.location.protocol !== "https:") {
this.showAlert = true;