Skip to content

ignoring <base> tag? #4

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

Closed
adamdecaf opened this issue Apr 12, 2018 · 11 comments
Closed

ignoring <base> tag? #4

adamdecaf opened this issue Apr 12, 2018 · 11 comments

Comments

@adamdecaf
Copy link
Contributor

Hi!

I'm trying to use this project and serve it on a /burrow path. This doesn't seem to quite work. I think the problem is in viewjs (see vuejs/vue-router#1426)

It looks like this project uses "vue": "^2.5.2", code, which might be a bit too old.

Is there any chance you could try upgrading viewjs?

@adamdecaf
Copy link
Contributor Author

I got this to work by making the urls relative, which is what MDN says works. I don't know if that's the fix viewjs applied though.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

<!DOCTYPE html>
<html>
  <head>
    <base href="https://example.com/burrow/">
    <meta charset=utf-8>
    <title>Burrow Dashboard</title>
    <meta http-equiv=x-ua-compatible content="ie=edge">
    <meta name=renderer content=webkit>
    <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no">
    <meta name=application-name content="Burrow Dashboard">
    <meta http-equiv=Cache-Control content=no-siteapp>
    <link rel="shortcut icon" type=image/x-icon href=/static/img/kafka-logo-1.png>
    <link rel=stylesheet href="//fonts.googleapis.com/css?family=Roboto:400,500,700,400italic|Material+Icons">
    <link href=static/css/app.d0f9c130914dc0f851f0c60e718ca7b4.css rel=stylesheet>
  </head>
  <body>
    <div id=app></div>
    <script type=text/javascript src=static/js/manifest.296f223cbb4b67230f1f.js></script>
    <script type=text/javascript src=static/js/vendor.093715d1b81b77ebb601.js></script>
    <script type=text/javascript src=static/js/app.9944140382bc3a6f27e6.js></script>
  </body>
</html>

@adamdecaf
Copy link
Contributor Author

cc @joway Are you still maintaining this project by chance?

@joway
Copy link
Owner

joway commented Apr 13, 2018

Hi , @adamdecaf , thanks for your report !

I think your problem is not vuejs's bug , i have some config in nginx.conf :

      location /v3 {
        proxy_pass                {BURROW_BACKEND};
        proxy_http_version        1.1;
        proxy_ignore_headers      Set-Cookie;
      }

      location / {
        try_files $uri $uri/ @rewrites;
      }

      location @rewrites {
        rewrite ^(.+)$ /index.html last;
      }

When you serve it on http://www.example.com/burrow , it will be have some abnormal behaviors . you can rewrite your own nginx.conf if you still want to serve at /burrow .

@joway joway mentioned this issue Apr 13, 2018
@adamdecaf
Copy link
Contributor Author

@joway I'm not sure I follow. I want to serve other assets off / -- nothing burrow related. An index page linking to several paths.

@adamdecaf
Copy link
Contributor Author

@joway Would you be ok with a change to use relative paths? <base> for sure works with those and it shouldn't break the common usage. I'm trying out with this patch:

2 files changed, 4 insertions(+), 4 deletions(-)
config/index.js | 4 ++--
index.html      | 4 ++--

modified   config/index.js
@@ -9,7 +9,7 @@ module.exports = {
 
     // Paths
     assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+    assetsPublicPath: '',
     proxyTable: {},
 
     // Various Dev Server settings
@@ -55,7 +55,7 @@ module.exports = {
     // Paths
     assetsRoot: path.resolve(__dirname, '../dist'),
     assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+    assetsPublicPath: '',
 
     /**
      * Source Maps
modified   index.html
@@ -10,7 +10,7 @@
   />
   <meta name="application-name" content="Burrow Dashboard">
   <meta http-equiv="Cache-Control" content="no-siteapp" />
-  <link rel="shortcut icon" type="image/x-icon" href="/static/img/kafka-logo-1.png" />
+  <link rel="shortcut icon" type="image/x-icon" href="static/img/kafka-logo-1.png" />
   <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:400,500,700,400italic|Material+Icons">

@adamdecaf
Copy link
Contributor Author

@joway I see #6, which works for me locally. I'm not seeing that work for me under /burrow though.

Can we change the index.html to use relative paths also?

@joway
Copy link
Owner

joway commented Apr 17, 2018

can you fork the repo and try to change some code and rebuild the docker image , and try it ? @adamdecaf

@adamdecaf
Copy link
Contributor Author

@joway The container worked when I built it locally, but not from the 1.0.2 tag.. I'm not sure why. #8 is a small fix for the shortcut-icon

#9 and #10 are small doc improvements.

adamdecaf added a commit to adamdecaf/burrow-dashboard that referenced this issue Apr 17, 2018
@adamdecaf
Copy link
Contributor Author

@joway #11 fixes the dashboard fully on a relative path.

@joway joway closed this as completed in #11 Apr 18, 2018
joway pushed a commit that referenced this issue Apr 18, 2018
@adamdecaf
Copy link
Contributor Author

@joway Thanks for the merge. Would you mind making a release?

@joway
Copy link
Owner

joway commented Apr 18, 2018

@adamdecaf your can use joway/burrow-dashboard:1.0.3 or joway/burrow-dashboard:latest

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

2 participants