diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-05-06 18:50:42 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-05-06 18:50:42 +0300 |
| commit | 735df6bd4ed18d656355067826a6f5e50495c63e (patch) | |
| tree | 280e6477c0122aa132aac35011bf19a07e509c08 /web | |
| parent | 0e77547e98d11d4428491ab039072f7beab81702 (diff) | |
[feature] inbounds manual refresh
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web')
| -rw-r--r-- | web/html/xui/inbounds.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index e697b8a1..2792eb75 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -99,7 +99,7 @@ :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> <a-select-option v-for="key in [5,10,30,60]" :value="key*1000">[[ key ]]s</a-select-option> </a-select> - <a-icon type="sync" :spin="isRefreshEnabled" style="margin: 0 5px;"></a-icon> + <a-icon type="sync" :spin="refreshing" @click="manualRefresh" style="margin: 0 5px;"></a-icon> <a-switch v-model="isRefreshEnabled" @change="toggleRefresh"></a-switch> </a-col> </a-row> @@ -331,6 +331,7 @@ defaultKey: '', clientCount: {}, isRefreshEnabled: localStorage.getItem("isRefreshEnabled") === "true" ? true : false, + refreshing: false, refreshInterval: Number(localStorage.getItem("refreshInterval")) || 5000, }, methods: { @@ -338,11 +339,13 @@ this.spinning = spinning; }, async getDBInbounds() { + this.refreshing = true; const msg = await HttpUtil.post('/xui/inbound/list'); if (!msg.success) { return; } this.setInbounds(msg.obj); + this.refreshing = false; }, async getDefaultSettings() { const msg = await HttpUtil.post('/xui/setting/defaultSettings'); @@ -818,6 +821,13 @@ changeRefreshInterval(){ localStorage.setItem("refreshInterval", this.refreshInterval); }, + async manualRefresh(){ + if(!this.refreshing){ + this.spinning = true; + await this.getDBInbounds(); + this.spinning = false; + } + }, }, watch: { searchKey: debounce(function (newVal) { |
