diff --git a/database/model/model.go b/database/model/model.go
index bc023508..d300c6cf 100644
--- a/database/model/model.go
+++ b/database/model/model.go
@@ -49,7 +49,6 @@ type Inbound struct {
Up int64 `json:"up" form:"up"` // Upload traffic in bytes
Down int64 `json:"down" form:"down"` // Download traffic in bytes
Total int64 `json:"total" form:"total"` // Total traffic limit in bytes
- AllTime int64 `json:"allTime" form:"allTime" gorm:"default:0"` // All-time traffic usage
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
diff --git a/frontend/src/models/dbinbound.js b/frontend/src/models/dbinbound.js
index d7a9483e..7390edb9 100644
--- a/frontend/src/models/dbinbound.js
+++ b/frontend/src/models/dbinbound.js
@@ -10,7 +10,6 @@ export class DBInbound {
this.up = 0;
this.down = 0;
this.total = 0;
- this.allTime = 0;
this.remark = "";
this.enable = true;
this.expiryTime = 0;
diff --git a/frontend/src/pages/clients/ClientInfoModal.vue b/frontend/src/pages/clients/ClientInfoModal.vue
index 5e9da4ec..d1151fff 100644
--- a/frontend/src/pages/clients/ClientInfoModal.vue
+++ b/frontend/src/pages/clients/ClientInfoModal.vue
@@ -203,13 +203,6 @@ function close() {
-
| {{ t('pages.inbounds.expireDate') || 'Expiry' }} |
diff --git a/frontend/src/pages/inbounds/ClientRowTable.vue b/frontend/src/pages/inbounds/ClientRowTable.vue
index e99953c1..5fdd2067 100644
--- a/frontend/src/pages/inbounds/ClientRowTable.vue
+++ b/frontend/src/pages/inbounds/ClientRowTable.vue
@@ -86,14 +86,6 @@ function getRem(email) {
const r = s.total - s.up - s.down;
return r > 0 ? r : 0;
}
-function getAllTime(email) {
- const s = statsFor(email);
- if (!s) return 0;
- // allTime is the cumulative-historical counter; never let it dip
- // below up+down (manual edits / partial migrations can push it under).
- const current = (s.up || 0) + (s.down || 0);
- return s.allTime > current ? s.allTime : current;
-}
function isClientDepleted(email) {
const s = statsFor(email);
if (!s) return false;
@@ -286,7 +278,6 @@ function confirmBulkDelete() {
{{ t('pages.inbounds.client') }}
{{ t('pages.inbounds.traffic') }}
{{ t('remained') }}
- {{ t('pages.inbounds.allTimeTraffic') }}
{{ t('pages.inbounds.expireDate') }}
@@ -388,10 +379,6 @@ function confirmBulkDelete() {
-
- {{ SizeFormatter.sizeFormat(getAllTime(client.email)) }}
-
-
@@ -499,10 +486,6 @@ function confirmBulkDelete() {
{{ SizeFormatter.sizeFormat(getRem(statsClient.email)) }}
-
- {{ t('pages.inbounds.allTimeTraffic') }}
- {{ SizeFormatter.sizeFormat(getAllTime(statsClient.email)) }}
-
{{ t('online') }}
{{ t('online')
@@ -571,8 +554,6 @@ function confirmBulkDelete() {
minmax(160px, 2fr)
/* traffic */
130px
- /* all-time */
- 130px
/* remained */
140px;
/* expiry */
@@ -597,8 +578,6 @@ function confirmBulkDelete() {
minmax(160px, 2fr)
/* traffic */
130px
- /* all-time */
- 130px
/* remained */
140px;
/* expiry */
@@ -628,7 +607,6 @@ function confirmBulkDelete() {
.cell-actions,
.cell-enable,
.cell-online,
-.cell-alltime,
.cell-remained {
text-align: center;
display: inline-flex;
diff --git a/frontend/src/pages/inbounds/InboundList.vue b/frontend/src/pages/inbounds/InboundList.vue
index 180582af..0a50ab9d 100644
--- a/frontend/src/pages/inbounds/InboundList.vue
+++ b/frontend/src/pages/inbounds/InboundList.vue
@@ -189,7 +189,6 @@ const sortFns = {
port: (a, b) => a.port - b.port,
protocol: (a, b) => a.protocol.localeCompare(b.protocol),
traffic: (a, b) => (a.up + a.down) - (b.up + b.down),
- allTimeInbound: (a, b) => (a.allTime || 0) - (b.allTime || 0),
expiryTime: (a, b) => (a.expiryTime || Infinity) - (b.expiryTime || Infinity),
node: (a, b) => {
const nameA = props.nodesById.get(a.nodeId)?.name ?? (a.nodeId == null ? '\uffff' : `node #${a.nodeId}`);
@@ -244,7 +243,6 @@ const desktopColumns = computed(() => {
sortableCol({ title: t('pages.inbounds.protocol'), key: 'protocol', align: 'left', width: 130 }, 'protocol'),
sortableCol({ title: t('clients'), key: 'clients', align: 'left', width: 50 }, 'clients'),
sortableCol({ title: t('pages.inbounds.traffic'), key: 'traffic', align: 'center', width: 90 }, 'traffic'),
- sortableCol({ title: t('pages.inbounds.allTimeTraffic'), key: 'allTimeInbound', align: 'center', width: 95 }, 'allTimeInbound'),
sortableCol({ title: t('pages.inbounds.expireDate'), key: 'expiryTime', align: 'center', width: 40 }, 'expiryTime'),
);
return cols;
@@ -515,10 +513,6 @@ function showQrCodeMenu(dbInbound) {
-
- {{ t('pages.inbounds.allTimeTraffic') }}
- {{ SizeFormatter.sizeFormat(statsRecord.allTime || 0) }}
-
{{ t('clients') }}
{{ clientCount[statsRecord.id].clients }}
@@ -735,11 +729,6 @@ function showQrCodeMenu(dbInbound) {
-
-
- {{ SizeFormatter.sizeFormat(record.allTime || 0) }}
-
-
diff --git a/frontend/src/pages/inbounds/InboundsPage.vue b/frontend/src/pages/inbounds/InboundsPage.vue
index 778206fa..e2a7cf7e 100644
--- a/frontend/src/pages/inbounds/InboundsPage.vue
+++ b/frontend/src/pages/inbounds/InboundsPage.vue
@@ -5,7 +5,6 @@ import { Modal, message } from 'ant-design-vue';
import {
SwapOutlined,
PieChartOutlined,
- HistoryOutlined,
BarsOutlined,
TeamOutlined,
} from '@ant-design/icons-vue';
@@ -582,14 +581,6 @@ function onRowAction({ key, dbInbound }) {
-
-
-
-
-
-
-
diff --git a/frontend/src/pages/inbounds/useInbounds.js b/frontend/src/pages/inbounds/useInbounds.js
index d6c842ee..f28b2c6c 100644
--- a/frontend/src/pages/inbounds/useInbounds.js
+++ b/frontend/src/pages/inbounds/useInbounds.js
@@ -195,7 +195,6 @@ export function useInbounds() {
if (!upd) continue;
if (typeof upd.up === 'number') ib.up = upd.up;
if (typeof upd.down === 'number') ib.down = upd.down;
- if (typeof upd.allTime === 'number') ib.allTime = upd.allTime;
if (typeof upd.total === 'number') ib.total = upd.total;
if (typeof upd.enable === 'boolean') ib.enable = upd.enable;
touched = true;
@@ -216,7 +215,6 @@ export function useInbounds() {
if (typeof upd.up === 'number') stat.up = upd.up;
if (typeof upd.down === 'number') stat.down = upd.down;
if (typeof upd.total === 'number') stat.total = upd.total;
- if (typeof upd.allTime === 'number') stat.allTime = upd.allTime;
if (typeof upd.expiryTime === 'number') stat.expiryTime = upd.expiryTime;
if (typeof upd.enable === 'boolean') stat.enable = upd.enable;
touched = true;
@@ -283,12 +281,9 @@ export function useInbounds() {
}
}
- // Aggregate totals shown in the dashboard summary card. allTime falls
- // back to up+down when the per-inbound counter isn't populated yet.
const totals = computed(() => {
let up = 0;
let down = 0;
- let allTime = 0;
let clients = 0;
const deactive = [];
const depleted = [];
@@ -297,7 +292,6 @@ export function useInbounds() {
for (const ib of dbInbounds.value) {
up += ib.up || 0;
down += ib.down || 0;
- allTime += ib.allTime || (ib.up + ib.down) || 0;
const c = clientCount.value[ib.id];
if (c) {
clients += c.clients;
@@ -307,7 +301,7 @@ export function useInbounds() {
online.push(...c.online);
}
}
- return { up, down, allTime, clients, deactive, depleted, expiring, online };
+ return { up, down, clients, deactive, depleted, expiring, online };
});
// ObjectUtil reference is wired at module load — keeping a no-op import
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 00d2dc15..f67854f4 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -1700,7 +1700,6 @@ func (s *InboundService) setRemoteTrafficLocked(nodeID int, snap *runtime.Traffi
ExpiryTime: snapIb.ExpiryTime,
Up: snapIb.Up,
Down: snapIb.Down,
- AllTime: snapIb.AllTime,
}
if err := tx.Create(&newIb).Error; err != nil {
logger.Warning("setRemoteTraffic: create central inbound for tag", snapIb.Tag, "failed:", err)
@@ -1730,9 +1729,6 @@ func (s *InboundService) setRemoteTrafficLocked(nodeID int, snap *runtime.Traffi
updates["up"] = snapIb.Up
updates["down"] = snapIb.Down
}
- if snapIb.AllTime > c.AllTime {
- updates["all_time"] = snapIb.AllTime
- }
if c.Settings != snapIb.Settings ||
c.Remark != snapIb.Remark ||
@@ -1792,7 +1788,6 @@ func (s *InboundService) setRemoteTrafficLocked(nodeID int, snap *runtime.Traffi
Reset: cs.Reset,
Up: cs.Up,
Down: cs.Down,
- AllTime: cs.AllTime,
LastOnline: cs.LastOnline,
}).Error; err != nil {
return false, err
@@ -1808,17 +1803,12 @@ func (s *InboundService) setRemoteTrafficLocked(nodeID int, snap *runtime.Traffi
structuralChange = true
}
- allTime := existing.AllTime
- if cs.AllTime > allTime {
- allTime = cs.AllTime
- }
-
if inGrace && cs.Up+cs.Down > 0 {
if err := tx.Exec(
`UPDATE client_traffics
- SET enable = ?, total = ?, expiry_time = ?, reset = ?, all_time = ?
+ SET enable = ?, total = ?, expiry_time = ?, reset = ?
WHERE inbound_id = ? AND email = ?`,
- cs.Enable, cs.Total, cs.ExpiryTime, cs.Reset, allTime, c.Id, cs.Email,
+ cs.Enable, cs.Total, cs.ExpiryTime, cs.Reset, c.Id, cs.Email,
).Error; err != nil {
return false, err
}
@@ -1828,9 +1818,9 @@ func (s *InboundService) setRemoteTrafficLocked(nodeID int, snap *runtime.Traffi
if err := tx.Exec(
`UPDATE client_traffics
SET up = ?, down = ?, enable = ?, total = ?, expiry_time = ?, reset = ?,
- all_time = ?, last_online = MAX(last_online, ?)
+ last_online = MAX(last_online, ?)
WHERE inbound_id = ? AND email = ?`,
- cs.Up, cs.Down, cs.Enable, cs.Total, cs.ExpiryTime, cs.Reset, allTime,
+ cs.Up, cs.Down, cs.Enable, cs.Total, cs.ExpiryTime, cs.Reset,
cs.LastOnline, c.Id, cs.Email,
).Error; err != nil {
return false, err
@@ -1930,9 +1920,8 @@ func (s *InboundService) addInboundTraffic(tx *gorm.DB, traffics []*xray.Traffic
if traffic.IsInbound {
err = tx.Model(&model.Inbound{}).Where("tag = ? AND node_id IS NULL", traffic.Tag).
Updates(map[string]any{
- "up": gorm.Expr("up + ?", traffic.Up),
- "down": gorm.Expr("down + ?", traffic.Down),
- "all_time": gorm.Expr("COALESCE(all_time, 0) + ?", traffic.Up+traffic.Down),
+ "up": gorm.Expr("up + ?", traffic.Up),
+ "down": gorm.Expr("down + ?", traffic.Down),
}).Error
if err != nil {
return err
@@ -1987,7 +1976,6 @@ func (s *InboundService) addClientTraffic(tx *gorm.DB, traffics []*xray.ClientTr
}
dbClientTraffics[dbTraffic_index].Up += t.Up
dbClientTraffics[dbTraffic_index].Down += t.Down
- dbClientTraffics[dbTraffic_index].AllTime += t.Up + t.Down
if t.Up+t.Down > 0 {
dbClientTraffics[dbTraffic_index].LastOnline = now
}
@@ -3449,19 +3437,18 @@ func (s *InboundService) GetAllClientTraffics() ([]*xray.ClientTraffic, error) {
}
type InboundTrafficSummary struct {
- Id int `json:"id"`
- Up int64 `json:"up"`
- Down int64 `json:"down"`
- Total int64 `json:"total"`
- AllTime int64 `json:"allTime"`
- Enable bool `json:"enable"`
+ Id int `json:"id"`
+ Up int64 `json:"up"`
+ Down int64 `json:"down"`
+ Total int64 `json:"total"`
+ Enable bool `json:"enable"`
}
func (s *InboundService) GetInboundsTrafficSummary() ([]InboundTrafficSummary, error) {
db := database.GetDB()
var summaries []InboundTrafficSummary
if err := db.Model(&model.Inbound{}).
- Select("id, up, down, total, all_time, enable").
+ Select("id, up, down, total, enable").
Find(&summaries).Error; err != nil {
return nil, err
}
@@ -3489,9 +3476,8 @@ func (s *InboundService) UpdateClientTrafficByEmail(email string, upload int64,
err := db.Model(xray.ClientTraffic{}).
Where("email = ?", email).
Updates(map[string]any{
- "up": upload,
- "down": download,
- "all_time": gorm.Expr("CASE WHEN COALESCE(all_time, 0) < ? THEN ? ELSE all_time END", upload+download, upload+download),
+ "up": upload,
+ "down": download,
}).Error
if err != nil {
logger.Warningf("Error updating ClientTraffic with email %s: %v", email, err)
@@ -3664,23 +3650,15 @@ func (s *InboundService) MigrationRequirements() {
}
}()
- // Calculate and backfill all_time from up+down for inbounds and clients
- err = tx.Exec(`
- UPDATE inbounds
- SET all_time = IFNULL(up, 0) + IFNULL(down, 0)
- WHERE IFNULL(all_time, 0) = 0 AND (IFNULL(up, 0) + IFNULL(down, 0)) > 0
- `).Error
- if err != nil {
- return
+ if tx.Migrator().HasColumn(&model.Inbound{}, "all_time") {
+ if err = tx.Migrator().DropColumn(&model.Inbound{}, "all_time"); err != nil {
+ return
+ }
}
- err = tx.Exec(`
- UPDATE client_traffics
- SET all_time = IFNULL(up, 0) + IFNULL(down, 0)
- WHERE IFNULL(all_time, 0) = 0 AND (IFNULL(up, 0) + IFNULL(down, 0)) > 0
- `).Error
-
- if err != nil {
- return
+ if tx.Migrator().HasColumn(&xray.ClientTraffic{}, "all_time") {
+ if err = tx.Migrator().DropColumn(&xray.ClientTraffic{}, "all_time"); err != nil {
+ return
+ }
}
// Fix inbounds based problems
diff --git a/web/translation/ar-EG.json b/web/translation/ar-EG.json
index ecf1c19d..0b37172b 100644
--- a/web/translation/ar-EG.json
+++ b/web/translation/ar-EG.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "لا توجد مصادر geo مخصصة بعد — انقر على «إضافة» لإنشاء واحد"
},
"inbounds": {
- "allTimeTraffic": "إجمالي حركة المرور",
- "allTimeTrafficUsage": "إجمالي الاستخدام طوال الوقت",
"title": "الإدخالات",
"totalDownUp": "إجمالي المرسل/المستقبل",
"totalUsage": "إجمالي الاستخدام",
diff --git a/web/translation/en-US.json b/web/translation/en-US.json
index c93ca5b0..47b6b603 100644
--- a/web/translation/en-US.json
+++ b/web/translation/en-US.json
@@ -238,8 +238,6 @@
"getConfigError": "An error occurred while retrieving the config file."
},
"inbounds": {
- "allTimeTraffic": "All-time Traffic",
- "allTimeTrafficUsage": "All-Time Total Usage",
"title": "Inbounds",
"totalDownUp": "Total Sent/Received",
"totalUsage": "Total Usage",
@@ -1028,4 +1026,4 @@
"chooseInbound": "Choose an Inbound"
}
}
-}
\ No newline at end of file
+}
diff --git a/web/translation/es-ES.json b/web/translation/es-ES.json
index 34af89ca..664b4718 100644
--- a/web/translation/es-ES.json
+++ b/web/translation/es-ES.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "Aún no hay fuentes geo personalizadas — haz clic en Añadir para crear una"
},
"inbounds": {
- "allTimeTraffic": "Tráfico Total",
- "allTimeTrafficUsage": "Uso de datos histórico",
"title": "Entradas",
"totalDownUp": "Subidas/Descargas Totales",
"totalUsage": "Uso Total",
diff --git a/web/translation/fa-IR.json b/web/translation/fa-IR.json
index fd948788..5c57b685 100644
--- a/web/translation/fa-IR.json
+++ b/web/translation/fa-IR.json
@@ -240,8 +240,6 @@
"node": "نود",
"deployTo": "استقرار روی",
"localPanel": "پنل لوکال",
- "allTimeTraffic": "کل ترافیک",
- "allTimeTrafficUsage": "کل استفاده در تمام مدت",
"title": "کاربران",
"totalDownUp": "دریافت/ارسال کل",
"totalUsage": "مصرف کل",
diff --git a/web/translation/id-ID.json b/web/translation/id-ID.json
index b8f44ac6..297c3bce 100644
--- a/web/translation/id-ID.json
+++ b/web/translation/id-ID.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "Belum ada sumber geo kustom — klik Tambah untuk membuatnya"
},
"inbounds": {
- "allTimeTraffic": "Total Lalu Lintas",
- "allTimeTrafficUsage": "Total Penggunaan Sepanjang Waktu",
"title": "Masuk",
"totalDownUp": "Total Terkirim/Diterima",
"totalUsage": "Penggunaan Total",
diff --git a/web/translation/ja-JP.json b/web/translation/ja-JP.json
index 630f5623..4c562752 100644
--- a/web/translation/ja-JP.json
+++ b/web/translation/ja-JP.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "カスタム geo ソースはまだありません — 「追加」をクリックして作成してください"
},
"inbounds": {
- "allTimeTraffic": "総トラフィック",
- "allTimeTrafficUsage": "これまでの総使用量",
"title": "インバウンド一覧",
"totalDownUp": "総アップロード / ダウンロード",
"totalUsage": "総使用量",
diff --git a/web/translation/pt-BR.json b/web/translation/pt-BR.json
index 9f1b67d7..cc5ceaba 100644
--- a/web/translation/pt-BR.json
+++ b/web/translation/pt-BR.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "Ainda não há fontes geo personalizadas — clique em Adicionar para criar uma"
},
"inbounds": {
- "allTimeTraffic": "Tráfego Total",
- "allTimeTrafficUsage": "Uso total de todos os tempos",
"title": "Inbounds",
"totalDownUp": "Total Enviado/Recebido",
"totalUsage": "Uso Total",
diff --git a/web/translation/ru-RU.json b/web/translation/ru-RU.json
index f7ddafa6..a258e5ad 100644
--- a/web/translation/ru-RU.json
+++ b/web/translation/ru-RU.json
@@ -237,8 +237,6 @@
"getConfigError": "Произошла ошибка при получении конфигурационного файла"
},
"inbounds": {
- "allTimeTraffic": "Общий трафик",
- "allTimeTrafficUsage": "Общее использование за все время",
"title": "Подключения",
"totalDownUp": "Отправлено/получено",
"totalUsage": "Всего трафика",
diff --git a/web/translation/tr-TR.json b/web/translation/tr-TR.json
index a8dc2c3c..3993163b 100644
--- a/web/translation/tr-TR.json
+++ b/web/translation/tr-TR.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "Henüz özel geo kaynağı yok — oluşturmak için Ekle'ye tıklayın"
},
"inbounds": {
- "allTimeTraffic": "Toplam Trafik",
- "allTimeTrafficUsage": "Tüm Zamanların Toplam Kullanımı",
"title": "Gelenler",
"totalDownUp": "Toplam Gönderilen/Alınan",
"totalUsage": "Toplam Kullanım",
diff --git a/web/translation/uk-UA.json b/web/translation/uk-UA.json
index 417866d1..d40ab85b 100644
--- a/web/translation/uk-UA.json
+++ b/web/translation/uk-UA.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "Користувацьких джерел geo поки немає — натисніть «Додати», щоб створити"
},
"inbounds": {
- "allTimeTraffic": "Загальний трафік",
- "allTimeTrafficUsage": "Загальне використання за весь час",
"title": "Вхідні",
"totalDownUp": "Всього надісланих/отриманих",
"totalUsage": "Всього використанно",
diff --git a/web/translation/vi-VN.json b/web/translation/vi-VN.json
index b292c058..a99ef339 100644
--- a/web/translation/vi-VN.json
+++ b/web/translation/vi-VN.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "Chưa có nguồn geo tùy chỉnh nào — nhấp Thêm để tạo"
},
"inbounds": {
- "allTimeTraffic": "Tổng Lưu Lượng",
- "allTimeTrafficUsage": "Tổng mức sử dụng mọi lúc",
"title": "Điểm vào (Inbounds)",
"totalDownUp": "Tổng tải lên/tải xuống",
"totalUsage": "Tổng sử dụng",
diff --git a/web/translation/zh-CN.json b/web/translation/zh-CN.json
index 3f648cb2..0dea1cb8 100644
--- a/web/translation/zh-CN.json
+++ b/web/translation/zh-CN.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "暂无自定义 geo 源 — 点击「添加」以创建"
},
"inbounds": {
- "allTimeTraffic": "累计总流量",
- "allTimeTrafficUsage": "所有时间总使用量",
"title": "入站列表",
"totalDownUp": "总上传 / 下载",
"totalUsage": "总用量",
diff --git a/web/translation/zh-TW.json b/web/translation/zh-TW.json
index a28c0e0f..6f217958 100644
--- a/web/translation/zh-TW.json
+++ b/web/translation/zh-TW.json
@@ -237,8 +237,6 @@
"customGeoEmpty": "尚無自訂 geo 來源 — 點擊「新增」以建立"
},
"inbounds": {
- "allTimeTraffic": "累計總流量",
- "allTimeTrafficUsage": "所有时间总使用量",
"title": "入站列表",
"totalDownUp": "總上傳 / 下載",
"totalUsage": "總用量",
diff --git a/xray/client_traffic.go b/xray/client_traffic.go
index fcb2585e..c936c366 100644
--- a/xray/client_traffic.go
+++ b/xray/client_traffic.go
@@ -11,7 +11,6 @@ type ClientTraffic struct {
SubId string `json:"subId" form:"subId" gorm:"-"`
Up int64 `json:"up" form:"up"`
Down int64 `json:"down" form:"down"`
- AllTime int64 `json:"allTime" form:"allTime"`
ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
Total int64 `json:"total" form:"total"`
Reset int `json:"reset" form:"reset" gorm:"default:0"`
|