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

Integrating frontend #82

Open
Romathonat opened this issue Aug 24, 2016 · 9 comments
Open

Integrating frontend #82

Romathonat opened this issue Aug 24, 2016 · 9 comments
Assignees

Comments

@Romathonat
Copy link
Contributor

I tried to add OCCInterface to erocci, by putting my project into /deps/erocci_frontend, then add the same makefile as here https://github.com/erocci/erocci_frontend, then recompile the whole thing.

It does not work, going to / redirects to /_frontend but no index.html is loaded.
I see that you used a previous project https://github.com/occiware/occi-js, and the front end does not work on http://malmo.lizenn.net:8080/_frontend/ ! Could you fix it and give some informations?
I think OCCInterface would give a great frontend to Erocci.

@jeanparpaillon
Copy link

Hi,
original erocci_frontend index.html was in app/ dir.
Now, you can specify any alternative frontend dir in the erocci_listener_http/frontend env parameter.

For instance, in config/sys.config:

  • look for erocci_frontend/app in code path (including .../erocci/deps):
 {erocci_listener_http, [{frontend, "erocci_frontend/app"}]}
  • absolute path:
 {erocci_listener_http, [{frontend, "/my/path/to/OCCInterface"}]}
  • disabled:
 {erocci_listener_http, [{frontend, undefined}]}
  • WARNING
    Currently, OCCInterface does not work because of absolute path (/dist/bundle.js).
    erocci will prepend frontend paths with _frontend/, so you'd better use only relative paths.

Can you test and close ?

@Romathonat
Copy link
Contributor Author

Romathonat commented Aug 25, 2016

Thank you very much, I will test it.

@Romathonat
Copy link
Contributor Author

Ok I think I managed to do something correct. I put the steps I needed to do here, I'll see later if I can improve (maybe make a script to do that would be great)

1- rm -rf deps/erocci_frontend
2- git clone https://github.com/occiware/OCCInterface.git erocci_frontend
3- cd deps/erocci_frontend
4- npm install
5- (put a makefile like this one https://github.com/erocci/erocci_frontend/blob/master/Makefile) not sure if necessary
6- in src/utils.js, replace the first line by this one :

var url = 'http://localhost:8080'+relativeUrl;

7 - remove this code from src/components/navbar

            <div className="ui item right navBarRight">
                <div className="ui item">
                   <select className="ui fluid search dropdown backendURL" name="backendURL"onChange={() => {}}>
                     {options}
                   </select>
                   <button className="ui button useButton" onClick={this.updateBackendURL}>Use</button>
               </div>
            </div>

8- npm run build
9- replace into config/sys.config by

{erocci_listener_http, [{frontend, "erocci_frontend"}]}

10- should work

@Romathonat
Copy link
Contributor Author

Romathonat commented Aug 25, 2016

I am working on the automation of this process. I have an issue with the makefile : I simply wanted to change the download of the frontend with:

dep_erocci_frontend = git https://github.com/occiware/OCCInterface.git $(erocci_frontend_v) 

But with make, I have this error:

error: pathspec '89cfdb2' did not match any file(s) known to git.
make: *** [/data/home/rmathonat/Documents/modifiedErocci/deps/erocci_frontend] Erreur 1

@Romathonat
Copy link
Contributor Author

I got it I think, it means the commit I am targeting

@jeanparpaillon
Copy link

$(erocci_frontend_v) is a specific revision, if you want to point to a new git repo:

dep_erocci_frontend = git https://github.com/occiware/OCCInterface.git master..or..a.specific.revision

@Romathonat
Copy link
Contributor Author

Perfect

@Romathonat
Copy link
Contributor Author

Alright I finished, just look at the pull request I sent. Works greatly here. You can close once the PR is accepted I guess.

@Romathonat
Copy link
Contributor Author

Don't forget to update the version of OCCInterface in deps.lock, I am continuously improving/fixing bugs

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

No branches or pull requests

2 participants