|
27 | 27 | <a-card hoverable style="margin-bottom: 20px;">
|
28 | 28 | <a-row>
|
29 | 29 | <a-col :xs="24" :sm="24" :lg="12">
|
30 |
| - upload / download: |
| 30 | + 总上传 / 下载: |
31 | 31 | <a-tag color="green">[[ sizeFormat(total.up) ]] / [[ sizeFormat(total.down) ]]</a-tag>
|
32 | 32 | </a-col>
|
33 | 33 | <a-col :xs="24" :sm="24" :lg="12">
|
34 |
| - total traffic: |
| 34 | + 总用量: |
35 | 35 | <a-tag color="green">[[ sizeFormat(total.up + total.down) ]]</a-tag>
|
36 | 36 | </a-col>
|
37 | 37 | <a-col :xs="24" :sm="24" :lg="12">
|
38 |
| - number of accounts: |
| 38 | + 入站数量: |
39 | 39 | <a-tag color="green">[[ dbInbounds.length ]]</a-tag>
|
40 | 40 | </a-col>
|
41 | 41 | </a-row>
|
|
59 | 59 | <template slot="traffic" slot-scope="text, dbInbound">
|
60 | 60 | <a-tag color="blue">[[ sizeFormat(dbInbound.up) ]]</a-tag>
|
61 | 61 | <a-tag color="green">[[ sizeFormat(dbInbound.down) ]]</a-tag>
|
| 62 | + <a-tag v-if="dbInbound.total > 0" color="cyan">[[ sizeFormat(dbInbound.total) ]]</a-tag> |
| 63 | + <a-tag v-else color="cyan">无限制</a-tag> |
62 | 64 | </template>
|
63 | 65 | <template slot="settings" slot-scope="text, dbInbound">
|
64 | 66 | <a-button type="link">查看</a-button>
|
|
76 | 78 | <template slot="action" slot-scope="text, dbInbound">
|
77 | 79 | <a-button v-if="dbInbound.hasLink()" type="primary" icon="qrcode" @click="showQrcode(dbInbound)"></a-button>
|
78 | 80 | <a-button type="primary" icon="edit" @click="openEditInbound(dbInbound)"></a-button>
|
| 81 | + <a-button icon="retweet" @click="resetTraffic(dbInbound)"></a-button> |
79 | 82 | <a-button type="danger" icon="delete" @click="delInbound(dbInbound)"></a-button>
|
80 | 83 | </template>
|
81 | 84 | </a-table>
|
|
94 | 97 | dataIndex: "id",
|
95 | 98 | width: 60,
|
96 | 99 | }, {
|
97 |
| - title: "protocol", |
| 100 | + title: "协议", |
98 | 101 | align: 'center',
|
99 | 102 | width: 60,
|
100 | 103 | scopedSlots: { customRender: 'protocol' },
|
101 | 104 | }, {
|
102 |
| - title: "port", |
| 105 | + title: "端口", |
103 | 106 | align: 'center',
|
104 | 107 | dataIndex: "port",
|
105 | 108 | width: 60,
|
106 | 109 | }, {
|
107 |
| - title: "traffic", |
| 110 | + title: "流量↑|↓", |
108 | 111 | align: 'center',
|
109 | 112 | width: 60,
|
110 | 113 | scopedSlots: { customRender: 'traffic' },
|
|
119 | 122 | // width: 60,
|
120 | 123 | // scopedSlots: { customRender: 'streamSettings' },
|
121 | 124 | }, {
|
122 |
| - title: "enable", |
| 125 | + title: "启用", |
123 | 126 | align: 'center',
|
124 | 127 | width: 60,
|
125 | 128 | scopedSlots: { customRender: 'enable' },
|
|
172 | 175 | },
|
173 | 176 | openAddInbound() {
|
174 | 177 | inModal.show({
|
175 |
| - title: 'add account', |
176 |
| - okText: 'add', |
| 178 | + title: '添加入站', |
| 179 | + okText: '添加', |
177 | 180 | confirm: async (inbound, dbInbound) => {
|
178 | 181 | inModal.loading();
|
179 | 182 | await this.addInbound(inbound, dbInbound);
|
|
184 | 187 | openEditInbound(dbInbound) {
|
185 | 188 | const inbound = dbInbound.toInbound();
|
186 | 189 | inModal.show({
|
187 |
| - title: 'update account', |
188 |
| - okText: 'update', |
| 190 | + title: '修改入站', |
| 191 | + okText: '修改', |
189 | 192 | inbound: inbound,
|
190 | 193 | dbInbound: dbInbound,
|
191 | 194 | confirm: async (inbound, dbInbound) => {
|
|
197 | 200 | },
|
198 | 201 | async addInbound(inbound, dbInbound) {
|
199 | 202 | const data = {
|
| 203 | + up: dbInbound.up, |
| 204 | + down: dbInbound.down, |
| 205 | + total: dbInbound.total, |
200 | 206 | remark: dbInbound.remark,
|
201 | 207 | enable: dbInbound.enable,
|
202 | 208 |
|
|
211 | 217 | },
|
212 | 218 | async updateInbound(inbound, dbInbound) {
|
213 | 219 | const data = {
|
| 220 | + up: dbInbound.up, |
| 221 | + down: dbInbound.down, |
| 222 | + total: dbInbound.total, |
214 | 223 | remark: dbInbound.remark,
|
215 | 224 | enable: dbInbound.enable,
|
216 | 225 |
|
|
223 | 232 | };
|
224 | 233 | await this.submit(`/xui/inbound/update/${dbInbound.id}`, data, inModal);
|
225 | 234 | },
|
| 235 | + resetTraffic(dbInbound) { |
| 236 | + this.$confirm({ |
| 237 | + title: '重置流量', |
| 238 | + content: '确定要重置流量吗?', |
| 239 | + okText: '重置', |
| 240 | + cancelText: '取消', |
| 241 | + onOk: () => { |
| 242 | + const inbound = dbInbound.toInbound(); |
| 243 | + dbInbound.up = 0; |
| 244 | + dbInbound.down = 0; |
| 245 | + this.updateInbound(inbound, dbInbound); |
| 246 | + }, |
| 247 | + }); |
| 248 | + }, |
226 | 249 | delInbound(dbInbound) {
|
227 | 250 | this.$confirm({
|
228 |
| - title: 'delete account', |
229 |
| - content: 'Cannot be restored after deletion, confirm deletion?', |
230 |
| - okText: 'delete', |
231 |
| - cancelText: 'cancel', |
| 251 | + title: '删除入站', |
| 252 | + content: '确定要删除入站吗?', |
| 253 | + okText: '删除', |
| 254 | + cancelText: '取消', |
232 | 255 | onOk: () => this.submit('/xui/inbound/del/' + dbInbound.id),
|
233 | 256 | });
|
234 | 257 | },
|
235 | 258 | showQrcode(dbInbound) {
|
236 | 259 | let address = location.hostname;
|
237 |
| - if (!ObjectUtil.isEmpty(dbInbound.listen) || dbInbound.listen !== "0.0.0.0") { |
| 260 | + if (!ObjectUtil.isEmpty(dbInbound.listen) && dbInbound.listen !== "0.0.0.0") { |
238 | 261 | address = dbInbound.listen;
|
239 | 262 | }
|
240 | 263 | const link = dbInbound.genLink(address);
|
|
0 commit comments