Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web/html
diff options
context:
space:
mode:
authorkonstpic <156318483+konstpic@users.noreply.github.com>2025-09-28 22:00:16 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-28 22:04:54 +0300
commit28a17a80ec0c4a0f82e8acfca351651d762b3ec9 (patch)
tree7902b7b4cba04bce816ad17c9490f7228574a096 /web/html
parent30565833889171afe5c934f97bc0e767534e8310 (diff)
feat: add ldap component (#3568)
* add ldap component * fix: fix russian comments, tls cert verify default true * feat: remove replaces go mod for local dev
Diffstat (limited to 'web/html')
-rw-r--r--web/html/settings.html23
-rw-r--r--web/html/settings/panel/general.html130
2 files changed, 152 insertions, 1 deletions
diff --git a/web/html/settings.html b/web/html/settings.html
index 22ad3907..26b936fa 100644
--- a/web/html/settings.html
+++ b/web/html/settings.html
@@ -119,6 +119,7 @@
saveBtnDisable: true,
user: {},
lang: LanguageManager.getLanguage(),
+ inboundOptions: [],
remarkModels: { i: 'Inbound', e: 'Email', o: 'Other' },
remarkSeparators: [' ', '-', '_', '@', ':', '~', '|', ',', '.', '/'],
datepickerList: [{ name: 'Gregorian (Standard)', value: 'gregorian' }, { name: 'Jalalian (شمسی)', value: 'jalalian' }],
@@ -242,6 +243,17 @@
this.saveBtnDisable = true;
}
},
+ async loadInboundTags() {
+ const msg = await HttpUtil.get("/panel/api/inbounds/list");
+ if (msg && msg.success && Array.isArray(msg.obj)) {
+ this.inboundOptions = msg.obj.map(ib => ({
+ label: `${ib.tag} (${ib.protocol}@${ib.port})`,
+ value: ib.tag,
+ }));
+ } else {
+ this.inboundOptions = [];
+ }
+ },
async updateAllSetting() {
this.loading(true);
const msg = await HttpUtil.post("/panel/setting/update", this.allSetting);
@@ -368,6 +380,15 @@
},
},
computed: {
+ ldapInboundTagList: {
+ get: function() {
+ const csv = this.allSetting.ldapInboundTags || "";
+ return csv.length ? csv.split(',').map(s => s.trim()).filter(Boolean) : [];
+ },
+ set: function(list) {
+ this.allSetting.ldapInboundTags = Array.isArray(list) ? list.join(',') : '';
+ }
+ },
fragment: {
get: function () { return this.allSetting?.subJsonFragment != ""; },
set: function (v) {
@@ -534,7 +555,7 @@
},
async mounted() {
await this.getAllSetting();
-
+ await this.loadInboundTags();
while (true) {
await PromiseUtil.sleep(1000);
this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
diff --git a/web/html/settings/panel/general.html b/web/html/settings/panel/general.html
index 64fd050c..6969a1b4 100644
--- a/web/html/settings/panel/general.html
+++ b/web/html/settings/panel/general.html
@@ -146,5 +146,135 @@
</template>
</a-setting-list-item>
</a-collapse-panel>
+ <a-collapse-panel key="6" header='LDAP'>
+ <a-setting-list-item paddings="small">
+ <template #title>Enable LDAP sync</template>
+ <template #control>
+ <a-switch v-model="allSetting.ldapEnable"></a-switch>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>LDAP Host</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapHost"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>LDAP Port</template>
+ <template #control>
+ <a-input-number :min="1" :max="65535" v-model="allSetting.ldapPort" :style="{ width: '100%' }"></a-input-number>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Use TLS (LDAPS)</template>
+ <template #control>
+ <a-switch v-model="allSetting.ldapUseTLS"></a-switch>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Bind DN</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapBindDN"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Password</template>
+ <template #control>
+ <a-input type="password" v-model="allSetting.ldapPassword"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Base DN</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapBaseDN"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>User filter</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapUserFilter"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>User attribute (username/email)</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapUserAttr"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>VLESS flag attribute</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapVlessField"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Generic flag attribute (optional)</template>
+ <template #description>If set, overrides VLESS flag; e.g. shadowInactive</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapFlagField"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Truthy values</template>
+ <template #description>Comma-separated; default: true,1,yes,on</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapTruthyValues"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Invert flag</template>
+ <template #description>Enable when attribute means disabled (e.g., shadowInactive)</template>
+ <template #control>
+ <a-switch v-model="allSetting.ldapInvertFlag"></a-switch>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Sync schedule</template>
+ <template #description>cron-like string, e.g. @every 1m</template>
+ <template #control>
+ <a-input type="text" v-model="allSetting.ldapSyncCron"></a-input>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Inbound tags</template>
+ <template #description>Select inbounds to manage (auto create/delete)</template>
+ <template #control>
+ <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" :style="{ width: '100%' }" v-model="ldapInboundTagList">
+ <a-select-option v-for="opt in inboundOptions" :key="opt.value" :value="opt.value">[[ opt.label ]]</a-select-option>
+ </a-select>
+ <div v-if="inboundOptions.length==0" style="margin-top:6px;color:#999">No inbounds found. Please create one in Inbounds.</div>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Auto create clients</template>
+ <template #control>
+ <a-switch v-model="allSetting.ldapAutoCreate"></a-switch>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Auto delete clients</template>
+ <template #control>
+ <a-switch v-model="allSetting.ldapAutoDelete"></a-switch>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Default total (GB)</template>
+ <template #control>
+ <a-input-number :min="0" v-model="allSetting.ldapDefaultTotalGB" :style="{ width: '100%' }"></a-input-number>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Default expiry (days)</template>
+ <template #control>
+ <a-input-number :min="0" v-model="allSetting.ldapDefaultExpiryDays" :style="{ width: '100%' }"></a-input-number>
+ </template>
+ </a-setting-list-item>
+ <a-setting-list-item paddings="small">
+ <template #title>Default Limit IP</template>
+ <template #control>
+ <a-input-number :min="0" v-model="allSetting.ldapDefaultLimitIP" :style="{ width: '100%' }"></a-input-number>
+ </template>
+ </a-setting-list-item>
+ </a-collapse-panel>
</a-collapse>
{{end}} \ No newline at end of file