anto
This commit is contained in:
@@ -2,7 +2,6 @@ async function PopulateSelect(mySelect, id) {
|
||||
let data = [];
|
||||
if (mySelect.name == "videos" && id != null) {
|
||||
data = await getDataProjectVideosFromApi(id);
|
||||
console.log(data)
|
||||
const selectObjDefault = document.createElement("option");
|
||||
selectObjDefault.value = -1;
|
||||
selectObjDefault.innerHTML = "Default";
|
||||
|
||||
@@ -102,7 +102,7 @@ async function postNewVideo(project_id, measurements_id, name_video, resolution,
|
||||
async function getVideoFromApi(id) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/videos/${id}`),
|
||||
url: api_url.concat(`/cat/`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
function convertStringToArray(string) {
|
||||
console.log(string)
|
||||
const numberStrings = string.replace(/[{}]/g, '').split(',');
|
||||
|
||||
// Trim whitespace and convert the string numbers to integers
|
||||
@@ -13,6 +12,13 @@ function filterAndSortMeasurementsByIds(measurements, ids) {
|
||||
.filter((measurement) => ids.includes(measurement.id))
|
||||
.sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
|
||||
}
|
||||
function filterAndSortMeasurementsByNumber(measurements, Numbers) {
|
||||
// Filter measurements based on their position in the Numbers array
|
||||
const filteredMeasurements = Numbers.map(index => measurements[index - 1]).filter(measurement => measurement !== undefined);
|
||||
|
||||
// Sort the filtered measurements by their timestamp
|
||||
return filteredMeasurements.sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
|
||||
}
|
||||
|
||||
function checkVideoPath(videos, name) {
|
||||
let res = true;
|
||||
|
||||
Reference in New Issue
Block a user