diff --git a/web/assets/css/custom.css b/web/assets/css/custom.css
index 9277a48d..076c4e6d 100644
--- a/web/assets/css/custom.css
+++ b/web/assets/css/custom.css
@@ -257,6 +257,7 @@ body {
.ant-card-dark .ant-progress-text,
.ant-card-dark .ant-modal-close,
.ant-card-dark i,
+.ant-card-dark .ant-pagination-item a,
.ant-card-dark .ant-select-dropdown-menu-item,
.ant-card-dark .ant-calendar-day-select,
.ant-card-dark .ant-calendar-month-select,
@@ -290,6 +291,7 @@ body {
.ant-card-dark .ant-input-number,
.ant-card-dark .ant-input-number-handler-wrap,
.ant-card-dark .ant-calendar-input,
+.ant-card-dark .ant-pagination-item,
.ant-card-dark .ant-select-dropdown-menu-item-selected,
.ant-card-dark .ant-select-selection,
.ant-card-dark .ant-calendar-picker-clear {
@@ -315,6 +317,7 @@ body {
}
.ant-card-dark .ant-modal-content,
+.ant-card-dark .ant-select-dropdown,
.ant-card-dark .ant-modal-body,
.ant-card-dark .ant-modal-header {
color: hsla(0,0%,100%,.65);
@@ -447,4 +450,8 @@ body {
.ant-dark .ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow {
border-color: transparent #2e3b52 #2e3b52 transparent;
+}
+
+.ant-table-pagination.ant-pagination {
+ float: left;
}
\ No newline at end of file
diff --git a/web/assets/js/model/models.js b/web/assets/js/model/models.js
index 49102a48..c59f9060 100644
--- a/web/assets/js/model/models.js
+++ b/web/assets/js/model/models.js
@@ -172,6 +172,7 @@ class AllSetting {
this.webKeyFile = "";
this.webBasePath = "/";
this.sessionMaxAge = "";
+ this.pageSize = 0;
this.expireDiff = "";
this.trafficDiff = "";
this.tgBotEnable = false;
diff --git a/web/controller/setting.go b/web/controller/setting.go
index 51d10d65..c03910e2 100644
--- a/web/controller/setting.go
+++ b/web/controller/setting.go
@@ -66,6 +66,7 @@ func (a *SettingController) getDefaultSettings(c *gin.Context) {
"subCertFile": func() (interface{}, error) { return a.settingService.GetSubCertFile() },
"subEncrypt": func() (interface{}, error) { return a.settingService.GetSubEncrypt() },
"subShowInfo": func() (interface{}, error) { return a.settingService.GetSubShowInfo() },
+ "pageSize": func() (interface{}, error) { return a.settingService.GetPageSize() },
}
result := make(map[string]interface{})
diff --git a/web/entity/entity.go b/web/entity/entity.go
index 8d192ecb..9bb6f17a 100644
--- a/web/entity/entity.go
+++ b/web/entity/entity.go
@@ -24,6 +24,7 @@ type AllSetting struct {
WebKeyFile string `json:"webKeyFile" form:"webKeyFile"`
WebBasePath string `json:"webBasePath" form:"webBasePath"`
SessionMaxAge int `json:"sessionMaxAge" form:"sessionMaxAge"`
+ PageSize int `json:"pageSize" form:"pageSize"`
ExpireDiff int `json:"expireDiff" form:"expireDiff"`
TrafficDiff int `json:"trafficDiff" form:"trafficDiff"`
TgBotEnable bool `json:"tgBotEnable" form:"tgBotEnable"`
diff --git a/web/html/xui/component/setting.html b/web/html/xui/component/setting.html
index 741c7d9f..5e371187 100644
--- a/web/html/xui/component/setting.html
+++ b/web/html/xui/component/setting.html
@@ -15,7 +15,7 @@
- $emit('input', value)" :min="min" style="width: 100%;">
+ $emit('input', value)" :min="min" :step="step" style="width: 100%;">
$emit('input', value)">
@@ -28,7 +28,7 @@
{{define "component/setting"}}
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index b174e0cc..e3dccae2 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -125,13 +125,12 @@
getDBInbounds()">
+ style="margin-top: 20px">
e.preventDefault()" type="menu">
@@ -260,7 +259,7 @@
:row-key="client => client.id"
:columns="innerColumns"
:data-source="getInboundClients(record)"
- :pagination="false"
+ :pagination=pagination(getInboundClients(record))
style="margin-left: 20px;"
>
{{template "client_table"}}
@@ -270,7 +269,7 @@
:row-key="client => client.id"
:columns="innerTrojanColumns"
:data-source="getInboundClients(record)"
- :pagination="false"
+ :pagination=pagination(getInboundClients(record))
style="margin-left: 20px;"
>
{{template "client_table"}}
@@ -291,6 +290,7 @@
align: 'right',
dataIndex: "id",
width: 30,
+ responsive: ["xs"],
}, {
title: '{{ i18n "pages.inbounds.operate" }}',
align: 'center',
@@ -381,6 +381,7 @@
},
tgBotEnable: false,
showAlert: false,
+ pageSize: 0,
},
methods: {
loading(spinning = true) {
@@ -416,6 +417,7 @@
domain: subDomain,
tls: subTLS
};
+ this.pageSize = pageSize;
}
},
setInbounds(dbInbounds) {
@@ -971,6 +973,27 @@
this.spinning = false;
}
},
+ pagination(obj){
+ if (this.pageSize > 0 && obj.length>this.pageSize) {
+ // Set page options based on object size
+ sizeOptions = []
+ for (i=this.pageSize;i<=obj.length;i=i+this.pageSize) {
+ sizeOptions.push(i.toString());
+ }
+ // Add option to see all in one page
+ sizeOptions.push(i.toString());
+
+ p = {
+ showSizeChanger: true,
+ size: 'small',
+ position: 'bottom',
+ pageSize: this.pageSize,
+ pageSizeOptions: sizeOptions
+ }
+ return p
+ }
+ return false
+ }
},
watch: {
searchKey: debounce(function (newVal) {
diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html
index b1312520..85e8cb29 100644
--- a/web/html/xui/settings.html
+++ b/web/html/xui/settings.html
@@ -82,6 +82,7 @@
+
diff --git a/web/service/setting.go b/web/service/setting.go
index 77249d73..f0e6beff 100644
--- a/web/service/setting.go
+++ b/web/service/setting.go
@@ -31,6 +31,7 @@ var defaultValueMap = map[string]string{
"secret": random.Seq(32),
"webBasePath": "/",
"sessionMaxAge": "0",
+ "pageSize": "0",
"expireDiff": "0",
"trafficDiff": "0",
"timeLocation": "Asia/Tehran",
@@ -382,6 +383,10 @@ func (s *SettingService) GetSubShowInfo() (bool, error) {
return s.getBool("subShowInfo")
}
+func (s *SettingService) GetPageSize() (int, error) {
+ return s.getInt("pageSize")
+}
+
func (s *SettingService) UpdateAllSetting(allSetting *entity.AllSetting) error {
if err := allSetting.CheckValid(); err != nil {
return err
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index b4f90d2e..90d54fe1 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -222,6 +222,8 @@
"privateKeyPathDesc" = "Fill in an absolute path starting with '/'"
"panelUrlPath" = "Panel URL Root Path"
"panelUrlPathDesc" = "Must start with '/' and end with '/'"
+"pageSize" = "Pagination size"
+"pageSizeDesc" = "Define page size for inbounds table. Set 0 to disable"
"oldUsername" = "Current Username"
"currentPassword" = "Current Password"
"newUsername" = "New Username"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml
index aa701fc2..90808ad1 100644
--- a/web/translation/translate.fa_IR.toml
+++ b/web/translation/translate.fa_IR.toml
@@ -221,6 +221,8 @@
"privateKeyPathDesc" = "باید یک مسیر مطلق باشد که با / شروع می شود "
"panelUrlPath" = "آدرس روت پنل"
"panelUrlPathDesc" = "باید با '/' شروع شود و با '/' تمام شود"
+"pageSize" = "اندازه صفحه بندی جدول"
+"pageSizeDesc" = "اندازه صفحه را برای جدول سرویس ها تعریف کنید. 0: غیرفعال"
"oldUsername" = "نام کاربری فعلی"
"currentPassword" = "رمز عبور فعلی"
"newUsername" = "نام کاربری جدید"
diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml
index 6ab329e8..20ba8f14 100644
--- a/web/translation/translate.ru_RU.toml
+++ b/web/translation/translate.ru_RU.toml
@@ -222,6 +222,8 @@
"privateKeyPathDesc" = "Введите полный путь, начинающийся с «/»."
"panelUrlPath" = "Корневой путь URL-адреса панели"
"panelUrlPathDesc" = "Должен начинаться с «/» и заканчиваться на «/»."
+"pageSize" = "Размер нумерации страниц"
+"pageSizeDesc" = "Определить размер страницы для входящей таблицы. Установите 0, чтобы отключить"
"oldUsername" = "Текущее имя пользователя"
"currentPassword" = "Текущий пароль"
"newUsername" = "Новое имя пользователя"
diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml
index 1978faf8..f839e9e8 100644
--- a/web/translation/translate.zh_Hans.toml
+++ b/web/translation/translate.zh_Hans.toml
@@ -222,6 +222,8 @@
"privateKeyPathDesc" = "填写一个 '/' 开头的绝对路径"
"panelUrlPath" = "面板 url 根路径"
"panelUrlPathDesc" = "必须以 '/' 开头,以 '/' 结尾"
+"pageSize" = "分页大小"
+"pageSizeDesc" = "定义入站表的页面大小。设置 0 表示禁用"
"oldUsername" = "原用户名"
"currentPassword" = "原密码"
"newUsername" = "新用户名"