Git Product home page Git Product logo

Comments (5)

vitalidze avatar vitalidze commented on May 29, 2024

The easiest way is to add a ContentPanel to the layout and set up custom style. This style must be defined in traccar.html (either in <head> or put css somewhere in webapp folder).

In LoginDialog.ui.xml:

<!-- ... -->
    <gxt:Window ui:field="window" pixelSize="300, 130" modal="true" closable="false" headingText="{i18n.authentication}" focusWidget="{login}">
    <container:VerticalLayoutContainer>
      <container:child layoutData="{verticalLayoutData}">
        <g:ContentPanel bodyStyleName="logo"/>
      </container:child>
      <container:child layoutData="{verticalLayoutData}">
        <form:FieldLabel text="{i18n.user}" labelWidth="110">
          <form:widget>
            <form:TextField ui:field="login" />
          </form:widget>
        </form:FieldLabel>
      </container:child>
<!-- ... -->

In traccar.html:

<!-- ... -->
<head>
<!-- ... -->
    <style type="text/css">
        .logo {
            background: url('logo.jpg') no-repeat;
        }
    </style>
<!-- ... -->
</head>
<!-- ... -->

from traccar-web.

Jeferex avatar Jeferex commented on May 29, 2024

It didn't work. The ContentPanel is a widget from GXT not G and it is shown inside the Login dialog but doesn't show the image. I think this is because the login Dialog is a window. I think it should be a panel or something else. What do you think of redesign the login page? A vertical panel should work. Also, include the logo and title as a setting (for the administrator) would be great.

What do you think?

from traccar-web.

vitalidze avatar vitalidze commented on May 29, 2024

It's working for me with CenterLayoutContainer:

<!-- ... -->
      <container:child layoutData="{verticalLayoutData}">
        <container:CenterLayoutContainer styleName="logo" pixelSize="280, 30"/>
      </container:child>
<!-- ... -->

You should specify size in pixels and style.

Regarding redesigning, you may submit a separate feature request about it. If someone besides you would need it, I will do it. Right now I doubt that it's valuable to spend time on it.

from traccar-web.

Jeferex avatar Jeferex commented on May 29, 2024

It worked, thanks! But I had to change a couple of things. This is what I did.

  • As you said, I had to add pixelSize in <container:child>
  • I had to increase window pixelSize so the logo can fit.
  • I added resizable = "false" draggable="false" to Window attributes so It didn't look weird with user interactions.

I think the last modification shoud added to dev branch.

Thanks

from traccar-web.

vitalidze avatar vitalidze commented on May 29, 2024

You are welcome. Can you please file a pull request with these changes? (resizable and draggable set to false for login dialog)

from traccar-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.