aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-14 13:43:20 +0300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-14 13:43:20 +0300
commitd9777620508a7b197f0e5752869eef91d83e20a0 (patch)
treec247f37ed7621fba2eca775f628a19790a3bbf3c /web
parent5d3b7cbe5924d4a4552035626a83e26b1e756255 (diff)
downloadtrackermap-server-d9777620508a7b197f0e5752869eef91d83e20a0.tar.gz
trackermap-server-d9777620508a7b197f0e5752869eef91d83e20a0.tar.bz2
trackermap-server-d9777620508a7b197f0e5752869eef91d83e20a0.zip
Use relative URLs for web app
Diffstat (limited to 'web')
-rw-r--r--web/app/controller/Root.js8
-rw-r--r--web/app/model/Server.js2
-rw-r--r--web/app/model/User.js2
-rw-r--r--web/app/store/AllDevices.js2
-rw-r--r--web/app/store/AllGeofences.js2
-rw-r--r--web/app/store/AllGroups.js2
-rw-r--r--web/app/store/AllNotifications.js2
-rw-r--r--web/app/store/CommandTypes.js2
-rw-r--r--web/app/store/Devices.js2
-rw-r--r--web/app/store/Events.js2
-rw-r--r--web/app/store/Geofences.js2
-rw-r--r--web/app/store/Groups.js2
-rw-r--r--web/app/store/Notifications.js2
-rw-r--r--web/app/store/Positions.js2
-rw-r--r--web/app/store/ReportEvents.js2
-rw-r--r--web/app/store/ReportRoute.js2
-rw-r--r--web/app/store/ReportSummary.js2
-rw-r--r--web/app/store/Users.js2
-rw-r--r--web/app/view/CommandDialogController.js2
-rw-r--r--web/app/view/DevicesController.js2
-rw-r--r--web/app/view/GroupsController.js2
-rw-r--r--web/app/view/LoginController.js4
-rw-r--r--web/app/view/NotificationsController.js2
-rw-r--r--web/app/view/RegisterController.js2
-rw-r--r--web/app/view/UsersController.js6
-rw-r--r--web/locale.js2
26 files changed, 32 insertions, 32 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 6d18f4073..9ca7c9e40 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -33,7 +33,7 @@ Ext.define('Traccar.controller.Root', {
onLaunch: function () {
Ext.Ajax.request({
scope: this,
- url: '/api/server',
+ url: 'api/server',
callback: this.onServerReturn
});
},
@@ -44,7 +44,7 @@ Ext.define('Traccar.controller.Root', {
Traccar.app.setServer(Ext.decode(response.responseText));
Ext.Ajax.request({
scope: this,
- url: '/api/session',
+ url: 'api/session',
callback: this.onSessionReturn
});
} else {
@@ -107,8 +107,8 @@ Ext.define('Traccar.controller.Root', {
asyncUpdate: function (first) {
var protocol, socket, self = this;
- protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
- socket = new WebSocket(protocol + '//' + window.location.host + '/api/socket');
+ protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
+ socket = new WebSocket(protocol + '//' + window.location.host + window.location.pathname + 'api/socket');
socket.onclose = function (event) {
self.asyncUpdate(false);
diff --git a/web/app/model/Server.js b/web/app/model/Server.js
index 02968c2d6..2ed8f12f4 100644
--- a/web/app/model/Server.js
+++ b/web/app/model/Server.js
@@ -60,7 +60,7 @@ Ext.define('Traccar.model.Server', {
proxy: {
type: 'ajax',
- url: '/api/server',
+ url: 'api/server',
actionMethods: {
update: 'PUT'
},
diff --git a/web/app/model/User.js b/web/app/model/User.js
index 352acc651..b162bada9 100644
--- a/web/app/model/User.js
+++ b/web/app/model/User.js
@@ -60,7 +60,7 @@ Ext.define('Traccar.model.User', {
proxy: {
type: 'rest',
- url: '/api/users',
+ url: 'api/users',
writer: {
type: 'json',
writeAllFields: true
diff --git a/web/app/store/AllDevices.js b/web/app/store/AllDevices.js
index 8a6f7d5ef..3f51926e3 100644
--- a/web/app/store/AllDevices.js
+++ b/web/app/store/AllDevices.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.AllDevices', {
proxy: {
type: 'rest',
- url: '/api/devices',
+ url: 'api/devices',
extraParams: {
all: true
}
diff --git a/web/app/store/AllGeofences.js b/web/app/store/AllGeofences.js
index aa6f9abfc..35209967b 100644
--- a/web/app/store/AllGeofences.js
+++ b/web/app/store/AllGeofences.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.AllGeofences', {
proxy: {
type: 'rest',
- url: '/api/geofences',
+ url: 'api/geofences',
extraParams: {
all: true
}
diff --git a/web/app/store/AllGroups.js b/web/app/store/AllGroups.js
index 880ccc8f5..8ce0cc2f6 100644
--- a/web/app/store/AllGroups.js
+++ b/web/app/store/AllGroups.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.AllGroups', {
proxy: {
type: 'rest',
- url: '/api/groups',
+ url: 'api/groups',
extraParams: {
all: true
}
diff --git a/web/app/store/AllNotifications.js b/web/app/store/AllNotifications.js
index fed02b260..9e9cb791d 100644
--- a/web/app/store/AllNotifications.js
+++ b/web/app/store/AllNotifications.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.AllNotifications', {
proxy: {
type: 'rest',
- url: '/api/users/notifications',
+ url: 'api/users/notifications',
extraParams: {
all: true
}
diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js
index d3825fb95..48405db6f 100644
--- a/web/app/store/CommandTypes.js
+++ b/web/app/store/CommandTypes.js
@@ -22,7 +22,7 @@ Ext.define('Traccar.store.CommandTypes', {
'beforeload' : function (store) {
var proxy;
proxy = store.getProxy();
- proxy.setUrl('/api/commandtypes?deviceId' + proxy.extraParams.deviceId);
+ proxy.setUrl('api/commandtypes?deviceId' + proxy.extraParams.deviceId);
}
},
diff --git a/web/app/store/Devices.js b/web/app/store/Devices.js
index 8ba513792..c3c37331c 100644
--- a/web/app/store/Devices.js
+++ b/web/app/store/Devices.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.Devices', {
proxy: {
type: 'rest',
- url: '/api/devices',
+ url: 'api/devices',
writer: {
writeAllFields: true
}
diff --git a/web/app/store/Events.js b/web/app/store/Events.js
index 54b341d30..2698933fe 100644
--- a/web/app/store/Events.js
+++ b/web/app/store/Events.js
@@ -20,6 +20,6 @@ Ext.define('Traccar.store.Events', {
proxy: {
type: 'rest',
- url: '/api/events'
+ url: 'api/events'
}
});
diff --git a/web/app/store/Geofences.js b/web/app/store/Geofences.js
index 8c5c0b3cf..a0b01ae64 100644
--- a/web/app/store/Geofences.js
+++ b/web/app/store/Geofences.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.Geofences', {
proxy: {
type: 'rest',
- url: '/api/geofences',
+ url: 'api/geofences',
writer: {
writeAllFields: true
}
diff --git a/web/app/store/Groups.js b/web/app/store/Groups.js
index 938abed64..8740b25d3 100644
--- a/web/app/store/Groups.js
+++ b/web/app/store/Groups.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.Groups', {
proxy: {
type: 'rest',
- url: '/api/groups',
+ url: 'api/groups',
writer: {
writeAllFields: true
}
diff --git a/web/app/store/Notifications.js b/web/app/store/Notifications.js
index 5dc8cb614..04cd9b863 100644
--- a/web/app/store/Notifications.js
+++ b/web/app/store/Notifications.js
@@ -20,6 +20,6 @@ Ext.define('Traccar.store.Notifications', {
proxy: {
type: 'rest',
- url: '/api/users/notifications'
+ url: 'api/users/notifications'
}
});
diff --git a/web/app/store/Positions.js b/web/app/store/Positions.js
index b201c219c..8675983e5 100644
--- a/web/app/store/Positions.js
+++ b/web/app/store/Positions.js
@@ -20,6 +20,6 @@ Ext.define('Traccar.store.Positions', {
proxy: {
type: 'rest',
- url: '/api/positions'
+ url: 'api/positions'
}
});
diff --git a/web/app/store/ReportEvents.js b/web/app/store/ReportEvents.js
index bdef7a170..1759ffde8 100644
--- a/web/app/store/ReportEvents.js
+++ b/web/app/store/ReportEvents.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.ReportEvents', {
proxy: {
type: 'rest',
- url: '/api/reports/events',
+ url: 'api/reports/events',
headers: {
'Accept': 'application/json'
}
diff --git a/web/app/store/ReportRoute.js b/web/app/store/ReportRoute.js
index fc96fc022..ab6da94ce 100644
--- a/web/app/store/ReportRoute.js
+++ b/web/app/store/ReportRoute.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.ReportRoute', {
proxy: {
type: 'rest',
- url: '/api/reports/route',
+ url: 'api/reports/route',
headers: {
'Accept': 'application/json'
}
diff --git a/web/app/store/ReportSummary.js b/web/app/store/ReportSummary.js
index 2e4a8750d..35dad736b 100644
--- a/web/app/store/ReportSummary.js
+++ b/web/app/store/ReportSummary.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.ReportSummary', {
proxy: {
type: 'rest',
- url: '/api/reports/summary',
+ url: 'api/reports/summary',
headers: {
'Accept': 'application/json'
}
diff --git a/web/app/store/Users.js b/web/app/store/Users.js
index 16901008d..53a49ff8c 100644
--- a/web/app/store/Users.js
+++ b/web/app/store/Users.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.store.Users', {
proxy: {
type: 'rest',
- url: '/api/users',
+ url: 'api/users',
writer: {
writeAllFields: true
}
diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js
index 1b5ca0ce0..9da5bd42e 100644
--- a/web/app/view/CommandDialogController.js
+++ b/web/app/view/CommandDialogController.js
@@ -51,7 +51,7 @@ Ext.define('Traccar.view.CommandDialogController', {
Ext.Ajax.request({
scope: this,
- url: '/api/commands',
+ url: 'api/commands',
jsonData: record.getData(),
callback: this.onSendResult
});
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js
index ca3e24661..85aa5fcd4 100644
--- a/web/app/view/DevicesController.js
+++ b/web/app/view/DevicesController.js
@@ -96,7 +96,7 @@ Ext.define('Traccar.view.DevicesController', {
baseObjectName: 'deviceId',
linkObjectName: 'geofenceId',
storeName: 'Geofences',
- urlApi: '/api/devices/geofences',
+ urlApi: 'api/devices/geofences',
baseObject: device.getData().id
}
}).show();
diff --git a/web/app/view/GroupsController.js b/web/app/view/GroupsController.js
index 4cf1459a6..7413f64a8 100644
--- a/web/app/view/GroupsController.js
+++ b/web/app/view/GroupsController.js
@@ -71,7 +71,7 @@ Ext.define('Traccar.view.GroupsController', {
baseObjectName: 'groupId',
linkObjectName: 'geofenceId',
storeName: admin ? 'AllGeofences' : 'Geofences',
- urlApi: '/api/groups/geofences',
+ urlApi: 'api/groups/geofences',
baseObject: group.getData().id
}
}).show();
diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js
index 8beef1e04..698cc7f9c 100644
--- a/web/app/view/LoginController.js
+++ b/web/app/view/LoginController.js
@@ -35,7 +35,7 @@ Ext.define('Traccar.view.LoginController', {
Ext.Ajax.request({
scope: this,
method: 'POST',
- url: '/api/session',
+ url: 'api/session',
params: form.getValues(),
callback: function (options, success, response) {
Ext.getBody().unmask();
@@ -60,7 +60,7 @@ Ext.define('Traccar.view.LoginController', {
Ext.Ajax.request({
scope: this,
method: 'DELETE',
- url: '/api/session',
+ url: 'api/session',
callback: function () {
window.location.reload();
}
diff --git a/web/app/view/NotificationsController.js b/web/app/view/NotificationsController.js
index 90479fe07..628343a84 100644
--- a/web/app/view/NotificationsController.js
+++ b/web/app/view/NotificationsController.js
@@ -64,7 +64,7 @@ Ext.define('Traccar.view.NotificationsController', {
var record = this.getView().getStore().getAt(rowIndex);
Ext.Ajax.request({
scope: this,
- url: '/api/users/notifications',
+ url: 'api/users/notifications',
jsonData: {
userId: this.userId,
type: record.getData().type,
diff --git a/web/app/view/RegisterController.js b/web/app/view/RegisterController.js
index dfc4a1735..b79c5f59b 100644
--- a/web/app/view/RegisterController.js
+++ b/web/app/view/RegisterController.js
@@ -24,7 +24,7 @@ Ext.define('Traccar.view.RegisterController', {
Ext.Ajax.request({
scope: this,
method: 'POST',
- url: '/api/users',
+ url: 'api/users',
jsonData: form.getValues(),
callback: this.onCreateReturn
});
diff --git a/web/app/view/UsersController.js b/web/app/view/UsersController.js
index e745ee04c..73088a40e 100644
--- a/web/app/view/UsersController.js
+++ b/web/app/view/UsersController.js
@@ -77,7 +77,7 @@ Ext.define('Traccar.view.UsersController', {
linkObjectName: 'deviceId',
storeName: 'AllDevices',
linkStoreName: 'Devices',
- urlApi: '/api/permissions/devices',
+ urlApi: 'api/permissions/devices',
baseObject: user.getData().id
}
}).show();
@@ -93,7 +93,7 @@ Ext.define('Traccar.view.UsersController', {
linkObjectName: 'groupId',
storeName: 'AllGroups',
linkStoreName: 'Groups',
- urlApi: '/api/permissions/groups',
+ urlApi: 'api/permissions/groups',
baseObject: user.getData().id
}
}).show();
@@ -109,7 +109,7 @@ Ext.define('Traccar.view.UsersController', {
linkObjectName: 'geofenceId',
storeName: 'AllGeofences',
linkStoreName: 'Geofences',
- urlApi: '/api/permissions/geofences',
+ urlApi: 'api/permissions/geofences',
baseObject: user.getData().id
}
}).show();
diff --git a/web/locale.js b/web/locale.js
index f98801b16..4de476c90 100644
--- a/web/locale.js
+++ b/web/locale.js
@@ -69,7 +69,7 @@ if (!(Locale.language in Locale.languages)) {
}
Ext.Ajax.request({
- url: '/l10n/' + Locale.language + '.json',
+ url: 'l10n/' + Locale.language + '.json',
callback: function (options, success, response) {
Strings = Ext.decode(response.responseText);
}