Comments (8)
here you go!
from ihr-website.
oh I think you don't need to do new API calls, the views/charts/AsInterdependenciesChart.vue component is already calling this API.
It is more a matter of properly checking what is returned by the API in the component and displaying the corresponding message
from ihr-website.
Okk sure sir, almost done with this issue :)
Thanks for helping me out @romain-fontugne @Yh010
from ihr-website.
There is two possibilities for a network with no AS dependency:
- the network is super distributed and really has no dependency (e.g. Google)
- the network announce no IP space
distinguish both cases using results from the global graph, and print corresponding messages
@romain-fontugne sir, according to my understanding we need to work on the actual dependency of one AS with others in the network. There are practically 2 cases :
- One AS is dependent on other
- AS is completely independent
When it comes to completely independent, we have 2 scenarios:
- It is actually independent like Google and most prolly Cloudflare or similar
- Or Network announce no IP space
Can you provide me with some documentation that I can read up on so that I can understand how to work on this issue? I am a bit confused can you help me sir?
from ihr-website.
This issue is related to the views/charts/AsInterdependenciesChart.vue component. The graph may be empty if we measured no network dependency (e.g. https://ihr.iijlab.net/ihr/en-us/networks/AS15169?af=4&last=3&date=2019-03-15&rov_tb=routes) in this case we want to show a message "No network dependency".
But sometimes the graph is empty because we have no data for the selected network (e.g. https://ihr.iijlab.net/ihr/en-us/networks/AS6555?rov_tb=routes). AS6555 is registered but actually not connected to the global Internet. In this case we want to show a message like "Network unreachable".
To differentiate between the two cases we can do the following API calls:
For google we have a result, that means AS15169 (Google) is active:
Here the result is empty, that means the network 6555 is inactive/unreachable:
I hope it helps?
from ihr-website.
@romain-fontugne @Aniket762 sir,
Could you please assign this issue to me? I am willing to work on this.
Thanks
from ihr-website.
@romain-fontugne Sir. Can we do this like this?
import axios from 'axios'
axios.get('https://ihr.iijlab.net/ihr/api/hegemony/', {
params: {
originasn: 0,
asn: 15169,
af: 4,
timebin__gte: '2019-03-15T15:00:00.000Z',
timebin__lte: '2019-03-15T15:15:00.000Z',
ordering: 'timebin'
}
})
.then(response => {
// handle response
})
.catch(error => {
console.error(error)
})
In the example above, we are calling the first API endpoint to check if AS15169 is active. The axios.get() method takes the API endpoint URL as its first argument and an object containing the query parameters as its second argument. The .then() method is used to handle the response from the API and the .catch() method is used to handle any errors that may occur. You can modify the code to call the second API endpoint to check if AS6555 is reachable.
from ihr-website.
@ConnectBhawna maybe you could modify the code to :
// set loading spinner to true
this.isLoading = true;
// clear the message
this.message = '';
axios.get('https://ihr.iijlab.net/ihr/api/hegemony/', {
params: {
originasn: 0,
asn: 15169,
af: 4,
timebin__gte: '2019-03-15T15:00:00.000Z',
timebin__lte: '2019-03-15T15:15:00.000Z',
ordering: 'timebin'
}
})
.then(response => {
if (response.data.length > 0) {
// Network is announcing IP space
this.message = 'Network is super distributed';
} else {
// Network is not announcing any IP space
this.message = 'Network is not announcing any IP space';
}
})
.catch(error => {
console.error(error);
this.message = 'An error occurred';
})
.finally(() => {
// set loading spinner to false
this.isLoading = false;
});
code changes:
1).then(response) code block is for displaying the messages . The code snippet checks the length of the data returned by the API call .if the length of the response data is greater than 0, it means that there are dependencies and the network is reachable.And since a superdistributed network can announce IP space but still have no AS dependencies, we can say that a response data length > 0 indicates a super distributed network.On the other hand, if the length of the response data is 0, it means that there are no dependencies and the network is not announcing any IP space
2).finally code block added . By using the finally block, the code ensures that the loading spinner will always stop, regardless of whether the request was successful or not. This means that the spinner won't continue to spin indefinitely if there's an error, which can help improve the user experience. Additionally, by setting this.message to an empty string before making the API call, the message will be cleared even if the request fails. This can help prevent confusing error messages from being displayed to the user.
from ihr-website.
Related Issues (20)
- Inconsistent Color Scale Displayed on World Map When Clicking on a Country in Global Report Page HOT 18
- Add World Map for Country Selection in Country Report HOT 2
- website overflow in x direction looks weired. HOT 2
- Add a new setup video HOT 2
- Hover effect on website HOT 1
- Adding World Map for country selection for Network Delays During National Lockdowns HOT 2
- Loading page issue HOT 2
- Search Bar result showing priority HOT 1
- Documentation change HOT 1
- Users connected ASN and other information HOT 26
- Implement Notification System for Network Events HOT 4
- PeeringdbNetID returning null HOT 7
- Adding Slack Icon HOT 2
- Prefix Component Bug HOT 3
- Don't run metadata query unless the user click on metadata tab
- Add a feedback button on report pages
- Text overflowing in 'Your connection' box
- Missing y-label in network report, prefix tags chart
- Two unecessary queries when loading ASHegemony chart
- Links in treemap are unpredictable HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ihr-website.