diff --git a/database/model/model.go b/database/model/model.go
index 18211ef8..9d9fb0ef 100644
--- a/database/model/model.go
+++ b/database/model/model.go
@@ -27,16 +27,17 @@ type User struct {
}
type Inbound struct {
- Id int `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
- UserId int `json:"-"`
- Up int64 `json:"up" form:"up"`
- Down int64 `json:"down" form:"down"`
- Total int64 `json:"total" form:"total"`
- AllTime int64 `json:"allTime" form:"allTime" gorm:"default:0"`
- Remark string `json:"remark" form:"remark"`
- Enable bool `json:"enable" form:"enable"`
- ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
- ClientStats []xray.ClientTraffic `gorm:"foreignKey:InboundId;references:Id" json:"clientStats" form:"clientStats"`
+ Id int `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
+ UserId int `json:"-"`
+ Up int64 `json:"up" form:"up"`
+ Down int64 `json:"down" form:"down"`
+ Total int64 `json:"total" form:"total"`
+ AllTime int64 `json:"allTime" form:"allTime" gorm:"default:0"`
+ Remark string `json:"remark" form:"remark"`
+ Enable bool `json:"enable" form:"enable"`
+ ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
+ PeriodicTrafficReset string `json:"periodicTrafficReset" form:"periodicTrafficReset" gorm:"default:never"`
+ ClientStats []xray.ClientTraffic `gorm:"foreignKey:InboundId;references:Id" json:"clientStats" form:"clientStats"`
// config part
Listen string `json:"listen" form:"listen"`
@@ -90,19 +91,20 @@ type Setting struct {
}
type Client struct {
- ID string `json:"id"`
- Security string `json:"security"`
- Password string `json:"password"`
- Flow string `json:"flow"`
- Email string `json:"email"`
- LimitIP int `json:"limitIp"`
- TotalGB int64 `json:"totalGB" form:"totalGB"`
- ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
- Enable bool `json:"enable" form:"enable"`
- TgID int64 `json:"tgId" form:"tgId"`
- SubID string `json:"subId" form:"subId"`
- Comment string `json:"comment" form:"comment"`
- Reset int `json:"reset" form:"reset"`
- CreatedAt int64 `json:"created_at,omitempty"`
- UpdatedAt int64 `json:"updated_at,omitempty"`
+ ID string `json:"id"`
+ Security string `json:"security"`
+ Password string `json:"password"`
+ Flow string `json:"flow"`
+ Email string `json:"email"`
+ LimitIP int `json:"limitIp"`
+ TotalGB int64 `json:"totalGB" form:"totalGB"`
+ ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
+ Enable bool `json:"enable" form:"enable"`
+ TgID int64 `json:"tgId" form:"tgId"`
+ SubID string `json:"subId" form:"subId"`
+ Comment string `json:"comment" form:"comment"`
+ Reset int `json:"reset" form:"reset"`
+ PeriodicTrafficReset string `json:"periodicTrafficReset" form:"periodicTrafficReset"`
+ CreatedAt int64 `json:"created_at,omitempty"`
+ UpdatedAt int64 `json:"updated_at,omitempty"`
}
diff --git a/web/assets/js/model/dbinbound.js b/web/assets/js/model/dbinbound.js
index acb62ce4..8687e781 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.periodicTrafficReset = "never";
this.listen = "";
this.port = 0;
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js
index c91dbd11..ec70a3c0 100644
--- a/web/assets/js/model/inbound.js
+++ b/web/assets/js/model/inbound.js
@@ -1792,6 +1792,7 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass {
subId = RandomUtil.randomLowerAndNum(16),
comment = '',
reset = 0,
+ periodicTrafficReset = 'never',
created_at = undefined,
updated_at = undefined
) {
@@ -1807,6 +1808,7 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass {
this.subId = subId;
this.comment = comment;
this.reset = reset;
+ this.periodicTrafficReset = periodicTrafficReset;
this.created_at = created_at;
this.updated_at = updated_at;
}
@@ -1824,6 +1826,7 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass {
json.subId,
json.comment,
json.reset,
+ json.periodicTrafficReset,
json.created_at,
json.updated_at,
);
@@ -1907,6 +1910,7 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
subId = RandomUtil.randomLowerAndNum(16),
comment = '',
reset = 0,
+ periodicTrafficReset = 'never',
created_at = undefined,
updated_at = undefined
) {
@@ -1922,6 +1926,7 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
this.subId = subId;
this.comment = comment;
this.reset = reset;
+ this.periodicTrafficReset = periodicTrafficReset;
this.created_at = created_at;
this.updated_at = updated_at;
}
@@ -1939,6 +1944,7 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
json.subId,
json.comment,
json.reset,
+ json.periodicTrafficReset,
json.created_at,
json.updated_at,
);
@@ -2052,6 +2058,7 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass {
subId = RandomUtil.randomLowerAndNum(16),
comment = '',
reset = 0,
+ periodicTrafficReset = 'never',
created_at = undefined,
updated_at = undefined
) {
@@ -2066,6 +2073,7 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass {
this.subId = subId;
this.comment = comment;
this.reset = reset;
+ this.periodicTrafficReset = periodicTrafficReset;
this.created_at = created_at;
this.updated_at = updated_at;
}
@@ -2082,6 +2090,7 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass {
subId: this.subId,
comment: this.comment,
reset: this.reset,
+ periodicTrafficReset: this.periodicTrafficReset,
created_at: this.created_at,
updated_at: this.updated_at,
};
@@ -2099,6 +2108,7 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass {
json.subId,
json.comment,
json.reset,
+ json.periodicTrafficReset,
json.created_at,
json.updated_at,
);
@@ -2221,6 +2231,7 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass {
subId = RandomUtil.randomLowerAndNum(16),
comment = '',
reset = 0,
+ periodicTrafficReset = 'never',
created_at = undefined,
updated_at = undefined
) {
@@ -2236,6 +2247,7 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass {
this.subId = subId;
this.comment = comment;
this.reset = reset;
+ this.periodicTrafficReset = periodicTrafficReset;
this.created_at = created_at;
this.updated_at = updated_at;
}
@@ -2253,6 +2265,7 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass {
subId: this.subId,
comment: this.comment,
reset: this.reset,
+ periodicTrafficReset: this.periodicTrafficReset,
created_at: this.created_at,
updated_at: this.updated_at,
};
@@ -2271,6 +2284,7 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass {
json.subId,
json.comment,
json.reset,
+ json.periodicTrafficReset,
json.created_at,
json.updated_at,
);
diff --git a/web/html/form/client.html b/web/html/form/client.html
index 908f28d2..fd205def 100644
--- a/web/html/form/client.html
+++ b/web/html/form/client.html
@@ -168,5 +168,23 @@