diff --git a/database/model/model.go b/database/model/model.go index 1865d1a9..98252f62 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -42,6 +42,7 @@ type Inbound struct { Remark string `json:"remark" form:"remark"` // Human-readable remark Enable bool `json:"enable" form:"enable" gorm:"index:idx_enable_traffic_reset,priority:1"` // Whether the inbound is enabled ExpiryTime int64 `json:"expiryTime" form:"expiryTime"` // Expiration timestamp + DeviceLimit int `json:"deviceLimit" form:"deviceLimit" gorm:"column:device_limit;default:0"` // Active device/IP limit by inbound TrafficReset string `json:"trafficReset" form:"trafficReset" gorm:"default:never;index:idx_enable_traffic_reset,priority:2"` // Traffic reset schedule LastTrafficResetTime int64 `json:"lastTrafficResetTime" form:"lastTrafficResetTime" gorm:"default:0"` // Last traffic reset timestamp ClientStats []xray.ClientTraffic `gorm:"foreignKey:InboundId;references:Id" json:"clientStats" form:"clientStats"` // Client traffic statistics diff --git a/web/assets/js/model/dbinbound.js b/web/assets/js/model/dbinbound.js index befc618e..ea20d855 100644 --- a/web/assets/js/model/dbinbound.js +++ b/web/assets/js/model/dbinbound.js @@ -10,6 +10,7 @@ class DBInbound { this.remark = ""; this.enable = true; this.expiryTime = 0; + this.deviceLimit = 0; this.trafficReset = "never"; this.lastTrafficResetTime = 0; @@ -148,4 +149,4 @@ class DBInbound { const inbound = this.toInbound(); return inbound.genInboundLinks(this.remark, remarkModel); } -} \ No newline at end of file +} diff --git a/web/html/form/client.html b/web/html/form/client.html index 3cc13b89..cf99e3b3 100644 --- a/web/html/form/client.html +++ b/web/html/form/client.html @@ -18,7 +18,7 @@ mode="combobox" show-search allow-clear - :filter-option="filterEmailOption" + :filter-option="(input, option) => String(option.componentOptions?.propsData?.value || '').toLowerCase().includes(String(input || '').toLowerCase())" :dropdown-class-name="themeSwitcher.currentTheme" :not-found-content="emailOptions.length === 0 ? null : undefined" :placeholder='{{ printf "%q" (i18n "pages.inbounds.emailSelectPlaceholder") }}'> diff --git a/web/html/form/inbound.html b/web/html/form/inbound.html index 8b59dc28..dcce4e0f 100644 --- a/web/html/form/inbound.html +++ b/web/html/form/inbound.html @@ -49,6 +49,20 @@ :min="0"> + + + + +