[PATCH] bug fix: display kimchi icon instead of cherrypy icon

From: ShaoHe Feng <shaohef@linux.vnet.ibm.com> When we start a VNC window, the favicon.ico is always cherrypy icon. Actually we open any page: such as: http://192.168.1.117:8000/error the favicon.ico is also a cherrypy icon. This patch fix this bug. Ref: http://docs.cherrypy.org/en/latest/progguide/files/favicon.html Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- src/kimchi/server.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kimchi/server.py b/src/kimchi/server.py index 1e131b4..0396660 100644 --- a/src/kimchi/server.py +++ b/src/kimchi/server.py @@ -118,6 +118,10 @@ class Server(object): 'tools.staticfile.on': True, 'tools.staticfile.filename': 'config/ui/tabs.xml', 'tools.nocache.on': True + }, + '/favicon.ico': { + 'tools.staticfile.on': True, + 'tools.staticfile.filename': '%s/images/logo.ico' % paths.ui_dir } } -- 1.8.4.2

AFAIU, that setting overrides the icon for everything served by cherrypy. If that's right, can you also remove the following line from ui/pages/kimchi-ui.html.tmpl? <link rel="shortcut icon" href="images/logo.ico"> Or is it still needed? Am 13-02-2014 11:53, schrieb shaohef@linux.vnet.ibm.com:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
When we start a VNC window, the favicon.ico is always cherrypy icon.
Actually we open any page: such as: http://192.168.1.117:8000/error
the favicon.ico is also a cherrypy icon.
This patch fix this bug.
Ref: http://docs.cherrypy.org/en/latest/progguide/files/favicon.html
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>

On 02/13/2014 10:03 PM, Crístian Viana wrote:
AFAIU, that setting overrides the icon for everything served by cherrypy. If that's right, can you also remove the following line from ui/pages/kimchi-ui.html.tmpl?
yes. we it can work well.
<link rel="shortcut icon" href="images/logo.ico">
Or is it still needed? But I think we can keep it.
Here is the document of w3. http://www.w3.org/2005/10/howto-favicon w3 prefer to use of a |rel| attribute value defined in a profile. However this are some limitations: 1. rel only work in HTML or XHTML 2. rel only can works in one document, not a collection of documents (i.e., a site) So I have have to set the favicon.ico for the whole site.
Am 13-02-2014 11:53, schrieb shaohef@linux.vnet.ibm.com:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
When we start a VNC window, the favicon.ico is always cherrypy icon.
Actually we open any page: such as: http://192.168.1.117:8000/error
the favicon.ico is also a cherrypy icon.
This patch fix this bug.
Ref: http://docs.cherrypy.org/en/latest/progguide/files/favicon.html
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
-- Thanks and best regards! Sheldon Feng(???)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 02/13/2014 10:03 PM, Crístian Viana wrote:
AFAIU, that setting overrides the icon for everything served by cherrypy. If that's right, can you also remove the following line from ui/pages/kimchi-ui.html.tmpl?
<link rel="shortcut icon" href="images/logo.ico">
Or is it still needed? It's needed. They are all for browser compatibility.
Am 13-02-2014 11:53, schrieb shaohef@linux.vnet.ibm.com:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
When we start a VNC window, the favicon.ico is always cherrypy icon.
Actually we open any page: such as: http://192.168.1.117:8000/error
the favicon.ico is also a cherrypy icon.
This patch fix this bug.
Ref: http://docs.cherrypy.org/en/latest/progguide/files/favicon.html
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 02/13/2014 09:53 PM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
When we start a VNC window, the favicon.ico is always cherrypy icon.
Actually we open any page: such as: http://192.168.1.117:8000/error
the favicon.ico is also a cherrypy icon.
This patch fix this bug.
Ref: http://docs.cherrypy.org/en/latest/progguide/files/favicon.html
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> Reviewed-by: Hongliang Wang <hlwang@linux.vnet.ibm.com> --- src/kimchi/server.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/kimchi/server.py b/src/kimchi/server.py index 1e131b4..0396660 100644 --- a/src/kimchi/server.py +++ b/src/kimchi/server.py @@ -118,6 +118,10 @@ class Server(object): 'tools.staticfile.on': True, 'tools.staticfile.filename': 'config/ui/tabs.xml', 'tools.nocache.on': True + }, + '/favicon.ico': { + 'tools.staticfile.on': True, + 'tools.staticfile.filename': '%s/images/logo.ico' % paths.ui_dir } }

Reviewed-by: Crístian Viana <vianac@linux.vnet.ibm.com> Thanks for the explanation! Am 13-02-2014 11:53, schrieb shaohef@linux.vnet.ibm.com:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
When we start a VNC window, the favicon.ico is always cherrypy icon.
Actually we open any page: such as: http://192.168.1.117:8000/error
the favicon.ico is also a cherrypy icon.
This patch fix this bug.
Ref: http://docs.cherrypy.org/en/latest/progguide/files/favicon.html
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
participants (5)
-
Aline Manera
-
Crístian Viana
-
Hongliang Wang
-
shaohef@linux.vnet.ibm.com
-
Sheldon