traccar各设备通讯协议分析(坐标转换、逆地址解析)

家用宽带架设服务器的技术交流,编程技术交流。
BG6RSH
帖子: 132
注册时间: 周日 6月 23, 2019 12:00 pm

Re: traccar各设备通讯协议分析(坐标转换、逆地址解析)

帖子 BG6RSH »

传统web管理界面修改
在6.2版中“tc_servers、tc_users”2表中删除了“twelvehourformat”字段,所以要修改2个文件。
1. traccar-web/legacy/web/app/model/User.js
  1. /*
  2.  * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org)
  3.  *
  4.  * This program is free software: you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation, either version 3 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16.  */
  17.  
  18. Ext.define('Traccar.model.User', {
  19.     extend: 'Ext.data.Model',
  20.     identifier: 'negative',
  21.  
  22.     fields: [{
  23.         name: 'id',
  24.         type: 'int'
  25.     }, {
  26.         name: 'name',
  27.         type: 'string'
  28.     }, {
  29.         name: 'login',
  30.         type: 'string'
  31.     }, {
  32.         name: 'email',
  33.         type: 'string'
  34.     }, {
  35.         name: 'password',
  36.         type: 'string'
  37.     }, {
  38.         name: 'phone',
  39.         type: 'string'
  40.     }, {
  41.         name: 'readonly',
  42.         type: 'boolean'
  43.     }, {
  44.         name: 'administrator',
  45.         type: 'boolean'
  46.     }, {
  47.         name: 'map',
  48.         type: 'string'
  49.     }, {
  50.         name: 'latitude',
  51.         type: 'float'
  52.     }, {
  53.         name: 'longitude',
  54.         type: 'float'
  55.     }, {
  56.         name: 'zoom',
  57.         type: 'int'
  58.     // }, {
  59.     //     name: 'twelveHourFormat',
  60.     //     type: 'boolean'
  61.     }, {
  62.         name: 'coordinateFormat',
  63.         type: 'string'
  64.     }, {
  65.         name: 'disabled',
  66.         type: 'boolean'
  67.     }, {
  68.         name: 'expirationTime',
  69.         type: 'date',
  70.         dateFormat: 'c'
  71.     }, {
  72.         name: 'deviceLimit',
  73.         type: 'int'
  74.     }, {
  75.         name: 'userLimit',
  76.         type: 'int'
  77.     }, {
  78.         name: 'deviceReadonly',
  79.         type: 'boolean'
  80.     }, {
  81.         name: 'limitCommands',
  82.         type: 'boolean'
  83.     }, {
  84.         name: 'disableReports',
  85.         type: 'boolean'
  86.     }, {
  87.         name: 'poiLayer',
  88.         type: 'string'
  89.     }, {
  90.         name: 'attributes'
  91.     }],
  92.  
  93.     proxy: {
  94.         type: 'rest',
  95.         url: 'api/users',
  96.         writer: {
  97.             type: 'json',
  98.             writeAllFields: true
  99.         }
  100.     }
  101. });
2. traccar-web/legacy/web/app/model/Server.js
  1. /*
  2.  * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org)
  3.  *
  4.  * This program is free software: you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation, either version 3 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16.  */
  17.  
  18. Ext.define('Traccar.model.Server', {
  19.     extend: 'Ext.data.Model',
  20.     identifier: 'negative',
  21.  
  22.     fields: [{
  23.         name: 'id',
  24.         type: 'int'
  25.     }, {
  26.         name: 'registration',
  27.         type: 'boolean'
  28.     }, {
  29.         name: 'readonly',
  30.         type: 'boolean'
  31.     }, {
  32.         name: 'deviceReadonly',
  33.         type: 'boolean'
  34.     }, {
  35.         name: 'limitCommands',
  36.         type: 'boolean'
  37.     }, {
  38.         name: 'disableReports',
  39.         type: 'boolean'
  40.     }, {
  41.         name: 'map',
  42.         type: 'string'
  43.     }, {
  44.         name: 'bingKey',
  45.         type: 'string'
  46.     }, {
  47.         name: 'mapUrl',
  48.         type: 'string'
  49.     }, {
  50.         name: 'latitude',
  51.         type: 'float'
  52.     }, {
  53.         name: 'longitude',
  54.         type: 'float'
  55.     }, {
  56.         name: 'zoom',
  57.         type: 'int'
  58.     // }, {
  59.     //     name: 'twelveHourFormat',
  60.     //     type: 'boolean'
  61.     }, {
  62.         name: 'forceSettings',
  63.         type: 'boolean'
  64.     }, {
  65.         name: 'coordinateFormat',
  66.         type: 'string'
  67.     }, {
  68.         name: 'poiLayer',
  69.         type: 'string'
  70.     }, {
  71.         name: 'announcement',
  72.         type: 'string'
  73.     }, {
  74.         name: 'attributes'
  75.     }],
  76.  
  77.     proxy: {
  78.         type: 'ajax',
  79.         url: 'api/server',
  80.         actionMethods: {
  81.             update: 'PUT'
  82.         },
  83.         writer: {
  84.             type: 'json',
  85.             writeAllFields: true
  86.         }
  87.     }
  88. });
回复