Merge branch 'frontend/robin' into backend/max
This commit is contained in:
commit
a72d65a518
@ -159,9 +159,28 @@
|
|||||||
console.log("POST api/createCache: " + response.statusText);
|
console.log("POST api/createCache: " + response.statusText);
|
||||||
this.$store.commit('cacheCollector/RESET_NEW_CACHE');
|
this.$store.commit('cacheCollector/RESET_NEW_CACHE');
|
||||||
this.$router.push({ path: '/overview' });
|
this.$router.push({ path: '/overview' });
|
||||||
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// TODO update existing Cache
|
// TODO update existing Cache
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,6 +117,27 @@
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("Caches: " + this.caches);
|
console.log("Caches: " + this.caches);
|
||||||
this.caches = response.data;
|
this.caches = response.data;
|
||||||
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addCache() {
|
addCache() {
|
||||||
@ -129,6 +150,27 @@
|
|||||||
this.$axios.delete('/api/deleteCache', {params: {cacheID: id}})
|
this.$axios.delete('/api/deleteCache', {params: {cacheID: id}})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.fetchAllCaches()
|
this.fetchAllCaches()
|
||||||
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
startCache(cacheID) {
|
startCache(cacheID) {
|
||||||
@ -147,6 +189,27 @@
|
|||||||
console.log(stationID);
|
console.log(stationID);
|
||||||
//this.$router.push({path: `/station/${stationID}`})
|
//this.$router.push({path: `/station/${stationID}`})
|
||||||
this.$router.push({path: `/station/${cacheID}/${stationID}`})
|
this.$router.push({path: `/station/${cacheID}/${stationID}`})
|
||||||
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,28 @@
|
|||||||
this.$axios.get('/api/getMyCaches', { params: {token}} )
|
this.$axios.get('/api/getMyCaches', { params: {token}} )
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.startedCaches = response.data;
|
this.startedCaches = response.data;
|
||||||
});
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
|
})
|
||||||
},
|
},
|
||||||
continueCache(cacheID) {
|
continueCache(cacheID) {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,8 +85,50 @@
|
|||||||
const stationView = response.data.find(station => station.id === Number(this.$route.params.id));
|
const stationView = response.data.find(station => station.id === Number(this.$route.params.id));
|
||||||
console.log(JSON.stringify(stationView));
|
console.log(JSON.stringify(stationView));
|
||||||
this.data.station = stationView;
|
this.data.station = stationView;
|
||||||
});
|
}).catch((error) => {
|
||||||
});
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
|
})
|
||||||
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,26 @@
|
|||||||
console.log(response.data);
|
console.log(response.data);
|
||||||
this.rankinglist = response.data;
|
this.rankinglist = response.data;
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user