Register Button

CCPlusIT 9 years ago

We use api to add the user to traccar when they register on our website, I would like to know where I can remove the register button from login screen and not just disable it from admin. Disabling it also disables registering over api.
I see two files in /web/app/view/dialog Login.js and LoginController.js does removing reference to register button remove this function from web view login screen.

Anton Tananaev 9 years ago

You can remove or hide it in the Login class.

CCPlusIT 9 years ago

Is it possible to give more detail, Tried altering this:

    buttons: [{
        text: Strings.loginRegister,
        handler: 'onRegisterClick',
        reference: 'registerButton'
    }, {
        text: Strings.loginLogin,
        handler: 'onLoginClick'
    }]

to below and restarted traccar but the button still shows.

    buttons: [{
        text: Strings.loginLogin,
        handler: 'onLoginClick'
    }]

The only way I have managed to keep api register and disable register is to block controller.register",onCreateClick:function() line 64 app.min.js

Thanks in advance

Anton Tananaev 9 years ago

You've altered correct code, but you need to compiled minified version after changing any JavaScript code. There is a minify script in tools that you can use.

CCPlusIT 9 years ago

Thank you for reply I assume you mean this? is there any where that I research on how to use.

@echo off
cd C:\[traccar path]\traccar\web
set SDK=C:\[sencha path]\ext-6.2.0

sencha -sdk %SDK% compile -classpath=app.js,app,%SDK%\packages\core\src,%SDK%\packages\core\overrides,%SDK%\classic\classic\src,%SDK%\classic\classic\overrides exclude -all and include -recursive -file app.js and exclude -namespace=Ext and concatenate -closure app.min.js
Anton Tananaev 9 years ago

Yes, that's the one. You need ExtJS and Sencha CMD to be able to run it.

Mohcine Madkour 5 years ago

@CCPlusIT @Anton the solution does give a blank page with no form on it, I followed the steps on https://www.traccar.org/build-extjs/ for compiling and generating the app.min.js successfully but when copied to opt/traccar/web it does not work even if I copy the whole web folder and replace it it does not work. Now I am thinking that traccar web on https://github.com/traccar/traccar-web is maybe a different version that what I have installed 2 months a go. Could that be the reason?

Anton Tananaev 5 years ago

I don't think there are any significant differences. Anyway, you can always compare to verify it yourself.

Mohcine Madkour 5 years ago

Sure but what could be an alternative to remove the register button from the home page?