Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OBFS info to Status page #680

Merged
merged 5 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/themes/ivpn-v3/assets/js/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export default {

async getServerStats() {
return await this.Get(
'/v4/servers/stats',
'/v5/servers/stats',
process.env.MIX_APP_API_URL,
{
credentials: "omit"
Expand Down
46 changes: 37 additions & 9 deletions src/themes/ivpn-v3/assets/js/components/ServerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
<div class="col server">
<i :title="renderStatus(server)" :class="['status', (server.is_active ? 'status--active' : ''), (server.in_maintenance ? 'status--maintenance' : '')]"></i>
<ul class="hosts-list">
<li v-for="(host, protocol) in server.hostnames" :key="protocol">
{{ host }}
<li v-for="(host, protocol) in server.hosts" :key="protocol">
{{ host.hostname }}
<span class="badge badge--light spacing">{{ protocol }}</span>
</li>
</ul>
Expand All @@ -93,16 +93,16 @@
<div class="hosts">
<i :title="renderStatus(server)" :class="['status', (server.is_active ? 'status--active' : ''), (server.in_maintenance ? 'status--maintenance' : '')]"></i>
<ul class="hosts-list">
<li v-for="(host, protocol) in server.hostnames" :key="protocol">
{{ host }}
<li v-for="(host, protocol) in server.hosts" :key="protocol">
{{ host.hostname }}
<span class="badge badge--light spacing">{{ protocol }}</span>
</li>
</ul>
</div>
<div>
<div class="location">
{{ server.country }}, {{ server.city }}
</div>
<div>
<div class="provider">
{{ server.isp }}, Load: {{ (Math.round(server.load * 100) / 100).toFixed(2) }}%
</div>
</div>
Expand All @@ -113,17 +113,43 @@
</div>
<div class="col details">
<div>
<em>Public Key</em>
<em>WireGuard Public Key:</em>
{{ server.wg_public_key || "N/A" }}
</div>
<div>
<em>MultiHop Port</em>
<em>MultiHop Port:</em>
{{ server.multihop_port || "N/A" }}
</div>
<div v-if="server.obfs.obfs3_multihop_port">
<em>OBFS 3 SingleHop Port:</em>
{{ config.ports.obfs3.port }}
</div>
<div v-if="server.obfs.obfs3_multihop_port">
<em>OBFS 3 MultiHop Port:</em>
{{ server.obfs.obfs3_multihop_port }}
</div>
<div v-if="server.obfs.obfs4_multihop_port">
<em>OBFS 4 SingleHop Port:</em>
{{ config.ports.obfs4.port }}
</div>
<div v-if="server.obfs.obfs4_multihop_port">
<em>OBFS 4 MultiHop Port:</em>
{{ server.obfs.obfs4_multihop_port }}
</div>
<div v-if="server.obfs.obfs4_key">
<em>OBFS 4 Public Key:</em>
{{ server.obfs.obfs4_key }}
</div>
<div>
<em>Socks5</em>
<em>Socks5:</em>
{{ renderSocks5(server) }}
</div>
<!-- <div>
<em>
<span class="port-speed-label">Port Speed</span>/<span class="port-speed-label">Configured Speed</span>
</em>
<span v-if="!!server.server_speed" class="port-speed-label">{{ server.server_speed.split("/")[0] }}</span>/<span v-if="!!server.server_speed" class="port-speed-label">{{ server.server_speed.split("/")[1] }}</span>
</div> -->
</div>
</div>
</main>
Expand All @@ -138,6 +164,7 @@ export default {
data() {
return {
servers: [],
config: {},
sortedServers: [],
filteredServers: [],
countries: [],
Expand All @@ -155,6 +182,7 @@ export default {
let resp = await Api.getServerStats();
if (resp.servers) {
this.servers = resp.servers.filter((v,i,a) => a.findIndex(t => (t.gateway === v.gateway)) === i);
this.config = resp.config;
this.countries = [...new Set(resp.servers.map(server => server.country))].filter(String).sort();
this.cities = [...new Set(resp.servers.map(server => server.city))].filter(String).sort();
this.providers = [...new Set(resp.servers.map(server => server.isp))].filter(String).sort();
Expand Down
40 changes: 32 additions & 8 deletions src/themes/ivpn-v3/assets/scss/components/servers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@
&.details {
width: 100%;
display: none;
flex-direction: row;
flex-direction: column;
padding-top: 20px;
padding-bottom: 20px;
padding-left: 44px;
pointer-events: all;

&.active {
Expand All @@ -129,27 +130,31 @@
}

div {
margin-right: 30px;
word-break: break-all;

&:last-of-type {
margin-right: 0;
}

@include max-width('medium-large') {
margin-bottom: 15px;

&:last-of-type {
margin-bottom: 0;
}
}

.port-speed-label {
display: inline-block;
min-width: 88px;

&:last-child {
margin-left: 10px;
}
}
}

em {
display: block;
display: inline-block;
font-size: 13px;
font-style: normal;
margin-bottom: 8px;
margin-bottom: 12px;

@include light-theme((
color: rgba(34, 34, 38, 0.5)
Expand Down Expand Up @@ -184,6 +189,11 @@
pointer-events: all;
user-select: text;
}

.location,
.provider {
padding-left: 25px;
}
}

.location__data {
Expand All @@ -210,6 +220,20 @@
&:last-child {
margin-bottom: 0;
}

em {
font-size: 13px;
font-style: normal;
display: block;

@include light-theme((
color: rgba(34, 34, 38, 0.5)
));

@include dark-theme((
color: rgba(255, 255, 255, 0.5)
));
}
}
}
}
Expand Down