|
2 | 2 | <div> |
3 | 3 | <div class="provider-section" v-for="(item, key, index) in data" :key="index"> |
4 | 4 | <div class="provider-header"> |
5 | | - <div class="d-flex align-items-center justify-content-between"> |
6 | | - <div class="d-flex align-items-center"> |
7 | | - <div class="provider-icon-wrapper mr-2"> |
8 | | - <i :class="'bi bi-' + getProviderIcon(key)" style="font-size: 1.5rem;"></i> |
9 | | - </div> |
10 | | - <h2 class="mb-0">{{ formatProviderName(key) }}</h2> |
| 5 | + <div class="d-flex justify-content-between align-items-center"> |
| 6 | + <div> |
| 7 | + <h2> |
| 8 | + <i :class="'bi bi-' + getProviderIcon(key)" class="mr-2"></i> |
| 9 | + {{ formatProviderName(key) }} |
| 10 | + </h2> |
| 11 | + </div> |
| 12 | + <div> |
| 13 | + <span |
| 14 | + :class="['status-badge', item.enabled ? 'status-active' : '']" |
| 15 | + > |
| 16 | + {{ item.enabled ? "Active" : "Disabled" }} |
| 17 | + </span> |
11 | 18 | </div> |
12 | | - <b-form class="scaling-control" @submit.prevent="updateProvider(key, item.scaling.min_scaling)"> |
13 | | - <div class="d-flex align-items-center"> |
14 | | - <span class="status-badge" :class="{'status-active': item.ips.length > 0}" v-b-tooltip.hover title="Number of active proxy instances"> |
15 | | - <i class="bi bi-hdd-stack mr-1"></i> |
16 | | - {{ item.ips.length }} Active |
17 | | - </span> |
18 | | - <label for="sb-inline" class="mx-3"> |
19 | | - <i class="bi bi-sliders mr-1"></i> |
20 | | - Scale to |
21 | | - </label> |
22 | | - <b-form-spinbutton |
23 | | - v-model="item.scaling.min_scaling" |
24 | | - min="0" |
25 | | - max="100" |
26 | | - inline |
27 | | - @change="updateProvider(key, $event)" |
28 | | - class="custom-spinbutton" |
29 | | - v-b-tooltip.hover title="Set the number of proxy instances" |
30 | | - ></b-form-spinbutton> |
31 | | - </div> |
32 | | - </b-form> |
33 | 19 | </div> |
34 | 20 | </div> |
35 | 21 |
|
@@ -140,11 +126,17 @@ export default { |
140 | 126 | data: {}, |
141 | 127 | listremove_data: [], |
142 | 128 | toastCount: 0, |
| 129 | + auth: { |
| 130 | + username: '', |
| 131 | + password: '', |
| 132 | + auth_enabled: true |
| 133 | + } |
143 | 134 | }; |
144 | 135 | }, |
145 | 136 | beforeMount() { |
146 | 137 | this.getName(); |
147 | 138 | this.listremoveProxy(); |
| 139 | + this.getAuthSettings(); |
148 | 140 | }, |
149 | 141 | methods: { |
150 | 142 | formatProviderName(name) { |
@@ -263,9 +255,20 @@ export default { |
263 | 255 | appendToast: append, |
264 | 256 | }); |
265 | 257 | }, |
| 258 | + async getAuthSettings() { |
| 259 | + try { |
| 260 | + const res = await fetch("/auth"); |
| 261 | + const data = await res.json(); |
| 262 | + this.auth = data; |
| 263 | + } catch (error) { |
| 264 | + console.error('Failed to fetch auth settings:', error); |
| 265 | + } |
| 266 | + }, |
266 | 267 | copyToClipboard(ip) { |
267 | 268 | // Create proxy URL with authentication |
268 | | - const url = `http://${process.env.VUE_APP_USERNAME || 'username'}:${process.env.VUE_APP_PASSWORD || 'password'}@${ip}:8899`; |
| 269 | + const url = this.auth.auth_enabled |
| 270 | + ? `http://${this.auth.username}:${this.auth.password}@${ip}:8899` |
| 271 | + : `http://${ip}:8899`; |
269 | 272 | navigator.clipboard.writeText(url).then(() => { |
270 | 273 | this.$bvToast.toast('Proxy address copied to clipboard', { |
271 | 274 | title: 'Copied!', |
|
0 commit comments