2023-02-09 22:18:06 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
{{template "head" .}}
|
|
|
|
<style>
|
2024-03-20 13:43:37 +03:00
|
|
|
@media (min-width: 769px) {
|
|
|
|
.ant-layout-content {
|
|
|
|
margin: 24px 16px;
|
2023-02-09 22:18:06 +03:00
|
|
|
}
|
2024-03-20 13:43:37 +03:00
|
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
.ant-tabs-nav .ant-tabs-tab {
|
|
|
|
margin: 0;
|
|
|
|
padding: 12px .5rem;
|
2023-02-09 22:18:06 +03:00
|
|
|
}
|
2024-03-20 13:43:37 +03:00
|
|
|
}
|
|
|
|
.ant-tabs-bar {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
.ant-list-item {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
.alert-msg {
|
|
|
|
color: rgb(194, 117, 18);
|
|
|
|
font-weight: normal;
|
|
|
|
font-size: 16px;
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
text-align: center;
|
|
|
|
background: rgb(255 145 0 / 15%);
|
2024-11-12 00:58:00 +03:00
|
|
|
margin: 1.5rem 2.5rem 0rem;
|
2024-03-20 13:43:37 +03:00
|
|
|
border-radius: .5rem;
|
|
|
|
transition: all 0.5s;
|
|
|
|
animation: signal 3s cubic-bezier(0.18, 0.89, 0.32, 1.28) infinite;
|
|
|
|
}
|
|
|
|
.alert-msg:hover {
|
|
|
|
cursor: default;
|
|
|
|
transition-duration: .3s;
|
|
|
|
animation: signal 0.9s ease infinite;
|
|
|
|
}
|
|
|
|
@keyframes signal {
|
|
|
|
0% {
|
|
|
|
box-shadow: 0 0 0 0 rgba(194, 118, 18, 0.5);
|
2023-02-09 22:18:06 +03:00
|
|
|
}
|
|
|
|
|
2024-03-20 13:43:37 +03:00
|
|
|
50% {
|
|
|
|
box-shadow: 0 0 0 6px rgba(0, 0, 0, 0);
|
2023-02-09 22:18:06 +03:00
|
|
|
}
|
|
|
|
|
2024-03-20 13:43:37 +03:00
|
|
|
100% {
|
|
|
|
box-shadow: 0 0 0 6px rgba(0, 0, 0, 0);
|
2023-05-20 17:27:10 +03:00
|
|
|
}
|
2024-03-20 13:43:37 +03:00
|
|
|
}
|
|
|
|
.alert-msg>i {
|
|
|
|
color: inherit;
|
|
|
|
font-size: 24px;
|
|
|
|
}
|
|
|
|
.collapse-title {
|
|
|
|
color: inherit;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 18px;
|
|
|
|
padding: 10px 20px;
|
|
|
|
border-bottom: 2px solid;
|
|
|
|
}
|
|
|
|
.collapse-title>i {
|
|
|
|
color: inherit;
|
|
|
|
font-size: 24px;
|
|
|
|
}
|
|
|
|
.ant-collapse-content-box .ant-list-item {
|
|
|
|
border-bottom: none !important;
|
|
|
|
}
|
2023-02-09 22:18:06 +03:00
|
|
|
</style>
|
|
|
|
<body>
|
2024-03-20 13:43:37 +03:00
|
|
|
<a-layout id="app" v-cloak :class="themeSwitcher.currentTheme">
|
2023-05-08 17:44:22 +03:00
|
|
|
{{ template "commonSider" . }}
|
2023-12-04 21:17:38 +03:00
|
|
|
<a-layout id="content-layout">
|
2024-03-20 13:43:37 +03:00
|
|
|
<a-layout-content>
|
|
|
|
<a-spin :spinning="spinning" :delay="500" tip='{{ i18n "loading"}}'>
|
|
|
|
<transition name="list" appear>
|
2024-04-02 19:24:55 +03:00
|
|
|
<a-alert type="error" v-if="confAlerts.length>0" style="margin-bottom: 10px;"
|
2024-03-20 13:43:37 +03:00
|
|
|
message='{{ i18n "secAlertTitle" }}'
|
|
|
|
color="red"
|
|
|
|
show-icon closable>
|
|
|
|
<template slot="description">
|
|
|
|
<b>{{ i18n "secAlertConf" }}</b>
|
|
|
|
<ul><li v-for="a in confAlerts">[[ a ]]</li></ul>
|
|
|
|
</template>
|
|
|
|
</a-alert>
|
|
|
|
</transition>
|
|
|
|
<a-space direction="vertical">
|
|
|
|
<a-card hoverable style="margin-bottom: .5rem; overflow-x: hidden;">
|
|
|
|
<a-row style="display: flex; flex-wrap: wrap; align-items: center;">
|
|
|
|
<a-col :xs="24" :sm="10" style="padding: 4px;">
|
|
|
|
<a-space direction="horizontal">
|
|
|
|
<a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">{{ i18n "pages.settings.save" }}</a-button>
|
|
|
|
<a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">{{ i18n "pages.settings.restartPanel" }}</a-button>
|
|
|
|
</a-space>
|
|
|
|
</a-col>
|
|
|
|
<a-col :xs="24" :sm="14">
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<a-back-top :target="() => document.getElementById('content-layout')" visibility-height="200"></a-back-top>
|
|
|
|
<a-alert type="warning" style="float: right; width: fit-content"
|
|
|
|
message='{{ i18n "pages.settings.infoDesc" }}'
|
|
|
|
show-icon>
|
|
|
|
</a-alert>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-card>
|
|
|
|
<a-tabs default-active-key="1">
|
|
|
|
<a-tab-pane key="1" tab='{{ i18n "pages.settings.panelSettings"}}'>
|
|
|
|
<a-list item-layout="horizontal">
|
|
|
|
<a-list-item>
|
|
|
|
<a-row style="padding: 20px">
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.remarkModel"}}'>
|
|
|
|
<template slot="description">{{ i18n "pages.settings.sampleRemark"}}: <i>#[[ remarkSample ]]</i></template>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-input-group style="width: 100%;">
|
|
|
|
<a-select style="padding-right: .5rem; min-width: 80%; width: auto;"
|
|
|
|
mode="multiple"
|
|
|
|
v-model="remarkModel"
|
|
|
|
:dropdown-class-name="themeSwitcher.currentTheme">
|
|
|
|
<a-select-option v-for="(value, key) in remarkModels" :value="key">[[ value ]]</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
<a-select style="width: 20%;" v-model="remarkSeparator" :dropdown-class-name="themeSwitcher.currentTheme">
|
|
|
|
<a-select-option v-for="key in remarkSeparators" :value="key">[[ key ]]</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-input-group>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningIP"}}' desc='{{ i18n "pages.settings.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningDomain"}}' desc='{{ i18n "pages.settings.panelListeningDomainDesc"}}' v-model="allSetting.webDomain"></setting-list-item>
|
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.panelPort"}}' desc='{{ i18n "pages.settings.panelPortDesc"}}' v-model="allSetting.webPort" :min="1" :max="65531"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.publicKeyPath"}}' desc='{{ i18n "pages.settings.publicKeyPathDesc"}}' v-model="allSetting.webCertFile"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.privateKeyPath"}}' desc='{{ i18n "pages.settings.privateKeyPathDesc"}}' v-model="allSetting.webKeyFile"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.panelUrlPath"}}' desc='{{ i18n "pages.settings.panelUrlPathDesc"}}' v-model="allSetting.webBasePath"></setting-list-item>
|
2024-09-12 10:41:24 +03:00
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.sessionMaxAge" }}' desc='{{ i18n "pages.settings.sessionMaxAgeDesc" }}' v-model="allSetting.sessionMaxAge" :min="60"></setting-list-item>
|
2024-03-20 13:43:37 +03:00
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.pageSize" }}' desc='{{ i18n "pages.settings.pageSizeDesc" }}' v-model="allSetting.pageSize" :min="0" :step="5"></setting-list-item>
|
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.expireTimeDiff" }}' desc='{{ i18n "pages.settings.expireTimeDiffDesc" }}' v-model="allSetting.expireDiff" :min="0"></setting-list-item>
|
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.trafficDiff" }}' desc='{{ i18n "pages.settings.trafficDiffDesc" }}' v-model="allSetting.trafficDiff" :min="0"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.timeZone"}}' desc='{{ i18n "pages.settings.timeZoneDesc"}}' v-model="allSetting.timeLocation"></setting-list-item>
|
|
|
|
<a-list-item>
|
|
|
|
<a-row style="padding: 20px">
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.datepicker"}}'>
|
|
|
|
<template slot="description">{{ i18n "pages.settings.datepickerDescription"}}</template>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<template>
|
|
|
|
<a-select style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme" v-model="datepicker">
|
|
|
|
<a-select-option v-for="item in datepickerList" :value="item.value">
|
|
|
|
<span v-text="item.name"></span>
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</template>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
<a-list-item>
|
|
|
|
<a-row style="padding: 20px">
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title="Language"></a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<template>
|
|
|
|
<a-select ref="selectLang"
|
|
|
|
v-model="lang"
|
|
|
|
@change="setLang(lang)"
|
|
|
|
:dropdown-class-name="themeSwitcher.currentTheme"
|
|
|
|
style="width: 100%">
|
|
|
|
<a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
|
|
|
|
<span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span>
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</template>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
</a-list>
|
|
|
|
</a-tab-pane>
|
|
|
|
<a-tab-pane key="2" tab='{{ i18n "pages.settings.securitySettings"}}' style="padding: 20px;">
|
|
|
|
<a-divider>{{ i18n "pages.settings.security.admin"}}</a-divider>
|
|
|
|
<a-form layout="horizontal" :colon="false" style="float: left; margin-bottom: 2rem;" :label-col="{ md: {span:10} }" :wrapper-col="{ md: {span:14} }">
|
|
|
|
<a-form-item label='{{ i18n "pages.settings.oldUsername"}}'>
|
|
|
|
<a-input autocomplete="username" v-model="user.oldUsername"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.settings.currentPassword"}}'>
|
|
|
|
<password-input autocomplete="current-password" v-model="user.oldPassword"></password-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.settings.newUsername"}}'>
|
|
|
|
<a-input v-model="user.newUsername"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.settings.newPassword"}}'>
|
|
|
|
<password-input autocomplete="new-password" v-model="user.newPassword"></password-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label=" ">
|
|
|
|
<a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button>
|
|
|
|
</a-form-item>
|
|
|
|
</a-form>
|
|
|
|
<a-divider>{{ i18n "pages.settings.security.secret"}}</a-divider>
|
|
|
|
<a-form style="padding: 0 20px;">
|
|
|
|
<a-list-item>
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.security.loginSecurity" }}'
|
|
|
|
description='{{ i18n "pages.settings.security.loginSecurityDesc" }}'>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<template>
|
|
|
|
<a-switch @change="toggleToken(allSetting.secretEnable)" v-model="allSetting.secretEnable"></a-switch>
|
|
|
|
<a-icon style="margin-left: 1rem;" v-if="allSetting.secretEnable" :spin="this.changeSecret" type="sync" @click="getNewSecret"></a-icon>
|
|
|
|
</template>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
<a-list-item>
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.security.secretToken" }}'
|
|
|
|
description='{{ i18n "pages.settings.security.secretTokenDesc" }}'>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<template>
|
|
|
|
<a-textarea type="text" :disabled="!allSetting.secretEnable" v-model="user.loginSecret"></a-textarea>
|
|
|
|
</template>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
<a-button type="primary" :loading="this.changeSecret" @click="updateSecret">{{ i18n "confirm" }}</a-button>
|
|
|
|
</a-form>
|
|
|
|
</a-tab-pane>
|
|
|
|
<a-tab-pane key="3" tab='{{ i18n "pages.settings.TGBotSettings"}}'>
|
|
|
|
<a-list item-layout="horizontal">
|
|
|
|
<setting-list-item type="switch" title='{{ i18n "pages.settings.telegramBotEnable" }}' desc='{{ i18n "pages.settings.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.telegramToken"}}' desc='{{ i18n "pages.settings.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.telegramChatId"}}' desc='{{ i18n "pages.settings.telegramChatIdDesc"}}' v-model="allSetting.tgBotChatId"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.telegramNotifyTime"}}' desc='{{ i18n "pages.settings.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item>
|
|
|
|
<setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyBackup" }}' desc='{{ i18n "pages.settings.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item>
|
|
|
|
<setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyLogin" }}' desc='{{ i18n "pages.settings.tgNotifyLoginDesc" }}' v-model="allSetting.tgBotLoginNotify"></setting-list-item>
|
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.tgNotifyCpu" }}' desc='{{ i18n "pages.settings.tgNotifyCpuDesc" }}' v-model="allSetting.tgCpu" :min="0" :max="100"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.telegramProxy"}}' desc='{{ i18n "pages.settings.telegramProxyDesc"}}' v-model="allSetting.tgBotProxy" placeholder="socks5://user:pass@host:port"></setting-list-item>
|
2024-10-17 11:59:42 +03:00
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.telegramAPIServer"}}' desc='{{ i18n "pages.settings.telegramAPIServerDesc"}}' v-model="allSetting.tgBotAPIServer" placeholder="https://api.example.com"></setting-list-item>
|
2024-03-20 13:43:37 +03:00
|
|
|
<a-list-item>
|
|
|
|
<a-row style="padding: 20px">
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title="Telegram Bot Language" />
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<template>
|
|
|
|
<a-select ref="selectBotLang" v-model="allSetting.tgLang" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%">
|
|
|
|
<a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
|
|
|
|
<span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span>
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</template>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
</a-list>
|
|
|
|
</a-tab-pane>
|
|
|
|
<a-tab-pane key="4" tab='{{ i18n "pages.settings.subSettings" }}'>
|
|
|
|
<a-list item-layout="horizontal">
|
|
|
|
<setting-list-item type="switch" title='{{ i18n "pages.settings.subEnable"}}' desc='{{ i18n "pages.settings.subEnableDesc"}}' v-model="allSetting.subEnable"></setting-list-item>
|
|
|
|
<setting-list-item type="switch" title='{{ i18n "pages.settings.subEncrypt"}}' desc='{{ i18n "pages.settings.subEncryptDesc"}}' v-model="allSetting.subEncrypt"></setting-list-item>
|
|
|
|
<setting-list-item type="switch" title='{{ i18n "pages.settings.subShowInfo"}}' desc='{{ i18n "pages.settings.subShowInfoDesc"}}' v-model="allSetting.subShowInfo"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subListen"}}' desc='{{ i18n "pages.settings.subListenDesc"}}' v-model="allSetting.subListen"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subDomain"}}' desc='{{ i18n "pages.settings.subDomainDesc"}}' v-model="allSetting.subDomain"></setting-list-item>
|
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.subPort"}}' desc='{{ i18n "pages.settings.subPortDesc"}}' v-model.number="allSetting.subPort" :min="1" :max="65531"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subPath"}}' desc='{{ i18n "pages.settings.subPathDesc"}}' v-model="allSetting.subPath"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subCertPath"}}' desc='{{ i18n "pages.settings.subCertPathDesc"}}' v-model="allSetting.subCertFile"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subKeyPath"}}' desc='{{ i18n "pages.settings.subKeyPathDesc"}}' v-model="allSetting.subKeyFile"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subURI"}}' desc='{{ i18n "pages.settings.subURIDesc"}}' v-model="allSetting.subURI" placeholder="(http|https)://domain[:port]/path/"></setting-list-item>
|
|
|
|
<setting-list-item type="number" title='{{ i18n "pages.settings.subUpdates"}}' desc='{{ i18n "pages.settings.subUpdatesDesc"}}' v-model="allSetting.subUpdates" :min="1"></setting-list-item>
|
|
|
|
</a-list>
|
|
|
|
</a-tab-pane>
|
|
|
|
<a-tab-pane key="5" tab='{{ i18n "pages.settings.subSettings" }} Json' v-if="allSetting.subEnable">
|
|
|
|
<a-list item-layout="horizontal">
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subPath"}}' desc='{{ i18n "pages.settings.subPathDesc"}}' v-model="allSetting.subJsonPath"></setting-list-item>
|
|
|
|
<setting-list-item type="text" title='{{ i18n "pages.settings.subURI"}}' desc='{{ i18n "pages.settings.subURIDesc"}}' v-model="allSetting.subJsonURI" placeholder="(http|https)://domain[:port]/path/"></setting-list-item>
|
|
|
|
<a-list-item style="padding: 20px">
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.fragment"}}'>
|
|
|
|
<template slot="description">{{ i18n "pages.settings.fragmentDesc"}}</template>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-switch v-model="fragment"></a-switch>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
<a-collapse v-if="fragment" style="margin-top: 14px;">
|
|
|
|
<a-collapse-panel header='{{ i18n "pages.settings.fragmentSett"}}' v-if="fragment">
|
2024-09-02 11:24:02 +03:00
|
|
|
<setting-list-item style="padding: 10px 20px" type="text" title='Packets' v-model="fragmentPackets" placeholder="1-1 | 1-3 | tlshello | ..."></setting-list-item>
|
2024-03-20 13:43:37 +03:00
|
|
|
<setting-list-item style="padding: 10px 20px" type="text" title='Length' v-model="fragmentLength" placeholder="100-200"></setting-list-item>
|
|
|
|
<setting-list-item style="padding: 10px 20px" type="text" title='Interval' v-model="fragmentInterval" placeholder="10-20"></setting-list-item>
|
|
|
|
</a-collapse-panel>
|
|
|
|
</a-collapse>
|
|
|
|
</a-list-item>
|
2024-08-29 12:27:43 +03:00
|
|
|
<a-list-item style="padding: 20px">
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
2024-09-17 10:33:44 +03:00
|
|
|
<a-list-item-meta title='Noises'>
|
|
|
|
<template slot="description">{{ i18n "pages.settings.noisesDesc"}}</template>
|
2024-08-29 12:27:43 +03:00
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
2024-09-17 10:33:44 +03:00
|
|
|
<a-switch v-model="noises"></a-switch>
|
2024-08-29 12:27:43 +03:00
|
|
|
</a-col>
|
|
|
|
</a-row>
|
2024-09-17 10:33:44 +03:00
|
|
|
<a-collapse v-if="noises" style="margin-top: 14px;">
|
2024-09-24 12:38:10 +03:00
|
|
|
<a-collapse-panel v-for="(noise, index) in noisesArray" :key="index" :header="`Noise ${index + 1}`">
|
2024-09-17 10:33:44 +03:00
|
|
|
<a-list-item style="padding: 10px 20px">
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='Type'></a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
2024-09-24 12:38:10 +03:00
|
|
|
<a-select :value="noise.type" style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme"
|
|
|
|
@change="(value) => updateNoiseType(index, value)">
|
|
|
|
<a-select-option :value="p" :label="p" v-for="p in ['rand', 'base64', 'str']" :key="p">
|
|
|
|
[[ p ]] </a-select-option>
|
2024-09-17 10:33:44 +03:00
|
|
|
</a-select>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
2024-09-24 12:38:10 +03:00
|
|
|
<setting-list-item style="padding: 10px 20px" type="text" title='Packet' :value="noise.packet"
|
|
|
|
@input="(value) => updateNoisePacket(index, value)" placeholder="5-10"></setting-list-item>
|
|
|
|
<setting-list-item style="padding: 10px 20px" type="text" title='Delay (ms)' :value="noise.delay"
|
|
|
|
@input="(value) => updateNoiseDelay(index, value)" placeholder="10-20"></setting-list-item>
|
2024-09-24 13:18:42 +03:00
|
|
|
<a-button v-if="noisesArray.length > 1" type="danger" @click="removeNoise(index)">Remove</a-button>
|
2024-08-29 12:27:43 +03:00
|
|
|
</a-collapse-panel>
|
|
|
|
</a-collapse>
|
2024-09-24 12:38:10 +03:00
|
|
|
<a-button v-if="noises" type="primary" @click="addNoise" style="margin-top: 10px">Add Noise</a-button>
|
2024-08-29 12:27:43 +03:00
|
|
|
</a-list-item>
|
2024-03-20 13:43:37 +03:00
|
|
|
<a-list-item style="padding: 20px">
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.mux"}}'>
|
|
|
|
<template slot="description">{{ i18n "pages.settings.muxDesc"}}</template>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-switch v-model="enableMux"></a-switch>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
<a-collapse v-if="enableMux" style="margin-top: 14px;">
|
|
|
|
<a-collapse-panel header='{{ i18n "pages.settings.muxSett"}}'>
|
|
|
|
<setting-list-item style="padding: 10px 20px" type="number" title='Concurrency' v-model="muxConcurrency" :min="-1" :max="1024"></setting-list-item>
|
|
|
|
<setting-list-item style="padding: 10px 20px" type="number" title='xudp Concurrency' v-model="muxXudpConcurrency" :min="-1" :max="1024"></setting-list-item>
|
|
|
|
<a-list-item style="padding: 10px 20px">
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='xudp UDP 443'></a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-select v-model="muxXudpProxyUDP443" style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme">
|
|
|
|
<a-select-option :value="p" :label="p" v-for="p in ['reject', 'allow', 'skip']"> [[ p ]] </a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-list-item>
|
|
|
|
</a-collapse-panel>
|
|
|
|
</a-collapse>
|
|
|
|
</a-list-item>
|
|
|
|
<a-list-item style="padding: 20px">
|
|
|
|
<a-row>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-list-item-meta title='{{ i18n "pages.settings.direct"}}'>
|
|
|
|
<template slot="description">{{ i18n "pages.settings.directDesc"}}</template>
|
|
|
|
</a-list-item-meta>
|
|
|
|
</a-col>
|
|
|
|
<a-col :lg="24" :xl="12">
|
|
|
|
<a-switch v-model="enableDirect"></a-switch>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
<a-collapse v-if="enableDirect" style="margin-top: 14px;">
|
2024-09-27 14:34:12 +03:00
|
|
|
<a-collapse-panel header='{{ i18n "pages.xray.directips"}}'>
|
2024-03-20 13:43:37 +03:00
|
|
|
<a-list-item style="padding: 10px 20px">
|
2024-10-17 12:25:39 +03:00
|
|
|
<a-checkbox-group v-model="directIPs" :options="IPsOptions"></a-checkbox-group>
|
2024-09-24 15:57:14 +03:00
|
|
|
</a-list-item>
|
|
|
|
</a-collapse-panel>
|
2024-09-27 14:34:12 +03:00
|
|
|
<a-collapse-panel header='{{ i18n "pages.xray.directdomains"}}'>
|
2024-09-24 15:57:14 +03:00
|
|
|
<a-list-item style="padding: 10px 20px">
|
2024-10-17 12:25:39 +03:00
|
|
|
<a-checkbox-group v-model="directDomains" :options="DomainsOptions"></a-checkbox-group>
|
2024-03-20 13:43:37 +03:00
|
|
|
</a-list-item>
|
|
|
|
</a-collapse-panel>
|
|
|
|
</a-collapse>
|
|
|
|
</a-list-item>
|
|
|
|
</a-list>
|
|
|
|
</a-tab-pane>
|
|
|
|
</a-tabs>
|
|
|
|
</a-space>
|
|
|
|
</a-spin>
|
|
|
|
</a-layout-content>
|
2023-02-09 22:18:06 +03:00
|
|
|
</a-layout>
|
2024-03-20 13:43:37 +03:00
|
|
|
</a-layout>
|
2023-05-08 17:44:22 +03:00
|
|
|
{{template "js" .}}
|
2023-12-05 20:13:36 +03:00
|
|
|
<script src="{{ .base_path }}assets/js/model/setting.js?{{ .cur_ver }}"></script>
|
2023-05-08 17:44:22 +03:00
|
|
|
{{template "component/themeSwitcher" .}}
|
2023-05-08 17:56:01 +03:00
|
|
|
{{template "component/password" .}}
|
2023-05-08 17:44:22 +03:00
|
|
|
{{template "component/setting"}}
|
|
|
|
<script>
|
2024-04-02 23:13:16 +03:00
|
|
|
const app = new Vue({
|
|
|
|
delimiters: ['[[', ']]'],
|
|
|
|
el: '#app',
|
|
|
|
data: {
|
|
|
|
siderDrawer,
|
|
|
|
themeSwitcher,
|
|
|
|
spinning: false,
|
|
|
|
changeSecret: false,
|
|
|
|
oldAllSetting: new AllSetting(),
|
|
|
|
allSetting: new AllSetting(),
|
|
|
|
saveBtnDisable: true,
|
|
|
|
user: {},
|
|
|
|
lang: getLang(),
|
|
|
|
remarkModels: { i: 'Inbound', e: 'Email', o: 'Other' },
|
|
|
|
remarkSeparators: [' ', '-', '_', '@', ':', '~', '|', ',', '.', '/'],
|
|
|
|
datepickerList: [{ name: 'Gregorian (Standard)', value: 'gregorian' }, { name: 'Jalalian (شمسی)', value: 'jalalian' }],
|
|
|
|
remarkSample: '',
|
|
|
|
defaultFragment: {
|
|
|
|
tag: "fragment",
|
|
|
|
protocol: "freedom",
|
|
|
|
settings: {
|
|
|
|
domainStrategy: "AsIs",
|
|
|
|
fragment: {
|
|
|
|
packets: "tlshello",
|
|
|
|
length: "100-200",
|
|
|
|
interval: "10-20"
|
|
|
|
}
|
2023-05-08 17:44:22 +03:00
|
|
|
},
|
2024-04-02 23:13:16 +03:00
|
|
|
streamSettings: {
|
|
|
|
sockopt: {
|
|
|
|
tcpKeepAliveIdle: 100,
|
2024-05-22 19:35:46 +03:00
|
|
|
tcpMptcp: true,
|
2025-01-01 20:42:50 +03:00
|
|
|
penetrate: true
|
2024-04-02 23:13:16 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-09-17 10:33:44 +03:00
|
|
|
defaultNoises: {
|
|
|
|
tag: "noises",
|
2024-08-29 12:27:43 +03:00
|
|
|
protocol: "freedom",
|
|
|
|
settings: {
|
|
|
|
domainStrategy: "AsIs",
|
2024-09-24 12:38:10 +03:00
|
|
|
noises: [
|
|
|
|
{ type: "rand", packet: "10-20", delay: "10-16" },
|
|
|
|
],
|
2024-08-29 12:27:43 +03:00
|
|
|
},
|
|
|
|
},
|
2024-04-02 23:13:16 +03:00
|
|
|
defaultMux: {
|
|
|
|
enabled: true,
|
|
|
|
concurrency: 8,
|
|
|
|
xudpConcurrency: 16,
|
|
|
|
xudpProxyUDP443: "reject"
|
|
|
|
},
|
|
|
|
defaultRules: [
|
|
|
|
{
|
|
|
|
type: "field",
|
|
|
|
outboundTag: "direct",
|
|
|
|
domain: [
|
2024-09-24 15:57:14 +03:00
|
|
|
"geosite:category-ir"
|
2024-10-10 23:33:44 +03:00
|
|
|
]
|
2023-05-08 17:44:22 +03:00
|
|
|
},
|
2024-04-02 23:13:16 +03:00
|
|
|
{
|
|
|
|
type: "field",
|
|
|
|
outboundTag: "direct",
|
|
|
|
ip: [
|
|
|
|
"geoip:private",
|
2024-09-24 15:57:14 +03:00
|
|
|
"geoip:ir"
|
2024-10-10 23:33:44 +03:00
|
|
|
]
|
2024-04-02 23:13:16 +03:00
|
|
|
},
|
|
|
|
],
|
2024-10-17 12:25:39 +03:00
|
|
|
IPsOptions: [
|
2024-09-25 11:16:47 +03:00
|
|
|
{ label: 'Private IP', value: 'private' },
|
2024-04-02 23:13:16 +03:00
|
|
|
{ label: '🇮🇷 Iran', value: 'ir' },
|
|
|
|
{ label: '🇨🇳 China', value: 'cn' },
|
|
|
|
{ label: '🇷🇺 Russia', value: 'ru' },
|
2024-09-24 15:57:14 +03:00
|
|
|
{ label: '🇻🇳 Vietnam', value: 'vn' },
|
|
|
|
{ label: '🇪🇸 Spain', value: 'es' },
|
|
|
|
{ label: '🇮🇩 Indonesia', value: 'id' },
|
|
|
|
{ label: '🇺🇦 Ukraine', value: 'ua' },
|
|
|
|
{ label: '🇹🇷 Türkiye', value: 'tr' },
|
|
|
|
{ label: '🇧🇷 Brazil', value: 'br' },
|
|
|
|
],
|
2024-10-17 12:25:39 +03:00
|
|
|
DomainsOptions: [
|
2024-09-24 15:57:14 +03:00
|
|
|
{ label: '🇮🇷 Iran', value: 'ir' },
|
|
|
|
{ label: '🇨🇳 China', value: 'cn' },
|
|
|
|
{ label: '🇷🇺 Russia', value: 'ru' },
|
|
|
|
{ label: 'Apple', value: 'apple' },
|
|
|
|
{ label: 'Meta', value: 'meta' },
|
|
|
|
{ label: 'Google', value: 'google' },
|
2024-04-02 23:13:16 +03:00
|
|
|
],
|
|
|
|
get remarkModel() {
|
|
|
|
rm = this.allSetting.remarkModel;
|
|
|
|
return rm.length > 1 ? rm.substring(1).split('') : [];
|
|
|
|
},
|
|
|
|
set remarkModel(value) {
|
|
|
|
rs = this.allSetting.remarkModel[0];
|
|
|
|
this.allSetting.remarkModel = rs + value.join('');
|
|
|
|
this.changeRemarkSample();
|
|
|
|
},
|
|
|
|
get remarkSeparator() {
|
|
|
|
return this.allSetting.remarkModel.length > 1 ? this.allSetting.remarkModel.charAt(0) : '-';
|
|
|
|
},
|
|
|
|
set remarkSeparator(value) {
|
|
|
|
this.allSetting.remarkModel = value + this.allSetting.remarkModel.substring(1);
|
|
|
|
this.changeRemarkSample();
|
|
|
|
},
|
|
|
|
get datepicker() {
|
|
|
|
return this.allSetting.datepicker ? this.allSetting.datepicker : 'gregorian';
|
|
|
|
},
|
|
|
|
set datepicker(value) {
|
|
|
|
this.allSetting.datepicker = value;
|
|
|
|
},
|
|
|
|
changeRemarkSample() {
|
|
|
|
sample = []
|
|
|
|
this.remarkModel.forEach(r => sample.push(this.remarkModels[r]));
|
|
|
|
this.remarkSample = sample.length == 0 ? '' : sample.join(this.remarkSeparator);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
loading(spinning = true) {
|
|
|
|
this.spinning = spinning;
|
|
|
|
},
|
|
|
|
async getAllSetting() {
|
|
|
|
this.loading(true);
|
|
|
|
const msg = await HttpUtil.post("/panel/setting/all");
|
|
|
|
this.loading(false);
|
|
|
|
if (msg.success) {
|
|
|
|
this.oldAllSetting = new AllSetting(msg.obj);
|
|
|
|
this.allSetting = new AllSetting(msg.obj);
|
|
|
|
app.changeRemarkSample();
|
|
|
|
this.saveBtnDisable = true;
|
|
|
|
}
|
|
|
|
await this.fetchUserSecret();
|
|
|
|
},
|
|
|
|
async updateAllSetting() {
|
|
|
|
this.loading(true);
|
|
|
|
const msg = await HttpUtil.post("/panel/setting/update", this.allSetting);
|
|
|
|
this.loading(false);
|
|
|
|
if (msg.success) {
|
|
|
|
await this.getAllSetting();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async updateUser() {
|
|
|
|
this.loading(true);
|
|
|
|
const msg = await HttpUtil.post("/panel/setting/updateUser", this.user);
|
|
|
|
this.loading(false);
|
|
|
|
if (msg.success) {
|
|
|
|
this.user = {};
|
2024-07-05 15:33:04 +03:00
|
|
|
window.location.replace(basePath + "logout");
|
2024-04-02 23:13:16 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
async restartPanel() {
|
|
|
|
await new Promise(resolve => {
|
|
|
|
this.$confirm({
|
|
|
|
title: '{{ i18n "pages.settings.restartPanel" }}',
|
|
|
|
content: '{{ i18n "pages.settings.restartPanelDesc" }}',
|
|
|
|
class: themeSwitcher.currentTheme,
|
|
|
|
okText: '{{ i18n "sure" }}',
|
|
|
|
cancelText: '{{ i18n "cancel" }}',
|
|
|
|
onOk: () => resolve(),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.loading(true);
|
|
|
|
const msg = await HttpUtil.post("/panel/setting/restartPanel");
|
|
|
|
this.loading(false);
|
|
|
|
if (msg.success) {
|
|
|
|
this.loading(true);
|
|
|
|
await PromiseUtil.sleep(5000);
|
2024-08-11 01:47:44 +03:00
|
|
|
var { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting;
|
|
|
|
if (host == this.oldAllSetting.webDomain) host = null;
|
|
|
|
if (port == this.oldAllSetting.webPort) port = null;
|
2024-04-02 23:13:16 +03:00
|
|
|
const isTLS = webCertFile !== "" || webKeyFile !== "";
|
|
|
|
const url = buildURL({ host, port, isTLS, base, path: "panel/settings" });
|
|
|
|
window.location.replace(url);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async fetchUserSecret() {
|
|
|
|
this.loading(true);
|
|
|
|
const userMessage = await HttpUtil.post("/panel/setting/getUserSecret", this.user);
|
|
|
|
if (userMessage.success) {
|
|
|
|
this.user = userMessage.obj;
|
|
|
|
}
|
|
|
|
this.loading(false);
|
|
|
|
},
|
|
|
|
async updateSecret() {
|
|
|
|
this.loading(true);
|
|
|
|
const msg = await HttpUtil.post("/panel/setting/updateUserSecret", this.user);
|
|
|
|
if (msg && msg.obj) {
|
|
|
|
this.user = msg.obj;
|
|
|
|
}
|
|
|
|
this.loading(false);
|
|
|
|
await this.updateAllSetting();
|
|
|
|
},
|
|
|
|
generateRandomString(length) {
|
|
|
|
var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
|
|
|
let randomString = "";
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
|
|
randomString += chars[Math.floor(Math.random() * chars.length)];
|
|
|
|
}
|
|
|
|
return randomString;
|
|
|
|
},
|
|
|
|
async getNewSecret() {
|
|
|
|
if (!this.changeSecret) {
|
|
|
|
this.changeSecret = true;
|
|
|
|
this.user.loginSecret = '';
|
|
|
|
const newSecret = this.generateRandomString(64);
|
|
|
|
await PromiseUtil.sleep(1000);
|
|
|
|
this.user.loginSecret = newSecret;
|
|
|
|
this.changeSecret = false;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async toggleToken(value) {
|
|
|
|
if (value) {
|
|
|
|
await this.getNewSecret();
|
|
|
|
} else {
|
|
|
|
this.user.loginSecret = "";
|
|
|
|
}
|
|
|
|
},
|
2024-09-24 12:38:10 +03:00
|
|
|
addNoise() {
|
|
|
|
const newNoise = { type: "rand", packet: "10-20", delay: "10-16" };
|
|
|
|
this.noisesArray = [...this.noisesArray, newNoise];
|
|
|
|
},
|
|
|
|
removeNoise(index) {
|
|
|
|
const newNoises = [...this.noisesArray];
|
|
|
|
newNoises.splice(index, 1);
|
|
|
|
this.noisesArray = newNoises;
|
|
|
|
},
|
|
|
|
updateNoiseType(index, value) {
|
|
|
|
const updatedNoises = [...this.noisesArray];
|
|
|
|
updatedNoises[index] = { ...updatedNoises[index], type: value };
|
|
|
|
this.noisesArray = updatedNoises;
|
|
|
|
},
|
|
|
|
updateNoisePacket(index, value) {
|
|
|
|
const updatedNoises = [...this.noisesArray];
|
|
|
|
updatedNoises[index] = { ...updatedNoises[index], packet: value };
|
|
|
|
this.noisesArray = updatedNoises;
|
|
|
|
},
|
|
|
|
updateNoiseDelay(index, value) {
|
|
|
|
const updatedNoises = [...this.noisesArray];
|
|
|
|
updatedNoises[index] = { ...updatedNoises[index], delay: value };
|
|
|
|
this.noisesArray = updatedNoises;
|
|
|
|
},
|
2024-04-02 23:13:16 +03:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
fragment: {
|
|
|
|
get: function () { return this.allSetting?.subJsonFragment != ""; },
|
|
|
|
set: function (v) {
|
|
|
|
this.allSetting.subJsonFragment = v ? JSON.stringify(this.defaultFragment) : "";
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fragmentPackets: {
|
|
|
|
get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.packets : ""; },
|
|
|
|
set: function (v) {
|
|
|
|
if (v != "") {
|
|
|
|
newFragment = JSON.parse(this.allSetting.subJsonFragment);
|
|
|
|
newFragment.settings.fragment.packets = v;
|
|
|
|
this.allSetting.subJsonFragment = JSON.stringify(newFragment);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fragmentLength: {
|
|
|
|
get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.length : ""; },
|
|
|
|
set: function (v) {
|
|
|
|
if (v != "") {
|
|
|
|
newFragment = JSON.parse(this.allSetting.subJsonFragment);
|
|
|
|
newFragment.settings.fragment.length = v;
|
|
|
|
this.allSetting.subJsonFragment = JSON.stringify(newFragment);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fragmentInterval: {
|
|
|
|
get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.interval : ""; },
|
|
|
|
set: function (v) {
|
|
|
|
if (v != "") {
|
|
|
|
newFragment = JSON.parse(this.allSetting.subJsonFragment);
|
|
|
|
newFragment.settings.fragment.interval = v;
|
|
|
|
this.allSetting.subJsonFragment = JSON.stringify(newFragment);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-09-17 10:33:44 +03:00
|
|
|
noises: {
|
2024-09-24 12:38:10 +03:00
|
|
|
get() {
|
|
|
|
return this.allSetting?.subJsonNoises != "";
|
|
|
|
},
|
|
|
|
set(v) {
|
|
|
|
if (v) {
|
|
|
|
this.allSetting.subJsonNoises = JSON.stringify(this.defaultNoises);
|
|
|
|
} else {
|
|
|
|
this.allSetting.subJsonNoises = "";
|
2024-08-29 12:27:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-09-24 12:38:10 +03:00
|
|
|
noisesArray: {
|
|
|
|
get() {
|
|
|
|
return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises : [];
|
|
|
|
},
|
|
|
|
set(value) {
|
|
|
|
if (this.noises) {
|
|
|
|
const newNoises = JSON.parse(this.allSetting.subJsonNoises);
|
|
|
|
newNoises.settings.noises = value;
|
2024-09-17 10:33:44 +03:00
|
|
|
this.allSetting.subJsonNoises = JSON.stringify(newNoises);
|
2024-08-29 12:27:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-04-02 23:13:16 +03:00
|
|
|
enableMux: {
|
|
|
|
get: function () { return this.allSetting?.subJsonMux != ""; },
|
|
|
|
set: function (v) {
|
|
|
|
this.allSetting.subJsonMux = v ? JSON.stringify(this.defaultMux) : "";
|
|
|
|
}
|
|
|
|
},
|
|
|
|
muxConcurrency: {
|
|
|
|
get: function () { return this.enableMux ? JSON.parse(this.allSetting.subJsonMux).concurrency : -1; },
|
|
|
|
set: function (v) {
|
|
|
|
newMux = JSON.parse(this.allSetting.subJsonMux);
|
|
|
|
newMux.concurrency = v;
|
|
|
|
this.allSetting.subJsonMux = JSON.stringify(newMux);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
muxXudpConcurrency: {
|
|
|
|
get: function () { return this.enableMux ? JSON.parse(this.allSetting.subJsonMux).xudpConcurrency : -1; },
|
|
|
|
set: function (v) {
|
|
|
|
newMux = JSON.parse(this.allSetting.subJsonMux);
|
|
|
|
newMux.xudpConcurrency = v;
|
|
|
|
this.allSetting.subJsonMux = JSON.stringify(newMux);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
muxXudpProxyUDP443: {
|
|
|
|
get: function () { return this.enableMux ? JSON.parse(this.allSetting.subJsonMux).xudpProxyUDP443 : "reject"; },
|
|
|
|
set: function (v) {
|
|
|
|
newMux = JSON.parse(this.allSetting.subJsonMux);
|
|
|
|
newMux.xudpProxyUDP443 = v;
|
|
|
|
this.allSetting.subJsonMux = JSON.stringify(newMux);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
enableDirect: {
|
|
|
|
get: function () { return this.allSetting?.subJsonRules != ""; },
|
|
|
|
set: function (v) {
|
|
|
|
this.allSetting.subJsonRules = v ? JSON.stringify(this.defaultRules) : "";
|
|
|
|
}
|
|
|
|
},
|
2024-10-17 12:25:39 +03:00
|
|
|
directIPs: {
|
2024-04-02 23:13:16 +03:00
|
|
|
get: function () {
|
|
|
|
if (!this.enableDirect) return [];
|
2024-09-24 15:57:14 +03:00
|
|
|
const rules = JSON.parse(this.allSetting.subJsonRules);
|
2024-10-10 23:33:44 +03:00
|
|
|
if (!Array.isArray(rules)) return [];
|
|
|
|
const ipRule = rules.find(r => r.ip);
|
|
|
|
return ipRule?.ip.map(d => d.replace("geoip:", "")) ?? [];
|
2024-04-02 23:13:16 +03:00
|
|
|
},
|
|
|
|
set: function (v) {
|
2024-10-10 23:33:44 +03:00
|
|
|
let rules = JSON.parse(this.allSetting.subJsonRules);
|
2024-04-02 23:13:16 +03:00
|
|
|
if (!Array.isArray(rules)) return;
|
2024-09-24 15:57:14 +03:00
|
|
|
|
2024-10-10 23:33:44 +03:00
|
|
|
if (v.length == 0) {
|
|
|
|
rules = rules.filter(r => !r.ip);
|
|
|
|
} else {
|
|
|
|
let ruleIndex = rules.findIndex(r => r.ip);
|
|
|
|
if (ruleIndex == -1) ruleIndex = rules.push(this.defaultRules[1]) - 1;
|
|
|
|
|
|
|
|
rules[ruleIndex].ip = [];
|
|
|
|
v.forEach(d => {
|
|
|
|
rules[ruleIndex].ip.push("geoip:" + d);
|
|
|
|
});
|
|
|
|
}
|
2024-09-24 15:57:14 +03:00
|
|
|
this.allSetting.subJsonRules = JSON.stringify(rules);
|
|
|
|
}
|
|
|
|
},
|
2024-10-17 12:25:39 +03:00
|
|
|
directDomains: {
|
2024-09-24 15:57:14 +03:00
|
|
|
get: function () {
|
|
|
|
if (!this.enableDirect) return [];
|
|
|
|
const rules = JSON.parse(this.allSetting.subJsonRules);
|
2024-10-10 23:33:44 +03:00
|
|
|
if (!Array.isArray(rules)) return [];
|
|
|
|
const domainRule = rules.find(r => r.domain);
|
|
|
|
return domainRule?.domain.map(d => {
|
|
|
|
if (d.startsWith("geosite:category-")) {
|
|
|
|
return d.replace("geosite:category-", "");
|
|
|
|
}
|
|
|
|
return d.replace("geosite:", "");
|
|
|
|
})
|
|
|
|
?? [];
|
2024-09-24 15:57:14 +03:00
|
|
|
},
|
|
|
|
set: function (v) {
|
2024-10-10 23:33:44 +03:00
|
|
|
let rules = JSON.parse(this.allSetting.subJsonRules);
|
2024-09-24 15:57:14 +03:00
|
|
|
if (!Array.isArray(rules)) return;
|
|
|
|
|
2024-10-10 23:33:44 +03:00
|
|
|
if (v.length == 0) {
|
|
|
|
rules = rules.filter(r => !r.domain);
|
|
|
|
} else {
|
|
|
|
let ruleIndex = rules.findIndex(r => r.domain);
|
|
|
|
if (ruleIndex == -1) ruleIndex = rules.push(this.defaultRules[0]) - 1;
|
|
|
|
|
|
|
|
rules[ruleIndex].domain = [];
|
|
|
|
v.forEach(d => {
|
|
|
|
let category = '';
|
|
|
|
if (["cn", "apple", "meta", "google"].includes(d)) {
|
|
|
|
category = "";
|
|
|
|
} else if (["ru", "ir"].includes(d)) {
|
|
|
|
category = "category-";
|
|
|
|
}
|
|
|
|
rules[ruleIndex].domain.push("geosite:" + category + d);
|
|
|
|
});
|
|
|
|
}
|
2024-04-02 23:13:16 +03:00
|
|
|
this.allSetting.subJsonRules = JSON.stringify(rules);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
confAlerts: {
|
|
|
|
get: function () {
|
|
|
|
if (!this.allSetting) return [];
|
|
|
|
var alerts = []
|
|
|
|
if (window.location.protocol !== "https:") alerts.push('{{ i18n "secAlertSSL" }}');
|
|
|
|
if (this.allSetting.webPort == 54321) alerts.push('{{ i18n "secAlertPanelPort" }}');
|
|
|
|
panelPath = window.location.pathname.split('/').length < 4
|
|
|
|
if (panelPath && this.allSetting.webBasePath == '/') alerts.push('{{ i18n "secAlertPanelURI" }}');
|
|
|
|
if (this.allSetting.subEnable) {
|
|
|
|
subPath = this.allSetting.subURI.length > 0 ? new URL(this.allSetting.subURI).pathname : this.allSetting.subPath;
|
|
|
|
if (subPath == '/sub/') alerts.push('{{ i18n "secAlertSubURI" }}');
|
|
|
|
subJsonPath = this.allSetting.subJsonURI.length > 0 ? new URL(this.allSetting.subJsonURI).pathname : this.allSetting.subJsonPath;
|
|
|
|
if (subJsonPath == '/json/') alerts.push('{{ i18n "secAlertSubJsonURI" }}');
|
|
|
|
}
|
|
|
|
return alerts
|
2024-02-21 11:36:49 +03:00
|
|
|
}
|
2024-04-02 23:13:16 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
await this.getAllSetting();
|
|
|
|
while (true) {
|
|
|
|
await PromiseUtil.sleep(1000);
|
|
|
|
this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2023-05-08 17:44:22 +03:00
|
|
|
</script>
|
2023-02-09 22:18:06 +03:00
|
|
|
</body>
|
2024-03-09 16:06:16 +03:00
|
|
|
</html>
|