mapva2
This commit is contained in:
@@ -8,34 +8,64 @@ $(document).ready(function () {
|
||||
var re = /\d+$/i;
|
||||
var found = MissionType.match(re);
|
||||
MissionType = Number(found[0]);
|
||||
} else {
|
||||
MissionType = null;
|
||||
}
|
||||
CurrentTime = Math.floor(new Date().getTime() / 1000);
|
||||
console.log("MissionID", MissionID);
|
||||
console.log("MissionType", MissionType);
|
||||
console.log("CurrentTime", CurrentTime);
|
||||
if (MissionType !== null) {
|
||||
if (includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/) {
|
||||
console.log("SEND");
|
||||
return ADis_MissionUpdateDone(MissionID); // update Mission here as updated or full
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
if (['adis-ownmissions', 'adis-krankentransporte'].indexOf(window.name) != -1) {
|
||||
console.log("WILL SEND?")
|
||||
ADis_CheckMissionAutomatic();
|
||||
} else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) {
|
||||
ADis_WorkVerbandMission();
|
||||
ADisSettings().then((setting) => {
|
||||
if (setting['MissionsOwn-Automatic'] != 'true' && ['adis-ownmissions'].indexOf(window.name) != -1) {
|
||||
return ADisDB.ADisMissionsOwn.where({
|
||||
missionID: MissionID,
|
||||
done: 'false'
|
||||
}).and(function (item) {
|
||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||
}).limit(1)
|
||||
} else if (setting['MissionsOwn-Automatic'] != 'true' && ['adis-krankentransporte'].indexOf(window.name) != -1) {
|
||||
return ADisDB.ADisKrankentransport.where({
|
||||
missionID: MissionID,
|
||||
done: 'false'
|
||||
}).and(function (item) {
|
||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||
}).limit(1)
|
||||
}
|
||||
}).then((Wunsch) => {
|
||||
if (Wunsch !== undefined) {
|
||||
return Wunsch.count(function (count) {
|
||||
if (count > 0) {
|
||||
Wunsch.each((mywunsch) => {
|
||||
MainHandler()
|
||||
});
|
||||
}
|
||||
}, 250);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
|
||||
console.log("DONE!")
|
||||
return ADis_MissionDelete(MissionID); // delete Mission here as completed
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
|
||||
function MainHandler(){
|
||||
if (includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
|
||||
console.log("DONE!")
|
||||
return ADis_MissionDelete(MissionID); // delete Mission here as completed
|
||||
}
|
||||
if (includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/ ) {
|
||||
console.log("SEND");
|
||||
return ADis_MissionUpdateDone(MissionID); // update Mission here as updated or full
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
if (['adis-ownmissions', 'adis-krankentransporte'].indexOf(window.name) != -1) {
|
||||
console.log("WILL SEND?")
|
||||
ADis_CheckMissionAutomatic();
|
||||
} else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) {
|
||||
ADis_WorkVerbandMission();
|
||||
}
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
|
||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
// -
|
||||
// - Grab Run Verbands Missions
|
||||
@@ -137,7 +167,7 @@ function AD_GetMissionConfiguration(MissionType) {
|
||||
}).then((availableMission) => {
|
||||
if (availableMission != undefined && availableMission.jsondata) {
|
||||
MissionConfig = availableMission.jsondata;
|
||||
console.log('MissionConfig: ', MissionType.toString(), JSON.stringify(MissionConfig,null,2))
|
||||
console.log('MissionConfig: ', MissionType.toString(), JSON.stringify(MissionConfig, null, 2))
|
||||
AD_StartAlarmProcess();
|
||||
} else {
|
||||
var updateData = {
|
||||
|
||||
Reference in New Issue
Block a user