();
before: any;
emmnerr: any;
Load: any
+ isTag:boolean = false;
$event: any;
Indianstate = [ "Andhra Pradesh",
"Arunachal Pradesh",
@@ -291,6 +292,8 @@ searchFilter(text: string) {
this.dealer_Permission = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).cust_add_permission;
this.organisation = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).organisation;
// console.log(test);
+ let userRole = JSON.parse(atob(window.localStorage.token.split('.')[1])).customer_role;
+ this.isTag = userRole == 'tag' ? true :false;
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
this.adbtn = localStorage.getItem("dlrchk");
localStorage.setItem("dlrchk", this.custtype);
@@ -370,7 +373,9 @@ searchFilter(text: string) {
this.previewButton=false;
}
this.custumer = data;
-
+ this.custumer.forEach(cust=>{
+ this.getAddress(cust);
+ })
console.log("custDetail=>", this.custumer);
}, err => {
// console.log("errlog");
@@ -479,6 +484,7 @@ tab:any;
//this.custumer[i].Dealer_full_name = (this.custumer[i].Dealer.first_name ? this.custumer[i].Dealer.first_name : '') + ' ' +(this.custumer[i].Dealer.last_name ? this.custumer[i].Dealer.last_name : '');
// this.custumer[i].email=this.custumer[i].user.email?this.custumer[i].user.email:''
this.custumer[i].user_id = this.custumer[i].user && this.custumer[i].user.user_id?this.custumer[i].user.user_id:''
+ this.custumer[i].pin = this.custumer[i].user && this.custumer[i].user.pin?this.custumer[i].user.pin:''
this.custumer[i].phone = this.custumer[i].user && this.custumer[i].user.phone?this.custumer[i].user.phone:'';
this.custumer[i].address = this.custumer[i].user && this.custumer[i].user.address ? this.custumer[i].user.address : ''
this.custumer[i].fullName = (this.custumer[i].user && this.custumer[i].user.first_name ? this.custumer[i].user.first_name : '') + " " + (lastName ? lastName :'');
@@ -506,7 +512,7 @@ tab:any;
}
downloadFile(data) {
- let arrHeader = ["Device_ID", "kycApprovalDateOnly", "vahanID", "device_Type_csv", "IccidNo", "sim_number", "sim_number2", 'sim_provider', 'License', 'Dealer_full_name', 'phone', 'DocName', 'adharNumber', "fullName", "ConcernPersonName", 'phone', 'manufacturingCompany', 'Model', 'ChassisNo', 'engineNo', 'fuelType', 'Device_Name', 'transportOfficeCity', 'transportOfficeState', 'pin', "transportOfficeState", 'rto', "stateServer", 'state_certifcate_date', 'DocName', 'adharNumber', 'address'];
+ let arrHeader = ["Device_ID", "kycApprovalDateOnly", "vahanID", "device_Type_csv", "IccidNo", "sim_number", "sim_number2", 'sim_provider', 'License', 'Dealer_full_name', 'CID_No', 'DocName', 'adharNumber', "fullName", "ConcernPersonName", 'phone', 'manufacturingCompany', 'Model', 'ChassisNo', 'engineNo', 'fuelType', 'Device_Name', 'transportOfficeCity', 'transportOfficeState', 'pin', "transportOfficeState", 'rto', "stateServer", 'state_certifcate_date', 'DocName', 'adharNumber', 'address'];
let arrHeaderOld = ["fullName", "email", "phone", "user_id","kycStatus","Device_Name","Device_ID","esim_validity","remark","RtoState","RtoCity"];
let csvData = this.ConvertToCSV(data, arrHeader);
let blob = new Blob(['\ufeff' + csvData], { type: 'text/csv;charset=utf-8;' });
@@ -579,7 +585,7 @@ tab:any;
let dialogRef = this.dialog.open(DeviceDocComponent, {
width: '900px',
// height:'900px',
- data: { dealer_payload: docs }
+ data: { dealer_payload: docs,isTag :(this.isTag ? this.isTag : false )}
});
@@ -656,4 +662,21 @@ exportCertificate(data){
})
}
+getAddress(data) {
+ data.lastAddress = '';
+ if(data.last_location) {
+ var latlng_1 = data.last_location
+
+ this.contactService.getAddressByApi(latlng_1).subscribe(res=>{
+
+ if(res.message == "Address not found in databse"){
+ data.lastAddress = 'NA'
+ }else{
+
+ data.lastAddress = res.address;
+ }
+ })
+ }
+
+}
}
\ No newline at end of file
diff --git a/src/app/kyc-approval/kyc-approval.component.ts b/src/app/kyc-approval/kyc-approval.component.ts
index cc8db5d..5eeecdc 100644
--- a/src/app/kyc-approval/kyc-approval.component.ts
+++ b/src/app/kyc-approval/kyc-approval.component.ts
@@ -261,6 +261,7 @@ searchFilter(text: string) {
logo: any;
text: any;
superAdmin: Boolean = false;
+
ngOnInit() {
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
@@ -273,7 +274,7 @@ searchFilter(text: string) {
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
let test = JSON.parse(window.atob(window.localStorage.token.split('.')[1]));
this.dealer_Permission = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).cust_add_permission;
-
+
// console.log(test);
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
this.adbtn = localStorage.getItem("dlrchk");
diff --git a/src/app/location/cmd-ui/cmd-ui.component.ts b/src/app/location/cmd-ui/cmd-ui.component.ts
index 9049329..02da823 100644
--- a/src/app/location/cmd-ui/cmd-ui.component.ts
+++ b/src/app/location/cmd-ui/cmd-ui.component.ts
@@ -25,7 +25,7 @@ export class CmdUIComponent implements OnInit {
ngOnInit() {
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
var d_model = this.data.deviceObject.device_model;
- this.contactService.getDeviceModelbyID(d_model).subscribe(res=>{
+ this.contactService.getDeviceModelbyID(d_model._id ?d_model._id : d_model ).subscribe(res=>{
console.log('deviceModel=>',res);
this.device_type = res[0].device_type;
})
diff --git a/src/app/location/command-window/command-window.component.ts b/src/app/location/command-window/command-window.component.ts
index b6d24a2..408ded2 100644
--- a/src/app/location/command-window/command-window.component.ts
+++ b/src/app/location/command-window/command-window.component.ts
@@ -29,7 +29,7 @@ export class CommandWindowComponent implements OnInit {
console.log(this.data);
this.DeviceName = this.data.deviceObject.Device_Name;
- this.contactService.getDeviceModelbyID(d_model).subscribe(res=>{
+ this.contactService.getDeviceModelbyID(d_model._id ?d_model._id : d_model ).subscribe(res=>{
console.log('deviceModel=>',res);
this.device_type = res[0].device_type;
diff --git a/src/app/location/location.component.html b/src/app/location/location.component.html
index cdbd81d..a2079c4 100644
--- a/src/app/location/location.component.html
+++ b/src/app/location/location.component.html
@@ -8,6 +8,7 @@
+
{{headingName | translate}}
@@ -108,7 +109,11 @@
- {{device.Device_Name}}
+
+
{{device.Device_Name}}
+
{{device.last_ping_on ? (device.last_ping_on | date : 'medium') : ''}}
+
+
{{device.vehicleGroup?device.vehicleGroup.name:'N/A'}}
@@ -236,7 +241,7 @@
-
{{'Vehicle' | translate}}
+
{{'Vehicle' | translate}}
-
@@ -505,8 +510,8 @@
{{ImmErrMsg}}
-
-
+
+
",
disableAutoPan: false,
@@ -5009,7 +4929,7 @@ export class LocationComponent implements OnInit, OnDestroy {
strokeOpacity: 1,
scale: 4
};
-
+
var flightPath = new google.maps.Polyline({
geodesic: true,
strokeColor: '#0000FF',
@@ -5042,8 +4962,11 @@ export class LocationComponent implements OnInit, OnDestroy {
],
});
-
-
+
+ outerThis.polyLinePathObject = flightPath;
+ outerThis.polyLinePathArrayNew[(new Date()).getTime()] = flightPath;
+ outerThis.polyLinePathArray[outerThis.tempMapHistory.length] = flightPath;
+
function zoomToObject(obj) {
var bounds = new google.maps.LatLngBounds();
var points = obj.getPath().getArray();
@@ -5126,13 +5049,13 @@ export class LocationComponent implements OnInit, OnDestroy {
initMap(GeoFencCoords);
let outerThis = this;
function initMap(GeoFencCoords) {
- map = new google.maps.Map(document.getElementById('map'), {
+ //map = new google.maps.Map(document.getElementById('map'), );
+
+ map = outerThis.getMapObject({
zoom: 17,
center: { lat: GeoFencCoords[0].lat, lng: GeoFencCoords[0].lng },
mapTypeId: 'terrain'
- });
-
-
+ })
var bermudaTriangle = new google.maps.Polygon({
paths: GeoFencCoords,
strokeColor: '#FF0000',
@@ -5327,7 +5250,7 @@ export class LocationComponent implements OnInit, OnDestroy {
this.activatedRoute.queryParams.subscribe((params: Params) => {
this.navId = params['pageid'];
-
+
if (this.navId === 'locationHistory') {
this.tabIndexValue = "2";
this.showHistory = true;
@@ -5342,7 +5265,7 @@ export class LocationComponent implements OnInit, OnDestroy {
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
- var mapHistory = new google.maps.Map(document.getElementById("map2"), myOptions);
+ var mapHistory = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({
center: {
@@ -5352,7 +5275,8 @@ export class LocationComponent implements OnInit, OnDestroy {
map: mapHistory,
title: "Your current location!",
});
-
+
+ this.markers.push(marker)
})
}
@@ -5541,7 +5465,6 @@ export class LocationComponent implements OnInit, OnDestroy {
this.socket_Notify = this.injectData.getSocket_notifIO();
this.socket_Notify.on('connect', function (this) {
- console.log('notify connect ', this);
});
this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY, h:mm:ss a' }, { containerClass: this.colorTheme });
@@ -5657,7 +5580,7 @@ export class LocationComponent implements OnInit, OnDestroy {
// this.checker = 'OK';
window.localStorage['checker'] = 'Data'
- // debugger;
+ //
// console.log("this.fin=>",this.fin);
this.activatedRoute.queryParams.subscribe((params: Params) => {
this.getData = params['_dname'];
@@ -5870,7 +5793,10 @@ export class LocationComponent implements OnInit, OnDestroy {
}
- this.foods.push(a);
+ if(!this.foods.find(k=>k.did == a.did)) {
+
+ this.foods.push(a);
+ }
}
@@ -5905,14 +5831,17 @@ export class LocationComponent implements OnInit, OnDestroy {
})
}
filterDevicesNew(dlr) {
- if ((this.navId === 'locationHistory')) {
+ if (true) {
if (dlr) {
const filterdealerValue: any = dlr;
this.foods = [];
this.masterFoods.forEach(pp => {
let t = pp.viewValue.toLocaleLowerCase().indexOf(filterdealerValue.toLocaleLowerCase());
if (t > -1) {
- this.foods.push(pp)
+ if(!this.foods.find(k=>k.did == pp.did)) {
+
+ this.foods.push(pp)
+ }
}
});
} else {
@@ -6434,7 +6363,8 @@ export class LocationComponent implements OnInit, OnDestroy {
map: map,
icon: idelImage,
});
-
+
+ this.markers.push(marker_idle);
var content_idle = ' Idle Start-: '
+ arrivalTime_idle + '
Idle End-: '
+ departureTime_idle + '
Time Duration (HH:MM:SS)-: '
@@ -6699,7 +6629,7 @@ export class LocationComponent implements OnInit, OnDestroy {
// console.log("1111111199999");
this.livetrack(device.Device_ID);
}
- this.getLastTrip(device.Device_ID);
+ this.getLastTrip(device._id);
}
getVehColor(colorid, devicestatus) {
@@ -6873,7 +6803,9 @@ export class LocationComponent implements OnInit, OnDestroy {
iconType: this.deviceList[k].iconType,
// checked: true
}
- this.foods.push(a);
+ if(!this.foods.find(k=>k.did == a.did)) {
+ this.foods.push(a);
+ }
if (k === (this.deviceList.length - 1)) {
// console.log("1111111110100000");
if (this.navId != 'locationHistory') {
@@ -7024,6 +6956,7 @@ export class LocationComponent implements OnInit, OnDestroy {
this.deviceSelect = this.buindhistoryDevice;
}
this.disableSearch = true;
+ let that = this;
navigator.geolocation.getCurrentPosition(function (position) {
var myOptions = {
zoom: 18,
@@ -7033,16 +6966,17 @@ export class LocationComponent implements OnInit, OnDestroy {
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
- var mapHistory = new google.maps.Map(document.getElementById("map2"), myOptions);
+ // var mapHistory = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({
center: {
lat: position.coords.latitude,
lng: position.coords.longitude
},
- map: mapHistory,
+ map: that.map,
title: "Your current location!",
});
+ //that.markers.push(marker);
}
)
@@ -7061,11 +6995,12 @@ export class LocationComponent implements OnInit, OnDestroy {
if (id === 'datapoint') { this.dataColor = !this.dataColor };
}
- removetracks(id1, arrIndex) {
+ removetracks(id1, arrIndex,actualIndex) {
// console.log('id1', id1);
// console.log('arrIndex', arrIndex);
if ((id1 === 'all') && (arrIndex == null)) {
clearTimeout(this.start);
+ this.removePath();
this.tempMapHistory = [];
this.playingHistory = false;
@@ -7075,6 +7010,7 @@ export class LocationComponent implements OnInit, OnDestroy {
}
if (id1 === 'single') {
clearTimeout(this.start);
+ this.removePathByIndex(actualIndex);
this.tempMapHistory.splice(arrIndex, 1);
// console.log('this.tempMapHistory', this.tempMapHistory);
if (this.tempMapHistory.length === 0) {
@@ -7088,6 +7024,7 @@ export class LocationComponent implements OnInit, OnDestroy {
refresh_map() {
+ let outerThis = this;
navigator.geolocation.getCurrentPosition(function (position) {
var myOptions = {
zoom: 18,
@@ -7097,7 +7034,7 @@ export class LocationComponent implements OnInit, OnDestroy {
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
- var mapHistory = new google.maps.Map(document.getElementById("map2"), myOptions);
+ var mapHistory = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({
center: {
@@ -7107,7 +7044,7 @@ export class LocationComponent implements OnInit, OnDestroy {
map: mapHistory,
title: "Your current location!",
});
-
+ outerThis.markers.push(marker);
})
}
@@ -7209,8 +7146,7 @@ export class LocationComponent implements OnInit, OnDestroy {
} else {
devModelId = deviceObj.device_model._id;
}
-
-
+ debugger
this.contactService.getDeviceModelbyID(devModelId).subscribe(resModel => {
var deviceType = resModel[0].device_type;
// console.log('resModel', deviceType);
@@ -7428,13 +7364,7 @@ export class LocationComponent implements OnInit, OnDestroy {
this.enabletrail = !this.enabletrail;
if (this.enabletrail == false) {
this.flightPathArr = [];
- // this.flightPath_live = new google.maps.Polyline({
- // path: this.flightPathArr,
- // geodesic: true,
- // strokeOpacity: 1.0,
- // strokeColor: "#0000FF",
- // strokeWeight: 6
- // });
+
this.flightPath_live.setMap(null);
@@ -7458,17 +7388,14 @@ export class LocationComponent implements OnInit, OnDestroy {
// }
// that.elm++;
if (flightPathArr.length != 0) {
- console.log("ARRAY", flightPathArr);
if (that.elm) {
flightPathArr.splice(0, 0, that.elm)
flightPathArr.join()
}
- console.log("ARRAY", flightPathArr);
that.elm = flightPathArr[flightPathArr.length - 1];
flightPathArr.splice(flightPathArr.length - 1, 1);
- console.log("ARRAY2", flightPathArr);
clearTimeout(tempTimeInterval);
tempTimeInterval = setTimeout(function () {
that.flightPath_live = new google.maps.Polyline({
@@ -7479,6 +7406,7 @@ export class LocationComponent implements OnInit, OnDestroy {
strokeWeight: 6
});
// console.log(mapData);
+
that.flightPath_live.setMap(that.mapNew);
}, time)
@@ -7486,8 +7414,35 @@ export class LocationComponent implements OnInit, OnDestroy {
}
-
-
+ polyLinePathObject:any;
+ polyLinePathArray:any = {};
+ polyLinePathArrayNew:any = {};
+ removePathByIndex(index) {
+ if(this.polyLinePathArray[index]) {
+ this.polyLinePathArray[index].setMap(null);
+ }
+
+ this.onlyRemoveMarkers();
+ this.markers = [];
+ }
+ removePath() {
+ if(this.flightPath_live) {
+ this.flightPath_live.setMap(null);
+ }
+ if(this.polyLinePathObject) {
+ this.polyLinePathObject.setMap(null);
+ }
+ this.removeAllPath(this.polyLinePathArrayNew);
+ this.onlyRemoveMarkers();
+ this.markers = [];
+ }
+ removeAllPath(dataArry) {
+ for (const [key, value] of Object.entries(dataArry)) {
+ if(dataArry[key]) {
+ dataArry[key].setMap(null);
+ }
+ }
+ }
saveAddress(lat, lng, address) {
var addressObj = {
"lat": lat,
@@ -7887,7 +7842,9 @@ export class LocationComponent implements OnInit, OnDestroy {
// checked:true
}
- this.foods.push(a);
+ if(!this.foods.find(k=>k.did == a.did)) {
+ this.foods.push(a);
+ }
if (k === (this.deviceList.length - 1)) {
// console.log("1111111121212");
this.livetrack(null);
@@ -7931,13 +7888,11 @@ export class LocationComponent implements OnInit, OnDestroy {
viewStreet() {
- console.log("Street View");
}
triggerDeviceCmd(dev) {
- console.log('device Object', dev);
// CmdUIComponent
let dialogRef = this.dialog.open(CommandWindowComponent, {
width: '500px',
@@ -8015,7 +7970,7 @@ export class LocationComponent implements OnInit, OnDestroy {
var limit = 200;
// console.log('what is skip here',skip);
- this.contactService.filteredNotifications(fd, td, this.bulkVar, device_imei, userid, skip, limit)
+ this.contactService.filteredNotifications(fd, td, this.bulkVar, dev._id, userid, skip, limit)
.subscribe(res => {
// console.log('res=>',res);
this.notifArray = [];
@@ -8137,6 +8092,8 @@ export class LocationComponent implements OnInit, OnDestroy {
map: this.mapNew,
icon: this.markerArray[indexSwitch].icon,
});
+
+ this.markers.push(m);
this.markerArray[indexSwitch].marker = m;
this.mapNew.setCenter({ lat: this.markerArray[indexSwitch].lat, lng: this.markerArray[indexSwitch].lng });
if (this.markerArray[indexSwitch].number_plate)
@@ -8246,7 +8203,7 @@ export class LocationComponent implements OnInit, OnDestroy {
var imei = JSON.parse(localStorage.getItem('devDetail')) ? JSON.parse(localStorage.getItem('devDetail')) : this.temptrackingDev
// console.log(imei,"====>",imei,this.temptrackingDev);
if (!imei) {
- imei = this.deviceSelect[0].did
+ imei = this.deviceSelect[0].did
} else {
if (imei.vehicleId) {
imei = imei.vehicleId
@@ -8296,7 +8253,7 @@ export class LocationComponent implements OnInit, OnDestroy {
// console.log(zzz[0].lat)
// initMap(GeoFencCoords);
// function initMap(GeoFencCoords) {
- // map = new google.maps.Map(document.getElementById('map2'), {
+ // map = new google.maps.Map(document.getElementById('map'), {
// zoom: 17,
// center: {lat: GeoFencCoords[0].lat, lng: GeoFencCoords[0].lng},
// mapTypeId: 'terrain'
@@ -8345,10 +8302,20 @@ export class LocationComponent implements OnInit, OnDestroy {
change(device) {
// console.log(device);
- this.deviceSelect[0] = device;
+ this.deviceSelect[0] = device;
+ if(this.deviceSelect[0] && this.deviceList.length ) {
+ let filterDevice = this.deviceList.find(dData=>dData.Device_ID== this.deviceSelect[0].did);
+ if(filterDevice) {
+ this.deviceSelect[0] = filterDevice;
+ this.deviceSelect[0].did = filterDevice.Device_ID
+ }
+ }
// console.log(this.deviceSelect);
}
+ checkData() {
+ console.log('tabIndexValue',this.currentPage);
+ }
startAddress: any;
deviceNameForPDF
startTime
@@ -8396,7 +8363,7 @@ export class LocationComponent implements OnInit, OnDestroy {
image
pdf() {
var image = ""
- if (this.deviceList[0].supAdmin.imageDoc.length != 0) {
+ if (this.deviceList[0].supAdmin.imageDoc && this.deviceList[0].supAdmin.imageDoc.length != 0) {
var str = this.deviceList[0].supAdmin.imageDoc[0]
var splitStr = str.split('/');
var concatStr = '';
@@ -8427,7 +8394,7 @@ export class LocationComponent implements OnInit, OnDestroy {
// console.log(this.tempMapHistory,this.startAddress,this.endAddress, this.image);
- var element = $('#map2');
+ var element = $('#map');
var pdfOptions = {
orientation: "landscape", // One of "portrait" or "landscape" (or shortcuts "p" (Default), "l")
unit: "mm", //Measurement unit to be used when coordinates are specified. One of "pt" (points), "mm" (Default), "cm", "in"
@@ -8579,8 +8546,10 @@ export class LocationComponent implements OnInit, OnDestroy {
iconType: this.final[i].iconType
}
+ if(!this.foods.find(k=>k.did == a.did)) {
- this.foods.push(a);
+ this.foods.push(a);
+ }
}
@@ -8609,8 +8578,8 @@ export class LocationComponent implements OnInit, OnDestroy {
center: new google.maps.LatLng(18.602941, 73.777147),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
-
- var map = new google.maps.Map(document.getElementById('map'), myOptions);
+
+ var map = this.getMapObject(myOptions)
// console.log('mapmapmapmapmapmapmapmapmapmapmapmapmapmap',map);
var trafficLayer = new google.maps.TrafficLayer();
// trafficLayer.setMap(map);
@@ -8688,13 +8657,16 @@ export class LocationComponent implements OnInit, OnDestroy {
})
this.contactService.getAddressByApiBulk(latLongArray).subscribe(latLongAddress => {
- this.reportArr1.forEach((deData,index)=>{
- let latLng = {
- lat: deData.latDecimal ? deData.latDecimal : 0,
- long: deData.longDecimal ? deData.longDecimal : 0
- }
- this.contactService.latLongAddress[latLng.long+'_'+latLng.lat] = latLongAddress[index];
- })
+ if(latLongAddress && latLongAddress.length) {
+
+ this.reportArr1.forEach((deData,index)=>{
+ let latLng = {
+ lat: deData.latDecimal ? deData.latDecimal : 0,
+ long: deData.longDecimal ? deData.longDecimal : 0
+ }
+ this.contactService.latLongAddress[latLng.long+'_'+latLng.lat] = latLongAddress[index];
+ })
+ }
@@ -8972,7 +8944,8 @@ export class LocationComponent implements OnInit, OnDestroy {
// console.log(this.tempMapHistory[0]);
var date1 = new Date(this.datefrom).toISOString();
var date2 = new Date(this.date2).toISOString();
- this.contactService.get('/notifs/ignitionReportForMobile?from_date=' + date1 + '&to_date=' + date2 + '&_u=' + this.useridd + '&device=' + device.Device_ID).subscribe((res: any) => {
+
+ this.contactService.get('/notifs/ignitionReportForMobile?from_date=' + date1 + '&to_date=' + date2 + '&_u=' + this.useridd + '&device=' + device._id).subscribe((res: any) => {
// console.log(res);
if (res.length > 0) {
this.workingHours = res[0].workingHours != "" && res[0].workingHours ? res[0].workingHours : 0
@@ -8993,5 +8966,28 @@ export class LocationComponent implements OnInit, OnDestroy {
// console.log(err);
})
}
-
+ getMapObject(myOptions,setZoom = false) {
+ this.deleteMarkers();
+ if(!this.singleMap) {
+ this.singleMap = new google.maps.Map(document.getElementById('map'), myOptions);
+ }
+ if(setZoom) {
+ this.singleMap.setCenter(myOptions.center);
+ this.singleMap.setZoom(myOptions.zoom)
+ }
+ return this.singleMap;
+ }
+ deleteMarkers() {
+ //Loop through all the markers and remove
+ this.onlyRemoveMarkers();
+ this.markers = [];
+ this.removePath();
+};
+onlyRemoveMarkers(){
+ for (var i = 0; i < this.markers.length; i++) {
+ if(this.markers[i]) {
+ this.markers[i].setMap(null);
+ }
+}
+}
}
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index bc2cde8..128dce3 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -250,7 +250,7 @@ passwordIcon:any = "visibility_off";
psd: this.password
}
this.showLoader = true;
- // debugger;
+ //
this.dataService.log(newlog)
.subscribe(login => {
@@ -292,6 +292,7 @@ passwordIcon:any = "visibility_off";
this.showLoader = true;
this.dataService.log(newlog)
.subscribe(login => {
+ debugger
this.showLoader = false;
this.logins.push(login);
// console.log(JSON.parse("TOKEN",login.token));
@@ -303,7 +304,7 @@ passwordIcon:any = "visibility_off";
localStorage.setItem('currentuser',JSON.parse(atob(login.token.split('.')[1]))._id);
var userId = JSON.parse(atob(login.token.split('.')[1]))._id;
this.getLanguage(userId,isOperator,JSON.parse(atob(login.token.split('.')[1])).customer_role);
-
+ debugger
}, (err: any) => {
// console.log(err.status);
// console.log(err);
@@ -343,7 +344,8 @@ this.dataService.log(newlog)
- //this.router.navigateByUrl("const?_i="+login.token);
+ //
+this.router.navigateByUrl("const?_i="+login.token);
} , (err: any) => {
// console.log(err.status);
@@ -525,8 +527,10 @@ this.dataService.log(newlog)
window.localStorage['currentpwd'] = this.password
localStorage.setItem('currentuser',JSON.parse(atob(login.token.split('.')[1]))._id);
// if()
- this.router.navigateByUrl("const?_status="+"OK");
- // this.router.navigateByUrl("const?_i="+login.token);
+
+this.router.navigateByUrl("const?_status="+"OK");
+ //
+this.router.navigateByUrl("const?_i="+login.token);
} , (err: any) => { console.log(err.status);
// console.log(err);
@@ -688,10 +692,12 @@ countdown( elementName, minutes, seconds )
if( window.localStorage['Custumer'] == 'ON'){
window.localStorage['token'] = window.localStorage['Dealer_token'];
window.localStorage['Custumer'] = 'OFF'
- this.router.navigateByUrl("const?_status="+"OK");
+
+this.router.navigateByUrl("const?_status="+"OK");
}
else{
- this.router.navigateByUrl("const?_status="+"OK");
+
+this.router.navigateByUrl("const?_status="+"OK&&redirect=true");
}
}
@@ -921,13 +927,14 @@ getLanguage(userid,isOperator,customer_role){
launch_toast();
}else{
- if(customer_role=="kycApproval"){
+ if(customer_role=="kycApproval" || customer_role=="tag"){
this.router.navigateByUrl("KycApproval");
- }else if(customer_role=="cc"){
+ }else if(customer_role=="cc" ){
this.router.navigateByUrl("reports/notification_master");
}else{
- this.router.navigateByUrl("const?_status="+"OK");
+
+this.router.navigateByUrl("const?_status="+"OK&&redirect=true");
}
}
diff --git a/src/app/notification/notification.component.ts b/src/app/notification/notification.component.ts
index 7940764..3b70b4c 100644
--- a/src/app/notification/notification.component.ts
+++ b/src/app/notification/notification.component.ts
@@ -71,7 +71,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
return function(msg){
// console.log(msg);
- // debugger; theft alert
+ // theft alert
if((outerThis.superAdmin=== true)&&(msg.item._type === "Ignition Alert" || msg.item._type==="Theft Alert" || msg.item._type=="Max Stoppage Alert" || msg.item._type=="Max Idling Alert")){
// console.log("msgmsgmsgmsgmsgmsgmsgmsgmsgmsg",msg);
}else{
diff --git a/src/app/poi-list/poi-list.component.ts b/src/app/poi-list/poi-list.component.ts
index 753375c..5b0260d 100644
--- a/src/app/poi-list/poi-list.component.ts
+++ b/src/app/poi-list/poi-list.component.ts
@@ -39,7 +39,8 @@ export class PoiListComponent implements OnInit {
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
diff --git a/src/app/poi-master-edit/poi-master-edit.component.ts b/src/app/poi-master-edit/poi-master-edit.component.ts
index a8ffcf1..72f480a 100644
--- a/src/app/poi-master-edit/poi-master-edit.component.ts
+++ b/src/app/poi-master-edit/poi-master-edit.component.ts
@@ -337,7 +337,7 @@ export class PoiMasterEditComponent implements OnInit {
"address" : outerthis.addressString_edit,
"radius" : outerthis.poiRadius
}
- debugger;
+
if(outerthis.poitype != undefined){
editPOIobj['poi_type'] = outerthis.poitype;
}
diff --git a/src/app/poidetails/poidetails.component.ts b/src/app/poidetails/poidetails.component.ts
index 9adb130..864c65b 100644
--- a/src/app/poidetails/poidetails.component.ts
+++ b/src/app/poidetails/poidetails.component.ts
@@ -147,7 +147,7 @@ export class POIdetailsComponent implements OnInit {
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
@@ -190,7 +190,8 @@ export class POIdetailsComponent implements OnInit {
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
diff --git a/src/app/point-of-intrest/point-of-intrest.component.ts b/src/app/point-of-intrest/point-of-intrest.component.ts
index a7c6797..832a12d 100644
--- a/src/app/point-of-intrest/point-of-intrest.component.ts
+++ b/src/app/point-of-intrest/point-of-intrest.component.ts
@@ -168,7 +168,8 @@ export class PointOfIntrestComponent implements OnInit {
}
soon() {
- this.router.navigateByUrl("const?_i=" + window.localStorage.token);
+
+this.router.navigateByUrl("const?_i=" + window.localStorage.token);
}
new() {
@@ -314,7 +315,7 @@ export class PointOfIntrestComponent implements OnInit {
}
routePath: any = [];
// routeDetails(uId){
- // debugger;
+ //
// console.log("routeDetails",uId);
// this.contactService.getRouteDetail(uId)
// .subscribe(res=>{
diff --git a/src/app/point-share/point-share.component.ts b/src/app/point-share/point-share.component.ts
index f705ce7..71661a5 100644
--- a/src/app/point-share/point-share.component.ts
+++ b/src/app/point-share/point-share.component.ts
@@ -37,7 +37,7 @@ export class PointShareComponent implements OnInit {
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
console.log({'this.superAdmin':this.superAdmin,'this.custtype': this.custtype});
- // debugger;
+ //
// if(this.superAdmin === true){
// this.pointId = this.useridd ;
// }
diff --git a/src/app/report/all-menus/all-menus.component.html b/src/app/report/all-menus/all-menus.component.html
index b54316f..c3c5c1b 100644
--- a/src/app/report/all-menus/all-menus.component.html
+++ b/src/app/report/all-menus/all-menus.component.html
@@ -118,7 +118,9 @@
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="superAdmin || custtype" (click)="VType('admin')">{{'Vehicle Type' | translate}}
-
+
diff --git a/src/app/report/all-menus/all-menus.component.ts b/src/app/report/all-menus/all-menus.component.ts
index b764b47..4dbad99 100644
--- a/src/app/report/all-menus/all-menus.component.ts
+++ b/src/app/report/all-menus/all-menus.component.ts
@@ -266,7 +266,8 @@ export class AllMenusComponent implements OnInit {
//2 menu dashboard
soon(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
- this.router.navigateByUrl("const?_i=" + window.localStorage.token);
+
+this.router.navigateByUrl("const?_i=" + window.localStorage.token);
}
// 3 menu
group(id) {
@@ -362,7 +363,9 @@ export class AllMenusComponent implements OnInit {
this.router.navigateByUrl("vehicle/reminder_service");
}
-
+ virtualDevice(id) {
+ this.router.navigateByUrl("virtualDevice");
+ }
TrackingHistory(id){
@@ -642,7 +645,7 @@ fuel_report(id){
localStorage.removeItem('profilePic');
}
this.router.navigateByUrl("add");
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
@@ -675,7 +678,7 @@ fuel_report(id){
}
this.router.navigateByUrl("dealerInfo");
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
@@ -723,6 +726,7 @@ fuel_report(id){
}
checkPassword(){
+
this.contactService.getImagePath(this.useridd).subscribe((res:any)=>{
if(localStorage.getItem('currentpwd') && localStorage.getItem('currentuser')){
diff --git a/src/app/report/header/header.component.ts b/src/app/report/header/header.component.ts
index d837453..bb8a155 100644
--- a/src/app/report/header/header.component.ts
+++ b/src/app/report/header/header.component.ts
@@ -218,7 +218,8 @@ export class HeaderComponent implements OnInit {
//2 menu dashboard
soon(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
- this.router.navigateByUrl("const?_i=" + window.localStorage.token);
+
+this.router.navigateByUrl("const?_i=" + window.localStorage.token);
}
// 3 menu
group(id) {
@@ -594,7 +595,7 @@ fuel_report(id){
localStorage.removeItem('profilePic');
}
this.router.navigateByUrl("add");
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
@@ -627,7 +628,7 @@ fuel_report(id){
}
this.router.navigateByUrl("dealerInfo");
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
diff --git a/src/app/report/main/main.component.ts b/src/app/report/main/main.component.ts
index f55c35b..3c273d2 100644
--- a/src/app/report/main/main.component.ts
+++ b/src/app/report/main/main.component.ts
@@ -56,7 +56,10 @@ export class MainComponent implements OnInit {
res => {
console.log(res);
// this.groups = res["group_details"];
+ if(res["group_details"]) {
+
localStorage.setItem("groupData",JSON.stringify(res["group_details"]))
+ }
// console.log(this.grpName);
})
}
diff --git a/src/app/report/notification/notification.component.ts b/src/app/report/notification/notification.component.ts
index f61d091..45b463a 100644
--- a/src/app/report/notification/notification.component.ts
+++ b/src/app/report/notification/notification.component.ts
@@ -69,7 +69,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
var outerThis = this;
return function(msg){
// console.log("msg",msg);
- // debugger; theft alert
+ // theft alert
if((outerThis.superAdmin=== true)&&outerThis.isCC&&(msg.item._type === "Ignition Alert" || msg.item._type==="Theft Alert" || msg.item._type=="Max Stoppage Alert" || msg.item._type=="Max Idling Alert")){
// console.log("msgmsgmsgmsgmsgmsgmsgmsgmsgmsg",msg);
}else{
@@ -168,7 +168,7 @@ mb:any
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
- if(cc=="cc"){
+ if(cc=="cc" ){
this.isCC=false;
}
diff --git a/src/app/report/report component/alert-report/alert-report.component.ts b/src/app/report/report component/alert-report/alert-report.component.ts
index e4280f7..efd0d6e 100644
--- a/src/app/report/report component/alert-report/alert-report.component.ts
+++ b/src/app/report/report component/alert-report/alert-report.component.ts
@@ -180,7 +180,8 @@ devi(){
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
new(){
@@ -226,7 +227,7 @@ mydealer(){
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
diff --git a/src/app/report/report component/day-wise-report/day-wise-report.component.html b/src/app/report/report component/day-wise-report/day-wise-report.component.html
index 1ebc6f1..8611013 100644
--- a/src/app/report/report component/day-wise-report/day-wise-report.component.html
+++ b/src/app/report/report component/day-wise-report/day-wise-report.component.html
@@ -2,7 +2,7 @@
-
{{'Daywise Report' | translate}}
+ {{'Daywise Report 1' | translate}}
@@ -32,6 +32,8 @@
{{'Stoppage Time (hh:mm)' | translate}}
{{'Idle Time (hh:mm)' | translate}}
{{'Fuel Consumed' | translate}}
+
{{'Avg Speed' | translate}}
+
{{'Max Speed' | translate}}
{{"Start Location" | translate}}
{{'End Location' | translate}}
diff --git a/src/app/report/report component/day-wise-report/day-wise-report.component.ts b/src/app/report/report component/day-wise-report/day-wise-report.component.ts
index eb0ceba..b0c4cdb 100644
--- a/src/app/report/report component/day-wise-report/day-wise-report.component.ts
+++ b/src/app/report/report component/day-wise-report/day-wise-report.component.ts
@@ -418,28 +418,28 @@ export class DayWiseReportComponent implements OnInit {
return hhmm;
}
},
-
{
- "data": "Mileage",
- "defaultContent": "_id",
+ "data": "fuel",
+ "defaultContent": "",
render: function (data, type, row) {
- // return data ? parseFloat(data).toFixed(2) : 0.0;
-
- if(data){
- if(row['Distance(Kms)']){
- var mileage=parseFloat(row['Distance(Kms)']) /parseFloat(data)
- return mileage.toFixed(2)
- }else{
- return ''
- }
-
- }else{
-
- return ''
- }
- // return hhmm;
+ return data?data.toFixed(2):'';
}
},
+ {
+ "data": "avgSpeed",
+ "defaultContent": "",
+ render: function (data, type, row) {
+ return data?data:'';
+ }
+ },
+ {
+ "data": "maxSpeed",
+ "defaultContent": "",
+ render: function (data, type, row) {
+ return data?data:'';
+ }
+ },
+
{
"data": "startAddress",
"defaultContent": "_id",
@@ -805,6 +805,8 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
'Stoppage Time':'Stoppage Time (HH:MM)',
'Idle Time':'Idle Time (HH:MM)',
fuelConsumed: 'Fuel Consumed',
+ avgSpeed:'Avg Speed',
+ maxSpeed :'max Speed',
startAddress:'Start Location',
endAddress:'End Location',
}
@@ -825,7 +827,9 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
'Moving Time':this.conversion(pdfBody[j]['Moving Time']),
'Stoppage Time':this.conversion(pdfBody[j]['Stoppage Time']),
"Idle Time":this.conversion(pdfBody[j]['Idle Time']),
- fuelConsumed: this.fuleConvert((pdfBody[j]['Distance(Kms)']).toFixed(2), pdfBody[j]['Mileage']),
+ fuelConsumed: pdfBody[j].fuel ? pdfBody[j].fuel.toFixed(2) : '',
+ avgSpeed: pdfBody[j].avgSpeed ? pdfBody[j].avgSpeed : '',
+ maxSpeed: pdfBody[j].maxSpeed ? pdfBody[j].maxSpeed : '',
startAddress:pdfBody[j].startAddress,
endAddress:pdfBody[j].endAddress,
});
diff --git a/src/app/report/report component/device-sosreport/device-sosreport.component.ts b/src/app/report/report component/device-sosreport/device-sosreport.component.ts
index 59b1e93..d99451d 100644
--- a/src/app/report/report component/device-sosreport/device-sosreport.component.ts
+++ b/src/app/report/report component/device-sosreport/device-sosreport.component.ts
@@ -232,7 +232,7 @@ private finalise = new Subject
();
});
// $('#deviceTable tbody').on('click', 'button', function() {
- // debugger;
+ //
// var data = that.tabelObj.row($(this).parents('tr')).data();
// console.log("button clicked");
// });
diff --git a/src/app/report/report component/device-speed-report/device-speed-report.component.ts b/src/app/report/report component/device-speed-report/device-speed-report.component.ts
index 62c6628..deba6c3 100644
--- a/src/app/report/report component/device-speed-report/device-speed-report.component.ts
+++ b/src/app/report/report component/device-speed-report/device-speed-report.component.ts
@@ -66,7 +66,8 @@ export class DeviceSpeedReportComponent implements OnInit {
// }
// soon() {
- // this.router.navigateByUrl("const?_i=" + window.localStorage.token);
+ //
+// this.router.navigateByUrl("const?_i=" + window.localStorage.token);
// }
@@ -230,7 +231,7 @@ export class DeviceSpeedReportComponent implements OnInit {
if (window.localStorage['DataLoaded'] = 'True') {
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
_lineChartData: any;
diff --git a/src/app/report/report component/drivers-performance-report/drivers-performance-report.component.ts b/src/app/report/report component/drivers-performance-report/drivers-performance-report.component.ts
index be0d1c3..bd403d3 100644
--- a/src/app/report/report component/drivers-performance-report/drivers-performance-report.component.ts
+++ b/src/app/report/report component/drivers-performance-report/drivers-performance-report.component.ts
@@ -156,7 +156,8 @@ devi(){
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
@@ -223,7 +224,7 @@ mydealer(){
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
diff --git a/src/app/report/report component/fuel-report/fuel-report.component.ts b/src/app/report/report component/fuel-report/fuel-report.component.ts
index c206815..fd19d25 100644
--- a/src/app/report/report component/fuel-report/fuel-report.component.ts
+++ b/src/app/report/report component/fuel-report/fuel-report.component.ts
@@ -138,7 +138,8 @@ devi(){
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
new(){
@@ -189,7 +190,7 @@ mydealer(){
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
diff --git a/src/app/report/report component/geofancing-report/geofancing-report.component.ts b/src/app/report/report component/geofancing-report/geofancing-report.component.ts
index fd48678..ea872f9 100644
--- a/src/app/report/report component/geofancing-report/geofancing-report.component.ts
+++ b/src/app/report/report component/geofancing-report/geofancing-report.component.ts
@@ -150,7 +150,7 @@ export class GeofancingReportComponent implements OnInit {
// if(window.localStorage['DataLoaded'] = 'True'){
// window.localStorage['Custumer'] = 'OFF'
// this.router.navigateByUrl("add")
- // // this.router.navigateByUrl("const?_status="+"OK");
+ //
// }
// }
@@ -178,7 +178,8 @@ export class GeofancingReportComponent implements OnInit {
// }
// soon(){
- // this.router.navigateByUrl("const?_i="+window.localStorage.token);
+ //
+// this.router.navigateByUrl("const?_i="+window.localStorage.token);
// }
@@ -409,7 +410,8 @@ export class GeofancingReportComponent implements OnInit {
that.contactService.postWithURL(suburl, {
"from_date": temp.from_date,
"to_date": temp.to_date,
- "geoidlist": that.deviceArr.length ? that.deviceArr : []
+ "geoidlist": that.deviceArr.length ? that.deviceArr : [],
+ 'device':that.deviceStrings
}).subscribe((resp: any) => {
// console.log(ignReport.length);
that.Load = false;
@@ -541,7 +543,7 @@ export class GeofancingReportComponent implements OnInit {
user: user
}
var suburl = "";
- suburl += "/notifs/GeoFencingReport?from_date=" + temp.from_date + '&to_date=' + temp.to_date + '&_u=' + temp.user;
+ suburl += "/notifs/GeoFencingReport?from_date=" + temp.from_date + '&to_date=' + temp.to_date + '&_u=' + temp.user +'&imeis='+that.imeisStrings;
that.finalArr = []
// console.log(this.deviceArr);
if (that.deviceArr.length != 0) {
@@ -743,7 +745,8 @@ export class GeofancingReportComponent implements OnInit {
}
}
-
+ deviceStrings = '';
+ imeisStrings = '';
getReport(event) {
if (event == 'getExcel') {
if(this.isNormalView) {
@@ -760,12 +763,19 @@ export class GeofancingReportComponent implements OnInit {
var that = this;
var fd = new Date(tpdata.fromDate);
var td = new Date(tpdata.toDate);
-
+
if (event.deviceArr.length == 0) {
deviceId = [];
} else {
deviceId = event.deviceArr;
}
+ if(event.device) {
+ this.deviceStrings = event.device
+
+ }
+ if(event.iemi) {
+ this.imeisStrings = event.iemi;
+ }
this.deviceArr = deviceId;
this.Fromdate = fd.toISOString();
diff --git a/src/app/report/report component/ideal-report/ideal-report.component.ts b/src/app/report/report component/ideal-report/ideal-report.component.ts
index cfdfc86..9eceee8 100644
--- a/src/app/report/report component/ideal-report/ideal-report.component.ts
+++ b/src/app/report/report component/ideal-report/ideal-report.component.ts
@@ -127,7 +127,8 @@ this.contactService.getIdealData(neww.did,r).subscribe(
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
@@ -229,7 +230,7 @@ mydealer(){
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
report_speed(){
diff --git a/src/app/report/report component/ign-report/ign-report.component.ts b/src/app/report/report component/ign-report/ign-report.component.ts
index 6be412e..502b00b 100644
--- a/src/app/report/report component/ign-report/ign-report.component.ts
+++ b/src/app/report/report component/ign-report/ign-report.component.ts
@@ -49,7 +49,8 @@ devi(){
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
new(){
@@ -202,7 +203,7 @@ creategraph(a){
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
getdata(final){
diff --git a/src/app/report/report component/ignition-report/ignition-report.component.ts b/src/app/report/report component/ignition-report/ignition-report.component.ts
index 8f13eaa..1810da2 100644
--- a/src/app/report/report component/ignition-report/ignition-report.component.ts
+++ b/src/app/report/report component/ignition-report/ignition-report.component.ts
@@ -236,7 +236,8 @@ ngOnDestroy(){
// }
// soon(){
-// this.router.navigateByUrl("const?_i="+window.localStorage.token);
+//
+// this.router.navigateByUrl("const?_i="+window.localStorage.token);
// }
// new(){
@@ -287,7 +288,7 @@ ngOnDestroy(){
// if(window.localStorage['DataLoaded'] = 'True'){
// window.localStorage['Custumer'] = 'OFF'
// this.router.navigateByUrl("add")
-// // this.router.navigateByUrl("const?_status="+"OK");
+//
// }
// }
diff --git a/src/app/report/report component/new-travel-path-report/new-travel-path-report.component.ts b/src/app/report/report component/new-travel-path-report/new-travel-path-report.component.ts
index b3c4f92..6585ec1 100644
--- a/src/app/report/report component/new-travel-path-report/new-travel-path-report.component.ts
+++ b/src/app/report/report component/new-travel-path-report/new-travel-path-report.component.ts
@@ -122,9 +122,9 @@ export class NewTravelPathReportComponent implements OnInit {
let result = [];
for (let i = 0; i < that.reportArr.length; i++) {
-
+ // char.speed !== last.speed
let char = that.reportArr[i];
- if (char.speed !== last.speed) {
+ if (true) {
var cum_distance = parseFloat(that.reportArr[i].odo) - parseFloat(that.reportArr[0].odo);
char.cum_distance = Math.abs(parseFloat(cum_distance.toFixed(2)))
@@ -238,8 +238,8 @@ export class NewTravelPathReportComponent implements OnInit {
{
"data": "distanceFromPrevious",
"render": function (data, type, row) {
- // var res = that.get_distance(row.index)
- return data;
+ var res = that.get_distance(row.index)
+ return data ?data : '0' ;
}
// return end_time;
},
@@ -248,7 +248,7 @@ export class NewTravelPathReportComponent implements OnInit {
"data": "speed",
"render": function (data, type, row) {
- return data;
+ return data? data : '0';
}
// return row.event_time;
},
@@ -256,7 +256,7 @@ export class NewTravelPathReportComponent implements OnInit {
"data": "avgSpeed",
"render": function (data, type, row) {
// var res = that.getavgSpeed(row.index)
- return data;
+ return data ? data : '0';;
}
},
{
@@ -275,14 +275,14 @@ export class NewTravelPathReportComponent implements OnInit {
},
{
- "data": "cum_distance",
+ "data": "cummulative",
"render": function (data, type, row) {
// var res=that.getcummulative_distance(row,row.index)
- return data;
+ return data ? data.toFixed(2) : '0';
}
},
{
- "data": "address",
+ "data": "latDecimal",
"render": function (data, type, row) {
var str = (row.latDecimal ? row.latDecimal : 0) + ' , ' + (row.longDecimal ? row.longDecimal : 0)
@@ -750,12 +750,12 @@ export class NewTravelPathReportComponent implements OnInit {
imei: pdfBody[j].imei,
date: moment(pdfBody[j].date).format('lll'),
odo: pdfBody[j].odo ? (pdfBody[j].odo).toFixed(2) : 0,
- distanceFromPrevious: pdfBody[j].distanceFromPrevious,
+ distanceFromPrevious: this.get_distanceNew(j,pdfBody),
speed: pdfBody[j].speed,
avgSpeed: pdfBody[j].avgSpeed,
externalBattery: pdfBody[j].external_Battery ? pdfBody[j].external_Battery : '0',
temperature: pdfBody[j].temp ? (parseFloat(pdfBody[j].temp) / 10).toFixed(2) : '0',
- cumDistance: pdfBody[j].cum_distance,
+ cumDistance: pdfBody[j].cummulative ?pdfBody[j].cummulative.toFixed(2) :0 ,
location: (pdfBody[j].latDecimal ? pdfBody[j].latDecimal : 0) + ' , ' + (pdfBody[j].longDecimal ? pdfBody[j].longDecimal : 0),
address: pdfBody[j].address,
@@ -788,7 +788,17 @@ export class NewTravelPathReportComponent implements OnInit {
if (index_1 == 0) {
return 0.00;
} else {
- var cum_distance = parseFloat(this.reportArr1[index_1].odo) - parseFloat(this.reportArr1[index_1 - 1].odo);
+ var cum_distance = parseFloat(this.reportArr1[index_1].cummulative) - parseFloat(this.reportArr1[index_1 - 1].cummulative);
+ // console.log(cum_distance);
+ return Math.abs(parseFloat(cum_distance.toFixed(2)));
+ }
+
+ }
+ get_distanceNew(index_1,array) {
+ if (index_1 == 0) {
+ return 0.00;
+ } else {
+ var cum_distance = parseFloat(array[index_1].cummulative) - parseFloat(array[index_1 - 1].cummulative);
// console.log(cum_distance);
return Math.abs(parseFloat(cum_distance.toFixed(2)));
}
diff --git a/src/app/report/report component/notification-master/notification-master.component.ts b/src/app/report/report component/notification-master/notification-master.component.ts
index 7cc13d2..55ef2a1 100644
--- a/src/app/report/report component/notification-master/notification-master.component.ts
+++ b/src/app/report/report component/notification-master/notification-master.component.ts
@@ -133,7 +133,7 @@ private finalise = new Subject();
accListener(){
var outerThis = this;
return function(msg){
- // debugger; theft alert
+ // theft alert
if((outerThis.superAdmin=== true || !outerThis.isCC)&&(msg.item._type === "Ignition Alert" || msg.item._type==="Theft Alert" || msg.item._type=="Max Stoppage Alert" || msg.item._type=="Max Idling Alert")){
// console.log("msgmsgmsgmsgmsgmsgmsgmsgmsgmsg",msg);
}else{
@@ -289,7 +289,7 @@ document.getElementById("mdMenu").style.display="none"
var cc= JSON.parse(window.atob(window.localStorage.token.split('.')[1])).customer_role;
- if(cc=="cc"){
+ if(cc=="cc" ){
this.isCC=false;
}
this.logo=window.localStorage['logo'];
diff --git a/src/app/report/report component/over-speed/over-speed.component.ts b/src/app/report/report component/over-speed/over-speed.component.ts
index a754e5c..2b10383 100644
--- a/src/app/report/report component/over-speed/over-speed.component.ts
+++ b/src/app/report/report component/over-speed/over-speed.component.ts
@@ -219,7 +219,8 @@ option:any;
// }
// soon(){
-// this.router.navigateByUrl("const?_i="+window.localStorage.token);
+//
+// this.router.navigateByUrl("const?_i="+window.localStorage.token);
// }
// new(){
@@ -265,7 +266,7 @@ option:any;
// if(window.localStorage['DataLoaded'] = 'True'){
// window.localStorage['Custumer'] = 'OFF'
// this.router.navigateByUrl("add")
-// // this.router.navigateByUrl("const?_status="+"OK");
+//
// }
// }
diff --git a/src/app/report/report component/route-violation/route-violation.component.ts b/src/app/report/report component/route-violation/route-violation.component.ts
index 6de31ee..c1f579b 100644
--- a/src/app/report/report component/route-violation/route-violation.component.ts
+++ b/src/app/report/report component/route-violation/route-violation.component.ts
@@ -187,7 +187,8 @@ ngOnDestroy(){
// }
// soon(){
-// this.router.navigateByUrl("const?_i="+window.localStorage.token);
+//
+// this.router.navigateByUrl("const?_i="+window.localStorage.token);
// }
// new(){
@@ -233,7 +234,7 @@ ngOnDestroy(){
// if(window.localStorage['DataLoaded'] = 'True'){
// window.localStorage['Custumer'] = 'OFF'
// this.router.navigateByUrl("add")
-// // this.router.navigateByUrl("const?_status="+"OK");
+//
// }
// }
diff --git a/src/app/report/report component/summary-report/summary-report.component.html b/src/app/report/report component/summary-report/summary-report.component.html
index 08d63b2..7d3db38 100644
--- a/src/app/report/report component/summary-report/summary-report.component.html
+++ b/src/app/report/report component/summary-report/summary-report.component.html
@@ -36,12 +36,14 @@
{{'Running (HH:MM)' | translate}}
{{'Stop (HH:MM)' | translate}}
+ {{'Avg Speed' | translate}}
+ {{'Max Speed' | translate}}
+ {{'Consumption' | translate}}
{{'Details' | translate}}
diff --git a/src/app/report/report component/summary-report/summary-report.component.ts b/src/app/report/report component/summary-report/summary-report.component.ts
index 91fc598..07d8ae4 100644
--- a/src/app/report/report component/summary-report/summary-report.component.ts
+++ b/src/app/report/report component/summary-report/summary-report.component.ts
@@ -646,10 +646,30 @@ testTable() {
"data": "today_stopped",
"defaultContent": "",
render: function (data, type, row) {
- console.log("today_stopped",data);
return data?that.millisecondConversion(data):0;
}
},
+ {
+ "data": "avgSpeed",
+ "defaultContent": "",
+ render: function (data, type, row) {
+ return data?data:'';
+ }
+ },
+ {
+ "data": "maxSpeed",
+ "defaultContent": "",
+ render: function (data, type, row) {
+ return data?data:'';
+ }
+ },
+ {
+ "data": "fuel",
+ "defaultContent": "",
+ render: function (data, type, row) {
+ return data?data.toFixed(2):'';
+ }
+ },
// {
@@ -1157,6 +1177,9 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
total_odo:'Total Km',
today_running:'Running (HH:MM)',
today_stopped:'Stop (HH:MM)',
+ avgSpeed:'Avg Speed',
+ maxSpeed:'Max Speed',
+ fuel:'Consumption',
}
];
@@ -1175,8 +1198,10 @@ var pageWidth = doc.internal.pageSize.width || doc.internal.pageSize.getWidth();
endAddress:pdfBody[j].endAddress?pdfBody[j].endAddress:'N/A',
total_odo:pdfBody[j].total_odo?(pdfBody[j].total_odo).toFixed(2):0,
today_running:this.millisecondConversion(pdfBody[j].today_running),
- today_stopped:this.millisecondConversion(pdfBody[j].today_stopped)
- });
+ today_stopped:this.millisecondConversion(pdfBody[j].today_stopped),
+ avgSpeed: pdfBody[j].avgSpeed ? pdfBody[j].avgSpeed : '',
+ maxSpeed: pdfBody[j].maxSpeed ? pdfBody[j].maxSpeed : '',
+ fuel: pdfBody[j].fuel ? pdfBody[j].fuel.toFixed(2) : ''});
}
return body;
}
diff --git a/src/app/report/report-filter/report-filter.component.html b/src/app/report/report-filter/report-filter.component.html
index a4b2411..c33fe01 100644
--- a/src/app/report/report-filter/report-filter.component.html
+++ b/src/app/report/report-filter/report-filter.component.html
@@ -138,6 +138,19 @@
+
+
+
{{'Devices ' | translate}} :
+
+
+
+
+ {{ udid.Device_Name }}
+
+
+
+
+
{
this.devicesss = JSON.parse(localStorage.getItem('vehicaleData'));
- this.groups=JSON.parse(localStorage.getItem('groupData'))
+ let ax = localStorage.getItem('groupData');
+ if(ax) {
+ this.groups=JSON.parse(localStorage.getItem('groupData'));
+ }
console.log(this.devicesss);
this.finall = (this.devicesss);
@@ -464,7 +467,13 @@ export class ReportFilterComponent implements OnInit {
that.showLoader = false;
}, 100);
-
+ if(this.componentIdentifier === 'geofence_report') {
+ $('#dbselectIMEI').multipleSelect({
+ width: 200,
+ placeholder: "Devices",
+ filter: true,
+ })
+ }
if(this.componentIdentifier === 'billing_detail'){
setTimeout(() => {
@@ -831,8 +840,21 @@ export class ReportFilterComponent implements OnInit {
}
- if(this.componentIdentifier=="geofence_report")
- this.reportService.geofenceReport(filter)
+ if(this.componentIdentifier=="geofence_report") {
+
+ let dIEMI = $('#dbselectIMEI').multipleSelect('getSelects','value');
+ let deviceIds = [];
+ dIEMI.forEach(demi=>{
+ let fDevice = this.devicesss.find(d=>d.Device_ID == demi);
+ if(fDevice) {
+ deviceIds.push(fDevice._id);
+ }
+ })
+
+ filter['device'] = deviceIds.toString();
+ filter['iemi']=dIEMI.toString();
+ this.reportService.geofenceReport(filter)
+ }
if(this.componentIdentifier=="idle_report")
this.reportService.idleReport(filter)
diff --git a/src/app/route-map-add/route-map-add.component.ts b/src/app/route-map-add/route-map-add.component.ts
index 8d2b6bf..9a97e6d 100644
--- a/src/app/route-map-add/route-map-add.component.ts
+++ b/src/app/route-map-add/route-map-add.component.ts
@@ -149,7 +149,8 @@ export class RouteMapAddComponent implements OnInit {
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
new(){
diff --git a/src/app/route-mapping/route-mapping.component.ts b/src/app/route-mapping/route-mapping.component.ts
index d0862c5..a3a66f7 100644
--- a/src/app/route-mapping/route-mapping.component.ts
+++ b/src/app/route-mapping/route-mapping.component.ts
@@ -102,7 +102,8 @@ export class RouteMappingComponent implements OnInit {
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
new(){
diff --git a/src/app/route-plan/route-plan.component.ts b/src/app/route-plan/route-plan.component.ts
index d9d641f..70c6c91 100644
--- a/src/app/route-plan/route-plan.component.ts
+++ b/src/app/route-plan/route-plan.component.ts
@@ -623,7 +623,7 @@ console.log(selectedVehicle,vehicle[0].substr(vehicle[0].indexOf(' ')+1), this.R
// this.wapointArray=[];
- // // debugger;
+ // //
// console.log(this.waypoints);
// for(var z = 0 ; z
',this)
this['infowindow'].open(map, this);
});
@@ -3552,7 +3552,7 @@ zoomSet(){
if (window.localStorage['DataLoaded'] = 'True') {
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
@@ -4516,7 +4516,7 @@ zoomSet(){
}
- // debugger;
+ //
console.log("initParking",stop_locations.length)
if (stop_locations.length > 0) {
// for(var l=0;l",this.fin);
this.activatedRoute.queryParams.subscribe((params: Params) => {
this.getData = params['token'];
diff --git a/src/app/sidebar/sidebar.component.ts b/src/app/sidebar/sidebar.component.ts
index 947e4ee..1334121 100644
--- a/src/app/sidebar/sidebar.component.ts
+++ b/src/app/sidebar/sidebar.component.ts
@@ -46,7 +46,7 @@ refresh()
this.total_final = this.final
console.log(this.final,"-------------------------------->")
- if(this.final.length == 0 ||this.final == null || !this.final){
+ if(!this.final || this.final.length == 0 ||this.final == null || !this.final){
this.add_dev = false
console.log("Load1");
// this.Load=false;
@@ -87,7 +87,7 @@ refresh()
console.log("7444444444444",this.final);
this.total_final = this.final
- if(this.final.length == 0 ||this.final == null || !this.final){
+ if(!this.final ||this.final.length == 0 ||this.final == null || !this.final){
this.add_dev = false
console.log("Load3");
// this.Load=false;
@@ -125,7 +125,7 @@ refresh()
var cord = JSON.parse(retrievedData);
this.final = cord
this.total_final = this.final
- if(this.final.length == 0 ||this.final == null || !this.final){
+ if(!this.final ||this.final.length == 0 ||this.final == null || !this.final){
this.add_dev = false;
console.log("Load6");
// this.Load=false;
@@ -148,9 +148,9 @@ refresh()
this.injectData.getData(this.emailid,this.useridd,this.groupId,this.skip,this.limit,this.search,this.supAdm,this.DealerID).subscribe(
(data)=> {
this.devicess = data
- this.final = this.devicess.devices
+ this.final = this.devicess.devices ? this.devicess.devices : []
this.total_final = this.final;
- if(this.final.length == 0 ||this.final == null || !this.final){
+ if(!this.final ||this.final.length == 0 ||this.final == null || !this.final){
this.add_dev = false
console.log("Load8");
// this.Load=false;
@@ -263,7 +263,7 @@ refresh()
*/
}
else{
- // debugger;
+ //
this.router.navigateByUrl("account?_did="+id+"."+name);
}
}
@@ -405,7 +405,7 @@ $(window).resize(function() {
Ing_Status(){
this.ing_Arr = []
-
+ this.final = this.final && this.final.length? this.final : []
for(var y=0; y{
// this.groupData = resp.map(function(d){
// d.vehicleDetails.map(function(d1){
- // debugger;
+ //
// socket_Ing.emit('acc',d1.Device_ID )
// socket_Ing.on(d1.Device_ID+'acc',()=>{
// return function(ind,data){
@@ -493,7 +493,7 @@ getrequest(para){
// socket_Ing.emit('stat',d1.Device_ID,d1.Device_Name,new Date().setHours(0,0,0,0),null)
// socket_Ing.on(d1.Device_ID+'stat',()=>{
// return function(ind,data){
- // debugger;
+ //
// console.log("459",data);
// d1=data;
// }
diff --git a/src/app/sub-amin/addsubadmin/addsubadmin.component.ts b/src/app/sub-amin/addsubadmin/addsubadmin.component.ts
index c2a32de..1015295 100644
--- a/src/app/sub-amin/addsubadmin/addsubadmin.component.ts
+++ b/src/app/sub-amin/addsubadmin/addsubadmin.component.ts
@@ -63,7 +63,7 @@ export class AddsubadminComponent implements OnInit {
logo:any;
text:any;
userID:any;
- role=[{name:'SubAdmin',value:'subadmin'},{name:"CC",value:'cc'}]
+ role=[{name:'SubAdmin',value:'subadmin'},{name:"CC",value:'cc'},{name:"tag",value:'tag'}]
role1=[{name:'SubAdmin',value:'subadmin'},{name:"KYC Approval",value:'kycApproval'},{name:"CC",value:'cc'}]
documentDetail:any;
imageURL:any;
diff --git a/src/app/sub-amin/sub-amin.component.ts b/src/app/sub-amin/sub-amin.component.ts
index 6ab410e..0fdacbe 100644
--- a/src/app/sub-amin/sub-amin.component.ts
+++ b/src/app/sub-amin/sub-amin.component.ts
@@ -174,7 +174,8 @@ export class SubAminComponent implements OnInit {
if (window.localStorage['DataLoaded'] = 'True') {
- this.router.navigateByUrl("const?_status=" + "OK");
+
+this.router.navigateByUrl("const?_status=" + "OK");
}
});
}
diff --git a/src/app/technician/technician.component.ts b/src/app/technician/technician.component.ts
index 0f8892d..b1b486c 100644
--- a/src/app/technician/technician.component.ts
+++ b/src/app/technician/technician.component.ts
@@ -331,7 +331,7 @@ export class TechnicianComponent implements OnInit {
// localStorage.setItem('Dealer',"OFF");
// localStorage.setItem('superadmin',"OFF")
console.log('this.superAdmin',this.superAdmin);
- debugger;
+
if(this.superAdmin === true){
localStorage.setItem('supAdminAcessToCust', 'true' );
}
@@ -340,7 +340,8 @@ export class TechnicianComponent implements OnInit {
localStorage.setItem("dlrchk", dlrStatus)
- this.router.navigateByUrl("const?_status=" + "OK");
+
+this.router.navigateByUrl("const?_status=" + "OK");
// console.log('testing', this.useridd);
}
@@ -395,7 +396,8 @@ export class TechnicianComponent implements OnInit {
this.router.navigateByUrl("device-report/ideal-report");
}
soon() {
- this.router.navigateByUrl("const?_i=" + window.localStorage.token);
+
+this.router.navigateByUrl("const?_i=" + window.localStorage.token);
}
new() {
@@ -438,7 +440,7 @@ export class TechnicianComponent implements OnInit {
if (window.localStorage['DataLoaded'] = 'True') {
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
diff --git a/src/app/vehicle-type/vehicle-type.component.ts b/src/app/vehicle-type/vehicle-type.component.ts
index b353593..13f5452 100644
--- a/src/app/vehicle-type/vehicle-type.component.ts
+++ b/src/app/vehicle-type/vehicle-type.component.ts
@@ -145,7 +145,8 @@ logout(){
this.router.navigateByUrl("login");
}
soon(){
- this.router.navigateByUrl("const?_i="+window.localStorage.token);
+
+this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
addcus(){
@@ -559,7 +560,7 @@ mydealer(){
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
- // this.router.navigateByUrl("const?_status="+"OK");
+
}
}
getdev(){
@@ -772,7 +773,7 @@ report_map(){
// // }
// // outerThis.deviceData[i].status = outerThis.status_toShow ;
- // // debugger;
+ // //
// // if(outerThis.deviceData[i].last_location==undefined){
// // outerThis.lattitude = null;
// // outerThis.longitude = null;
@@ -791,7 +792,7 @@ report_map(){
// // };
- // // debugger;
+ // //
// // geocoder.geocode(request, function(data,status){
// // if(status == google.maps.GeocoderStatus.OK){
// // if(data[0]!=null){
diff --git a/src/app/virtual-device/virtual-device.component.html b/src/app/virtual-device/virtual-device.component.html
new file mode 100644
index 0000000..8f0f87e
--- /dev/null
+++ b/src/app/virtual-device/virtual-device.component.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
{{'Virtual Device' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{'IMEI'| translate}}* :
+
+
+
+
+
+
+
+
{{'Host'| translate}}* :
+
+
+
+
+
+
+
+
{{'Port'| translate}}* :
+
+
+
+
+
+
+
+
{{'Model'| translate}}* :
+
+
+
+
+
+
{{'Upload Lat/long'| translate}}* :
+
+
+
+
+
+
+
+
+
+
+
{{ successMesssage }}
+
+
+
+
+
+ {{'Submit' | translate}}
+ {{'RESET' | translate}}
+
+
+
+
+
+
+
+
+
+ Host
+ IMEI
+ Port
+ Model
+
+
+
+
+ {{vdevice.host}}
+ {{vdevice.imei}}
+ {{vdevice.port}}
+ {{vdevice.model}}
+ Submit
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/virtual-device/virtual-device.component.scss b/src/app/virtual-device/virtual-device.component.scss
new file mode 100644
index 0000000..065ecad
--- /dev/null
+++ b/src/app/virtual-device/virtual-device.component.scss
@@ -0,0 +1,84 @@
+.limiter{
+ width:100%;
+ height:100vh;
+ padding-top: 7vh;
+
+}
+
+.rowStyle{
+ width:100%;
+ margin: 0;
+ height:100vh;
+}
+
+
+.container {
+ padding: 2rem 0rem;
+ }
+
+ h4 {
+ margin: 2rem 0rem 1rem;
+ }
+
+ .table-image {
+ td, th {
+ vertical-align: middle;
+ }
+ }
+
+
+ .table-wrap {
+ height: 80px;
+ overflow-y: auto;
+ }
+
+
+ #toast {
+ visibility: hidden;
+ max-width: 250px;
+ height: 50px;
+ /*margin-left: -125px;*/
+ margin: auto;
+ background-color: #333;
+ color: #fff;
+ text-align: center;
+ border-radius: 2px;
+
+ position: fixed;
+ z-index: 1;
+ left: 60%;right:0;
+ bottom: 80%;
+ font-size: 13px;
+ white-space: nowrap;
+}
+#toast #img{
+ width: 250px;
+ height: 50px;
+
+ float: left;
+
+ padding-top: 16px;
+ padding-bottom: 16px;
+
+ box-sizing: border-box;
+
+
+ background-color: #111;
+ color: #fff;
+}
+#toast #desc{
+
+
+ color: #fff;
+
+ padding: 16px;
+
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+#toast.show {
+ visibility: visible;
+ -webkit-animation: fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 2s, fadeout 0.5s 2.5s;
+ animation: fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 4s, fadeout 0.5s 4.5s;
+}
\ No newline at end of file
diff --git a/src/app/virtual-device/virtual-device.component.spec.ts b/src/app/virtual-device/virtual-device.component.spec.ts
new file mode 100644
index 0000000..85bee3e
--- /dev/null
+++ b/src/app/virtual-device/virtual-device.component.spec.ts
@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { VirtualDeviceComponent } from './virtual-device.component';
+
+describe('VirtualDeviceComponent', () => {
+ let component: VirtualDeviceComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ VirtualDeviceComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(VirtualDeviceComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should be created', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/virtual-device/virtual-device.component.ts b/src/app/virtual-device/virtual-device.component.ts
new file mode 100644
index 0000000..bbb5b59
--- /dev/null
+++ b/src/app/virtual-device/virtual-device.component.ts
@@ -0,0 +1,156 @@
+import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
+import { ContactService } from '../contact.service';
+import { Router } from '@angular/router';
+import * as XLSX from 'xlsx';
+
+declare var $:any;
+
+@Component({
+ selector: 'app-virtual-device',
+ templateUrl: './virtual-device.component.html',
+ styleUrls: ['./virtual-device.component.scss']
+})
+export class VirtualDeviceComponent implements OnInit {
+ errorMsg='';
+ showError;
+ arrayBuffer:any;
+ file:File;
+ submittedList = [];
+ virtualDevice ={
+ "imei":"",
+ "port":'',
+ "host":"",
+ "model":"",
+ "route":[
+ ]
+ }
+ tabelObj: any;
+ useridd: any;
+ superAdmin: any;
+ custtype: any;
+ orgChek: any;
+ supAdminDropDown = false;
+
+distributerValue
+dealerValue;
+@ViewChild("fileInput")
+
+ // this InputVar is a reference to our input.
+
+ InputVar: ElementRef;
+ constructor(private contactService: ContactService,private router: Router) {
+
+
+ }
+
+ selectedItems=[];
+ resetData() {
+ this.InputVar.nativeElement.value = "";
+ this.errorMsg = '';
+ this.file = null;
+ this.virtualDevice = {
+ "imei":"",
+ "port":'',
+ "host":"",
+ "model":"",
+ "route":[
+ ]
+ }
+ }
+ ngOnInit() {
+
+
+ if(this.orgChek === true){
+ this.supAdminDropDown = true;
+ }
+ // this.loadropdown();
+
+
+ var that = this;
+
+
+
+ }
+
+ onChange(event) {
+ this.file = event.target.files[0];
+ }
+ onUpload() {
+ this.showError = false;
+ if(this.file) {
+
+ this.realExcelData();
+ } else {
+ this.showError = true;
+ this.errorMsg = 'Please select file'
+ }
+
+
+
+ }
+ realExcelData() {
+ let fileReader = new FileReader();
+ fileReader.onload = (e) => {
+ this.arrayBuffer = fileReader.result;
+ var data = new Uint8Array(this.arrayBuffer);
+ var arr = new Array();
+ for(var i = 0; i != data.length; ++i) arr[i] = String.fromCharCode(data[i]);
+ var bstr = arr.join("");
+ var workbook = XLSX.read(bstr, {type:"binary"});
+ var first_sheet_name = workbook.SheetNames[0];
+ var worksheet = workbook.Sheets[first_sheet_name];
+ this.setDataToAPI(XLSX.utils.sheet_to_json(worksheet,{raw:true}))
+
+ }
+ fileReader.readAsArrayBuffer(this.file);
+ }
+ setDataToAPI(data) {
+ console.log(data)
+ let newData = [];
+ if(data.length) {
+ data = data.forEach(d => {
+ if(d.Lattitude && d.Longitude) {
+ newData.push( {
+ lat:d.Lattitude,
+ lng:d.Longitude
+ })
+ }
+ });
+ }
+ this.virtualDevice.route = newData;
+ this.submit(this.virtualDevice);
+
+ }
+successMesssage = '';
+submit(virtualDevice,isAdd =true){
+ this.successMesssage = '';
+ if(!virtualDevice.route.length) {
+ this.errorMsg = 'Please Upload Lat/long'
+ } else if(!virtualDevice.host) {
+ this.errorMsg = 'Please enter Host'
+ } else if(!virtualDevice.imei) {
+ this.errorMsg = 'Please enter IMEI'
+ } else if(!virtualDevice.port) {
+ this.errorMsg = 'Please enter port'
+ } else if(!virtualDevice.model) {
+ this.errorMsg = 'Please enter model'
+ } else {
+ let postObj = Object.assign({},virtualDevice);
+ if(isAdd) {
+ this.submittedList.unshift(postObj);
+ }
+ this.contactService.post('/virtualDevice',postObj,false).subscribe(resp => {
+this.resetData();
+this.successMesssage = 'Data uploaded successfully'
+ console.log(resp)
+
+
+ },err=>{
+ this.errorMsg = 'Request Failed'
+ })
+ }
+
+
+}
+
+}
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 3e9a61d..d499034 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -1,7 +1,9 @@
export const environment = {
production: true,
- hostUrl: "https://www.oneqlik.in",
- hostUrl2: "https://www.oneqlik.in",
+ hostUrl: document.location.origin != 'http://localhost:4200'? document.location.origin : "https://www.oneqlik.in",
+ hostUrl2: document.location.origin != 'http://localhost:4200'? document.location.origin : "https://www.oneqlik.in",
+ //hostUrl:"https://www.oneqlik.in",
+ //hostUrl2:"https://www.oneqlik.in",
// hostUrl:"https://socket.oneqlik.in",
// hostUrl2:"https://socket.oneqlik.in",
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index f500afd..f640085 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -5,12 +5,10 @@
export const environment = {
production: false,
- // hostUrl: "http://localhost:3000",
- // hostUrl2: "http://localhost:3000",
- // hostUrl: "https://socket.oneqlik.in",
- // hostUrl2: "https://socket.oneqlik.in",
- hostUrl: "https://www.oneqlik.in",
- hostUrl2: "https://www.oneqlik.in",
+ // hostUrl:"https://dev.oneqlik.in",
+ // hostUrl2:"https://dev.oneqlik.in",
+ hostUrl: document.location.origin != 'http://localhost:4200'? document.location.origin : "https://www.oneqlik.in",
+ hostUrl2: document.location.origin != 'http://localhost:4200'? document.location.origin : "https://www.oneqlik.in",
socket5000: "",
showLandingpageMenu: ["www.drsupergps.com", "www.vpngps.tech", "www.globaltechnohelp.com", "www.tracktive.in", "www.sohamshakti.in", "www.spygpstrack.com", "www.mtelematics.in", "www.dstrackingsolutions.com", "www.vctrack.in", "www.hltgps.in", "www.xcelgps.com"]
diff --git a/src/index.html b/src/index.html
index c32a28b..844b7aa 100644
--- a/src/index.html
+++ b/src/index.html
@@ -357,7 +357,7 @@
-
+
diff --git a/src/styles.css b/src/styles.css
index 05f9775..b3d63e1 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -5,7 +5,10 @@ body {
margin: 0;
font-family: Roboto, sans-serif;
}
-
+.ftd-mp {
+ padding-top: 13px !important;
+ padding-bottom: 12.5px !important;
+}
md-card {
max-width: 80%;
margin: 2em auto;