Comments (19)
I have added a configurable prefix with this commit. Let me know if that solves your problem or you need further changes.
Cheers!
from mavcesium.
All the static content is still served out of /static, that will need to move relative to the prefix as well I think?
from mavcesium.
I think you are correct... Sorry, very green to making a web app somewhat deployable :) It shouldn't be too difficult to fix. Anything to help package this for maverick is a step in the right direction!
from mavcesium.
With #29 applied the static files are being served correctly (with the prefix), but I don't know if the relative paths scattered in the javascript are going to be an issue? e.g. https://github.com/SamuelDudley/MAVCesium/blob/master/app/static/DST/js/core.js#L475
I dont think they will be an issue but I'd like to be sure from your end.
from mavcesium.
All the absolute pathnames in the DST/js files will need to be made relative. How are they generated, or did you construct them by hand?
from mavcesium.
Added by hand :(... I'll pass a javascript variable into the index.html template from the tornado server and prefix the existing file paths with it.
from mavcesium.
Can you not just leave relative paths in?
from mavcesium.
I think the relative paths are okay but they weren't including the prefix... Should be fixed now
from mavcesium.
Still a few in DST/css/third_party/font-awesome.min.css and DST/js/third_party/jquery-ui.min.js
from mavcesium.
Hey,
Not sure where you are referring to sorry. Can you link to the line in the file?
If your talking about the files in index.html:
<link rel="stylesheet" type="text/css" href="{{static_url("DST/css/cesium.css")}}"/>
<link rel="stylesheet" type="text/css" href="{{static_url("DST/css/third_party/bootstrap.min.css")}}"/>
<link rel="stylesheet" type="text/css" href="{{static_url("DST/css/third_party/font-awesome.min.css")}}"/>
<link rel="stylesheet" type="text/css" href="{{static_url("DST/css/third_party/jquery-ui.min.css")}}"/>
<link rel="stylesheet" type="text/css" href="{{static_url("DST/css/third_party/lobipanel.css")}}"/>
<link rel="icon" href="{{static_url("DST/favicon-32x32.png")}}" sizes="32x32" />
etc...
the {{static_url()}}
is expanded according to the tornado server static_url_prefix
which is defined here.
Looking at the html of the served page (view source when in the browser) and having set mavcesium/
as the app_prefix
in the config file I see this:
<link rel="stylesheet" type="text/css" href="/mavcesium/static/DST/css/cesium.css?v=931c3bc4dd44e44062101d7176637443"/>
<link rel="stylesheet" type="text/css" href="/mavcesium/static/DST/css/third_party/bootstrap.min.css?v=2f624089c65f12185e79925bc5a7fc42"/>
<link rel="stylesheet" type="text/css" href="/mavcesium/static/DST/css/third_party/font-awesome.min.css?v=73477b4d03a0989f78a352e1063b1575"/>
<link rel="stylesheet" type="text/css" href="/mavcesium/static/DST/css/third_party/jquery-ui.min.css?v=6baef79004e6978af706d6ee00e3369e"/>
<link rel="stylesheet" type="text/css" href="/mavcesium/static/DST/css/third_party/lobipanel.css?v=8aae7746e33082ffad55f1cb119bf94d"/>
<link rel="icon" href="/mavcesium/static/DST/favicon-32x32.png?v=dd662c8685816cc43cc981f9737c964b" sizes="32x32" />
Having a look at the sources tab in chrome shows that all of the served files have the correct prefix:
One gotcha is not clearing the browser cache, because it will continue to load the old index.html (with the old/no static prefix)
So as far as I can tell it is working as expected with my setup... Anyway, if you can provide a link to the line where is issue is on your end that would be a big help :)
Let me know how you go.
Cheers
from mavcesium.
Do grep -r '/static
and you'll see where they are. If you open the console rather than the source in the browser devtools you can see the big red 404s :)
from mavcesium.
Also getting a 403 when trying to proxy the websocket:
Corresponding warnings in the mavproxy console:
WARNING:tornado.access:403 GET /mavlink/mavcesium/websocket/ (127.0.0.1) 0.76ms
WARNING:tornado.access:403 GET /mavlink/mavcesium/websocket/ (127.0.0.1) 0.44ms
WARNING:tornado.access:403 GET /mavlink/mavcesium/websocket/ (127.0.0.1) 0.65ms
from mavcesium.
Turning off the origin check in tornado 4 fixes the 403 error (overriding the check_origin method):
https://stackoverflow.com/a/25071488
from mavcesium.
Thanks for your efforts with this. I'm not sure how the /static
has ended up in the .min files but I have taken the opportunity to move to bootstrap 4, the latest jquery + font awesome.
I've almost completed the port...
from mavcesium.
@fnoop I have pushed a bunch of changes including the websocket issue work around. grep -r /static
is now only giving me readme.md
so hopefully all the static paths are finally fixed!
Note: the move to bootstrap 4 has broken the settings modal menu. I'm in the process of fixing that now...
EDIT Current master should be good to go now! Fingers crossed!
from mavcesium.
Looking much better! Few errors still in the console and the bootstrap header row doesn't collapse well:
from mavcesium.
Yeah saw that error while testing. It seems consistent so should be easy to track down... I will work on the bootstrap headder but I'm glad it's looking better from your end!
from mavcesium.
Ok all working now under reverse proxy. Thanks so much for the quick response :)
from mavcesium.
Not a problem. Glad to actually do some collaboration to improve the ArduPilot / companion computer eco system.
from mavcesium.
Related Issues (20)
- Websocket address logic faulty HOT 4
- Configurable config? HOT 8
- Add support for streaming video HOT 14
- PX4 Support HOT 3
- README.md is out of date and live demo is down HOT 2
- Make application independent of (but still compatible with) MAVProxy HOT 14
- app/mavcesium_default.ini should be in .gitignore HOT 5
- Possible to run SITL HOT 5
- Editable HTML and JS files HOT 6
- Standalone mavcesium uses a lot of resource HOT 22
- Support more than one vehicle in the same 'world'
- Support touch events for zooming and WP control
- Python bindings for C++ MAVLink processing HOT 2
- Does not retry for mavlink connection HOT 1
- Add pip installer for standalone server
- ConfigParser instance has no attribute 'read_file' HOT 3
- License Question HOT 2
- 3D map not loading
- Error running module
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 mavcesium.