How can I change the background of the login page to an image in version 5.9?

Oarroyave 2 years ago

Hello, I need to change the background image of the login screen. Is it possible in version 5.9?

Anton Tananaev 2 years ago

There's no image there to change. You mean add?

Oarroyave 2 years ago

Understood, I want to add an image

Oarroyave 2 years ago

How can I add the background of the login page to an image in version 5.9?

Cristian 2 years ago

import the image to use

import Image from '../resources/images/fondo-gps.jpg';

add these lines in the sidebar part: {

    backgroundImage: `url(${Image})`,
    backgroundSize: 'cover',
    height: '100vh',

this is the section
https://github.com/traccar/traccar-web/blob/master/modern/src/login/LoginLayout.jsx#L12

I have other changes in the login, but with what I indicate you can start, maybe a case you should work in the paper section https://github.com/traccar/traccar-web/blob/master/modern/src/login/LoginLayout.jsx#L26

my result is as follows
https://ibb.co/FY1fCLV

If you have any doubt you can ask again

Oarroyave 2 years ago

Cristian Thank you very much for the timely response. I thought the change was made in a CSS file. After making this change in the code, does it need to be recompiled?

Cristian 2 years ago