Skip to content

Commit fc5be17

Browse files
committed
fix not showing validation
1 parent 0592247 commit fc5be17

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

src/views/Home.vue

+26-10
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@
5252
class="bgp-popover-text"
5353
style="text-align: left; position: absolute;"
5454
>
55-
<div v-if="searchOptions.validateBGP && this.rotoStatus" class="options-text">
55+
<div
56+
v-if="searchOptions.validateBGP && this.rotoStatus"
57+
class="options-text"
58+
>
5659
will be validated with BGP ASN
5760
</div>
5861
</div>
@@ -225,10 +228,14 @@
225228
</div>
226229
<h4>DATA DELIVERY</h4>
227230
<h5>RPKI</h5>
228-
<a :href="`https://${routinatorApiHost}/api/v1/status`" v-if="this.status.version">{{
229-
this.status.version
230-
}}</a>
231-
<span v-else>Not available. Routinator may not be running!</span>
231+
<a
232+
:href="`https://${routinatorApiHost}/api/v1/status`"
233+
v-if="this.status.version"
234+
>{{ this.status.version }}</a
235+
>
236+
<span v-else
237+
>Not available. Routinator may not be running!</span
238+
>
232239
<h5>BGP + RIR Allocations</h5>
233240
<a
234241
:href="`https://${rotoApiHost}/api/v1/`"
@@ -341,7 +348,9 @@
341348
/>
342349
</div>
343350
<div v-else-if="!this.status.error && !this.status.waiting">
344-
<h4 v-if="this.rotoStatus">No Origin ASN found for this Prefix in BGP.</h4>
351+
<h4 v-if="this.rotoStatus">
352+
No Origin ASN found for this Prefix in BGP.
353+
</h4>
345354
<div class="validation-description">
346355
You can enter an ASN to validate this prefix against and try again.
347356
</div>
@@ -658,7 +667,8 @@ export default {
658667
window.setTimeout(this.loadRoutinatorStatus, 10000);
659668
} else {
660669
this.status.error =
661-
(err.response && err.response.data) &&
670+
err.response &&
671+
err.response.data &&
662672
"Routinator API returned an error. Check your Routinator installation.";
663673
this.status.waiting = false;
664674
}
@@ -817,7 +827,7 @@ export default {
817827
// gave us.
818828
// We're only going to do this if the availability of the roto-api has been
819829
// confirmed. Since it may not be enabled by the user we're failing silently.
820-
if (this.searchOptions.validateBGP && this.rotoStatus) {
830+
if (this.searchOptions.validateBGP) {
821831
console.log(`loading bgp+alloc data for ${this.searchForm.prefix}`);
822832
this.loadingRoute = true;
823833
this.firstSearch = false;
@@ -918,8 +928,14 @@ export default {
918928
// return;
919929
},
920930
err => {
921-
this.error =
922-
"The BGP Lookup Server failed with an unknown error. Please retry later.";
931+
this.loadingStatus = false;
932+
// Only throw an error if we previously saw the roto-api server.
933+
if (this.rotoStatus) {
934+
this.error =
935+
"The BGP Lookup Server failed with an unknown error. Please retry later.";
936+
} else {
937+
this.error = this.$t("home.pleasevalidasn");
938+
}
923939
}
924940
)
925941
.catch(err => {

0 commit comments

Comments
 (0)