Giter Club home page Giter Club logo

Comments (8)

romain-fontugne avatar romain-fontugne commented on September 28, 2024 1

here you go!

from ihr-website.

romain-fontugne avatar romain-fontugne commented on September 28, 2024 1

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.

ConnectBhawna avatar ConnectBhawna commented on September 28, 2024 1

Okk sure sir, almost done with this issue :)
Thanks for helping me out @romain-fontugne @Yh010

from ihr-website.

Aniket762 avatar Aniket762 commented on September 28, 2024

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:

  1. It is actually independent like Google and most prolly Cloudflare or similar
  2. 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.

romain-fontugne avatar romain-fontugne commented on September 28, 2024

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.

ConnectBhawna avatar ConnectBhawna commented on September 28, 2024

@romain-fontugne @Aniket762 sir,
Could you please assign this issue to me? I am willing to work on this.
Thanks

from ihr-website.

ConnectBhawna avatar ConnectBhawna commented on September 28, 2024

@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.

Yh010 avatar Yh010 commented on September 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.