Skip to content

Commit

Permalink
[setting] add webURI
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Feb 29, 2024
1 parent 4a3917e commit e404342
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend/service/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var defaultValueMap = map[string]string{
"webCertFile": "",
"webKeyFile": "",
"webPath": "/app/",
"webURI": "",
"sessionMaxAge": "0",
"timeLocation": "Asia/Tehran",
"subListen": "",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default {
domain: "Domain",
sslKey: "SSL Key Path",
sslCert: "SSL Certificate Path",
webUri: "Panel URI",
sessionAge: "Session Maximum Age",
timeLoc: "Timezone Location",
subEncode: "Enable Encoding",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/fa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default {
domain: "دامنه",
sslKey: "مسیر فایل کلید",
sslCert: "مسیر فایل گواهی",
webUri: "آدرس نهایی پنل",
sessionAge: "بیشینه زمان لاگین ماندن",
timeLoc: "منطقه زمانی",
subEncode: "رمزگذاری",
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<v-col cols="12" sm="6" md="4">
<v-text-field v-model="settings.webCertFile" :label="$t('setting.sslCert')" hide-details></v-text-field>
</v-col>
<v-col cols="12" sm="6" md="4">
<v-text-field v-model="settings.webURI" :label="$t('setting.webUri')" hide-details></v-text-field>
</v-col>
<v-col cols="12" sm="6" md="4">
<v-text-field
type="number"
Expand Down Expand Up @@ -147,6 +150,7 @@ const settings = ref({
webCertFile: "",
webKeyFile: "",
webPath: "/app/",
webURI: "",
sessionMaxAge: "0",
timeLocation: "Asia/Tehran",
subListen: "",
Expand Down Expand Up @@ -196,8 +200,11 @@ const restartApp = async () => {
loading.value = true
const msg = await HttpUtils.post('api/restartApp',{})
if (msg.success) {
const isTLS = settings.value.webCertFile !== "" || settings.value.webKeyFile !== ""
const url = buildURL(settings.value.webDomain,settings.value.webPort.toString(),isTLS, settings.value.webPath)
let url = settings.value.webURI
if (url !== "") {
const isTLS = settings.value.webCertFile !== "" || settings.value.webKeyFile !== ""
url = buildURL(settings.value.webDomain,settings.value.webPort.toString(),isTLS, settings.value.webPath)
}
await sleep(3000)
window.location.replace(url)
}
Expand Down

0 comments on commit e404342

Please sign in to comment.