Dave, is there a way to add a favicon, perhaps from includes?
Thanks!
Paul
favicon
Re: favicon
Hi Paul,
There's currently no supported method but I think it would be quite easy for me to put in as a config option.
In the meantime you have two choices.
1. If FreeNATS is on a web server root e.g. you go to http://myserver/ to access it then you can put a favicon.ico file in the web root folder (on the VM this is /srv/www/html)
2. You can change the following FreeNATS code - it's what I will do when I put this in and allows the favicon to be a configurable string.
Edit the file server/base/screen.inc.php
After line 90 e.g. after the block that goes:
/*
echo "<style type=\"text/css\">\n";
require("css/main.css");
echo "\n</style>\n";
*/
So on a new line after the close comment put in these two lines:
if ($NATS->Cfg->Get("site.favicon","")!="")
echo "<link rel=\"shortcut icon\" href=\"".$NATS->Cfg->Get("site.favicon","")."\" />\n";
That will mean you can use a system config item called site.favicon which you set to the relative or absolute path to your favicon file e.g. you could set it to:
site.favicon = /freenats.ico
(this means if FreeNATS is on http://server/monitoring/freenats/ the file is at http://server/freenats.ico)
site.favicon = http://www.myiconserver.com/icons/whatever.ico
Will refer to one by full path.
HTH,
Regards,
Dave.
There's currently no supported method but I think it would be quite easy for me to put in as a config option.
In the meantime you have two choices.
1. If FreeNATS is on a web server root e.g. you go to http://myserver/ to access it then you can put a favicon.ico file in the web root folder (on the VM this is /srv/www/html)
2. You can change the following FreeNATS code - it's what I will do when I put this in and allows the favicon to be a configurable string.
Edit the file server/base/screen.inc.php
After line 90 e.g. after the block that goes:
/*
echo "<style type=\"text/css\">\n";
require("css/main.css");
echo "\n</style>\n";
*/
So on a new line after the close comment put in these two lines:
if ($NATS->Cfg->Get("site.favicon","")!="")
echo "<link rel=\"shortcut icon\" href=\"".$NATS->Cfg->Get("site.favicon","")."\" />\n";
That will mean you can use a system config item called site.favicon which you set to the relative or absolute path to your favicon file e.g. you could set it to:
site.favicon = /freenats.ico
(this means if FreeNATS is on http://server/monitoring/freenats/ the file is at http://server/freenats.ico)
site.favicon = http://www.myiconserver.com/icons/whatever.ico
Will refer to one by full path.
HTH,
Regards,
Dave.
-
- Posts: 92
- Joined: Thu Sep 04, 2008 9:48 pm
Re: favicon
Very cool! Works like a champ. Thanks, Dave!