Skip to content

Commit

Permalink
Workaround for #19
Browse files Browse the repository at this point in the history
  • Loading branch information
tertek committed Mar 6, 2024
1 parent fe913f8 commit 7486dd0
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 8,075 deletions.
8 changes: 7 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
"type": "project-id",
"name": "<b>Devices Project</b><br>Project that manages device data",
"required": true
}
},
{
"key": "timeout",
"type": "text",
"name": "<b>Custom Timout</b><br>Duration in ms to load between tracking instances on same page. Default: 1500, Minimum: 500",
"required": false
}
],

"project-settings": [
Expand Down
9 changes: 8 additions & 1 deletion deviceTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,12 @@ private function renderAlertInvalidTracking() {
* @since 1.0.0
*/
private function getDataFromBackend() {

$timeout = $this->getSystemSetting("timeout") ?? 1500;
// Validate Timout Setting
if(!is_numeric($timeout) || $timeout < 500) {
$timeout = 1500;
}

// Initialize
$data = [];
Expand All @@ -911,7 +917,8 @@ private function getDataFromBackend() {
"project_id" => PROJECT_ID,
"record_id" => $this->tracking_record,
"name" => $this->tracking_page,
"event_id" => $this->tracking_event
"event_id" => $this->tracking_event,
"timeout" => $timeout

];

Expand Down
3,811 changes: 3 additions & 3,808 deletions dist/appMonitor.js

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions dist/appMonitor.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/

/*!
* Vue.js v2.7.14
* (c) 2014-2022 Evan You
* Released under the MIT License.
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1 change: 1 addition & 0 deletions dist/appMonitor.js.map

Large diffs are not rendered by default.

4,241 changes: 3 additions & 4,238 deletions dist/appTracker.js

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions dist/appTracker.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/

/*!
* Vue.js v2.7.14
* (c) 2014-2022 Evan You
Expand All @@ -18,6 +11,4 @@
* Licensed MIT © Zeno Rocha
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1 change: 1 addition & 0 deletions dist/appTracker.js.map

Large diffs are not rendered by default.

30 changes: 22 additions & 8 deletions src/tracker/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div class="tracking-wrapper">

<div v-if="!isError" class="tracking-wrapper">
<tracking-header :state="tracking.session_device_state" />

<b-form-group class="tracking-actions">
Expand Down Expand Up @@ -68,7 +67,7 @@
:record="page.record_id"
:event_id="page.event_id"
/>

<tracking-delete
v-if="tracking.session_tracking_id"
:tracking="tracking"
Expand All @@ -94,8 +93,10 @@
</b-alert>

</div>
<div v-else-if="isError" class="tracking-error">
{{ errorMessage }}
</div>
</template>

<script>
import TrackingHeader from './components/TrackingHeader'
import TrackingState from './components/TrackingState'
Expand All @@ -116,6 +117,8 @@
return {
tracking: {},
isLoading: true,
isError: false,
errorMessage: '',
alertText: "",
showAlertTop: false,
dismissSecs: 3,
Expand All @@ -125,7 +128,8 @@
props: {
page: Object,
field: String,
module: Object
module: Object,
idx: Number
},
methods: {
countDownChanged(dismissCountDown) {
Expand All @@ -144,21 +148,31 @@
event_id: this.page.event_id
}
this.$module
setTimeout(()=>{
this.$module
.ajax('get-tracking-data', data)
.then( response => {
if(response.session_tracking_id !== undefined) {
this.tracking = response
console.log("Successfully fetched data.", response)
} else {
console.log("No tracking.")
}
})
.catch(e => {
console.log(e.message)
this.isError = true
this.errorMessage = e.Message
console.log(e)
})
.finally( () => {
this.isLoading = false
})
})
}, this.idx*this.page.timeout + 500)
},
getMessage: function() {
Expand Down
3 changes: 2 additions & 1 deletion src/tracker/appTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ stph_dt_backend.fields.forEach(function(field, idx){
render: h => h(App, {
props: {
page: stph_dt_backend.page,
field: field
field: field,
idx:idx
}
}),
}).$mount("#STPH_DT_FIELD_"+field)
Expand Down

0 comments on commit 7486dd0

Please sign in to comment.