Customization on web app

Hi, I wanna know how can I deploy a little customization of web app into my traccar server?

Peter Flower6 years ago

What kind of customization?

Well you have a validation to make the state of devices.

So, when you catch if is an "alarm" this make the background color red and that was right, also you made a link to show the address, and a link for media files, but, you did it using "else if" statements, this make that just one of these will be accomplish, instead you need only "if" statements or "case" statements to do when a state have alarm, direction and media all of these, show on the right way.

Peter Flower6 years ago

Do you have some pics about it?

Yes but i don't know how to upload from my laptop

renderer: function (value, metaData, record) {
                var position, device;
                if (record.get('attribute') === 'alarm') {
                    metaData.tdCls = 'view-color-red';
                } else if (record.get('name') === Strings.positionAddress && !value) {
                    return '<a href="#" onclick="Ext.fireEvent(\'stategeocode\')" >' +
                        Strings.sharedShowAddress + '</a>';
                } else if (record.get('name') === Strings.positionImage || record.get('name') === Strings.positionAudio) {
                    position = this.getController().position;
                    if (position) {
                        device = Ext.getStore('Devices').getById(position.get('deviceId'));
                        if (device) {
                            return '<a target="_blank" href="/api/media/' + device.get('uniqueId') + '/' + value + '" >' +
                                value + '</a>';
                        }
                    }
                }
                return value;
            }```

I'm referring to this code above

Instead of use 'else if', I'm using separated 'if' statements for a correct behavior.