Background modify

waca9 years ago

Hello,

Is there a way to replace the actually 'grey' background, by a "picture file" please ?
It's about the first access asking for "login/passwd"; I don't want to modify the "login/passwd" window, but only the background all around this window.

Thanks.

Waca

Anton Tananaev9 years ago

You can just add background image to "release.html" file.

waca9 years ago

This is the end of my release.html
As you see, my own picture's name is fondaccueil.png and is inside /opt/traccar/web
Because it don't work....

  • I tried to convert it as .jpg
  • I tried to put the code line <body background... upper in the release.html
  • I move it to the /home/me/picture
  • I cleared my chrome and firefox cache
    All I did don't display my own fondaccueil.png
<script type="text/javascript">Ext.Loader.loadScript('app.min.js');</script>
</head>
<body background="/opt/traccar/web/fondaccueil.png">
<div style="position: fixed; bottom: 10px; right: 15px; font-size: x-small;">Powered by <a href="https://traccar.org/"> Geolocalisation Traccar</a></div>
</body>
</html>#"

Another idea to help me please ?
Thanks.

Waca

Anton Tananaev9 years ago

Try this (you can't use full file system path):

<body background="fondaccueil.png">
waca9 years ago

Thanks Anton, but, still don't display it :(

waca9 years ago

Each modification I do, I stop and restart service.

Anton Tananaev9 years ago

Try to just open your image in browser:

http://localhost:8082/fondaccueil.png

waca9 years ago

HTTP ERROR 404

Problem accessing /fondaccueil.png. Reason:

Not Found

Powered by Jetty://

Anton Tananaev9 years ago

You must be missing something. I just tried it on my local server and it works. Note that file names are case sensitive.

waca9 years ago

yes, it's all in little caracters !!!

I renamed my picture as another name, still don't display.
I use traccar as French but the name don't have some special caracters as é or à

the picture must be inside /opt/traccar/web you confirm that ?
I try to put it in /opt/traccar with the same bas result.

Anton Tananaev9 years ago

Yes, it should be in /opt/traccar/web. Not sure why it's not working.

FdoHdez7 years ago

Hello Anton.

On Traccar 3.11 I got the same problem. I have modified realese.html to:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Vigicar</title>
<link rel="stylesheet" href="app.css">
</head>
<body background="inicio-foto.png">
<div id="spinner"></div>
<script id="loadScript" src="load.js"></script> 
</body>
</html>

inicio-foto.png is at: /opt/traccar/web and even I can see it on web browser for: http://localhost/inicio-foto.png

I noticed that when page is loading from server in the first time the image is showed, but when the spinner finish the background image is replaced by the gray background color.

Maybe, after this two years from last post, do you have additional insight about what is wrong?

Any help will be very appreciated. Thanks in advanced.

Anton Tananaev7 years ago

Try to add another element instead of changing body background.

FdoHdez7 years ago

Hello Anton. Sorry by late reply.

I finally solved by creating a javascript function at load.js file:

function addBackgroundImage() {
  document.body.style.backgroundImage = "url('inicio-foto.png')";
}

And then calling this function after addSvgFile('animal.svg')

Thank you for your help Anton

socstur7 years ago

is there a way to make the background image only show for the login page? The method above also shows the background image after the user is logged into the platform.