mirror of
https://github.com/owntracks/frontend.git
synced 2026-05-15 03:56:32 +00:00
Add config option to ignore ping/ping
This commit is contained in:
@@ -93,6 +93,10 @@ const DEFAULT_CONFIG = {
|
||||
// disable splitting into separate lines.
|
||||
maxPointDistance: 1000,
|
||||
},
|
||||
// Remove the ping/ping location which is enabled in the recorder's
|
||||
// Docker image for health checks by default:
|
||||
// https://github.com/owntracks/recorder/issues/195#issuecomment-304004436
|
||||
ignorePingLocation: true,
|
||||
};
|
||||
|
||||
// Use deepmerge to combine the default and user-defined configuration.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as types from "@/store/mutation-types";
|
||||
import * as api from "@/api";
|
||||
import config from "@/config";
|
||||
import { isIsoDate } from "@/util";
|
||||
|
||||
/**
|
||||
@@ -99,10 +100,18 @@ const getDevices = async ({ commit, state }) => {
|
||||
* Load last location of the selected user/device.
|
||||
*/
|
||||
const getLastLocations = async ({ commit, state }) => {
|
||||
commit(
|
||||
types.SET_LAST_LOCATIONS,
|
||||
await api.getLastLocations(state.selectedUser, state.selectedDevice)
|
||||
let lastLocations = await api.getLastLocations(
|
||||
state.selectedUser,
|
||||
state.selectedDevice
|
||||
);
|
||||
if (config.ignorePingLocation) {
|
||||
// Remove ping/ping from the owntracks/recorder Docker image
|
||||
// https://github.com/owntracks/frontend/issues/12
|
||||
lastLocations = lastLocations.filter(
|
||||
l => !(l.username === "ping" && l.device === "ping")
|
||||
);
|
||||
}
|
||||
commit(types.SET_LAST_LOCATIONS, lastLocations);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user