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

Server URL input as a dropdown #9

Open
Guttz opened this issue Aug 25, 2019 · 13 comments
Open

Server URL input as a dropdown #9

Guttz opened this issue Aug 25, 2019 · 13 comments

Comments

@Guttz
Copy link
Contributor

Guttz commented Aug 25, 2019

Deploy hydrus servers and input them in the Server URL input as a dropdown so when the user launches the UI he can already try some online ready server. Similar to how we have one already deployed now.

@Guttz Guttz changed the title Deploy hydrus servers and input them in the Server URL input as a dropdown Server URL input as a dropdown Aug 25, 2019
@HTTP-APIs HTTP-APIs deleted a comment from thrishik7 Mar 9, 2020
@thrishik7
Copy link
Contributor

@Guttz Can we use database to store the URLs when they are deployed or hosted, and then fetch them in the client . Or is there any other approach to this?

@Guttz
Copy link
Contributor Author

Guttz commented Mar 23, 2020

For now, as I think we have only 1, a simple array in the source code would be ok.. We can change it in the future if necessary.

@Guttz
Copy link
Contributor Author

Guttz commented Mar 23, 2020

Maybe something important would be to have a checking function when the demo initializes so it actually checks if the servers are up, before showing to the user, as the servers might not always be available.

@thrishik7
Copy link
Contributor

okay @Guttz , so it's like having an array of urls harded coded and checking if it is hosted or not?

@Haysam-Bin-Tahir
Copy link

Haysam-Bin-Tahir commented Mar 23, 2020

Greetings @Guttz . I am willing to work on this issue.
I currently am facing an issue with running the development server of "hydra-python-agent-gui".
I have read the installation guide and have set up both client and Hydrus server.
However, I am getting a blank page on localhost:3000.
I believe this is due to the following errors:

error-hydrus-update

The blank page appears because of the following variables being null in the render function of app.js:

render() {
    const { classes } = this.props;

    if(this.state.classes && this.state.apidocGraph.nodes ){    //both are null in the component's state
      return ( <template> );
    }

The root of the issue is when the request is made to hydra-docs and adidoc-graph and 404 error occurs. That's why both of the above variables are not being set

  componentDidMount() {
    axios.get(this.agentEndpoint + "/hydra-doc")
      .then(res => {

        this.setState({
          //for this.supportedClass > if @id="vocab:EntryPoint" then supportedProperty.property.labe
          classes: res.data.supportedClass,
          serverURL: res.data.serverURL.replace(/\/$/, "") + "/"
        }, () => this.render())
      });

      axios.get(this.agentEndpoint + "/apidoc-graph")
      .then(res => {
        this.setState({
          //for this.supportedClass > if @id="vocab:EntryPoint" then supportedProperty.property.labe
          apidocGraph: res.data
        }, () => this.render())
      });
  }

Could you please guide a bit about what might've went wrong?

I also tried to solve the matter by replacing this.agentEndpoint with "http://localhost:8080" because of the hydrus server running on 8080 port but it didn't change anything.

I tried by peeking into the hydra_doc_writer to create a new hydraDoc too but I think that wouldn't be necessary as sample hydrodoc is being used as default. The following output line by running hydrus serve gave me this thought:

No hydradoc specified, using sample hydradoc as default.

@thrishik7
Copy link
Contributor

@Haysam-Bin-Tahir , hello may I know how are you running the client , are you running app.py . and if you are using hydrus server then the entrypoint should be http://localhost:8080/serverapi

@Haysam-Bin-Tahir
Copy link

@Haysam-Bin-Tahir , hello may I know how are you running the client , are you running app.py . and if you are using hydrus server then the entrypoint should be http://localhost:8080/serverapi

I am currently running the app by "npm start" into the folder "console-frontend".

I also changed the entrypoint to "http://localhost:8080/serverapi" but that gave authentication error (401).

@thrishik7
Copy link
Contributor

thrishik7 commented Mar 23, 2020

@Haysam-Bin-Tahir okay instead running app through npm start, try running python app.py outside the console-frontend directory ,this will run static files which is build by react app, under port 3000.

@thrishik7
Copy link
Contributor

@Haysam-Bin-Tahir , hello may I know how are you running the client , are you running app.py . and if you are using hydrus server then the entrypoint should be http://localhost:8080/serverapi

I am currently running the app by "npm start" into the folder "console-frontend".

I also changed the entrypoint to "http://localhost:8080/serverapi" but that gave authentication error (401).

for authenication error instead running hydrus serve run hydrus serve --no-auth.

@Haysam-Bin-Tahir
Copy link

Haysam-Bin-Tahir commented Mar 24, 2020

It resolved the authorization error but still, the resources( hydra-doc and apidoc-graph ) are not found and 404 error is being generated. Does redis_setup.sh have a role in it? Because that is the only file that is not being run currently due to a docker error of "docker daemon not running".

P.S. I am still running npm start to run the GUI because of app.py not running due to connection error with "/serverapi/vocab" and I tried so many times with method variations that now I get the following error on running python app.py:

raise-error

I understand this might be a problem with my setup because I don't see other users complaining about it. So, it is okay if you are not able to detect the problem with this; I won't be taking any more time of yours on this. It is just a last try to see if we can reach somewhere. Thanks for your patience and kindness.

@Guttz
Copy link
Contributor Author

Guttz commented Mar 24, 2020

Hey @Haysam-Bin-Tahir, to run the GUI you need RedisGraph running, hydrus running and then run the gui(python app.py). I would suggest that for these errors you interact with the community through our slack channel: https://join.slack.com/t/hydraecosystem/shared_invite/zt-9eudw2gz-5SN92uyOhYDBnFQHAAx9nw Thanks!

@Guttz
Copy link
Contributor Author

Guttz commented Mar 24, 2020

okay @Guttz , so it's like having an array of urls harded coded and checking if it is hosted or not?

Yes, I think that's a ok solution for now.

@Haysam-Bin-Tahir
Copy link

Hey @Haysam-Bin-Tahir, to run the GUI you need RedisGraph running, hydrus running and then run the gui(python app.py). I would suggest that for these errors you interact with the community through our slack channel: https://join.slack.com/t/hydraecosystem/shared_invite/zt-9eudw2gz-5SN92uyOhYDBnFQHAAx9nw Thanks!

Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants