Added frontend project with some basic api fetching implemented.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export default function getProgress(){
|
||||
|
||||
const progress = ref(null as Progress | null);
|
||||
|
||||
fetch('http://localhost:5224/progress')
|
||||
.then(response => response.json())
|
||||
.then((data: Progress) => {
|
||||
if (data && data.percentageOfIpv4Scanned) {
|
||||
progress.value = data;
|
||||
} else {
|
||||
console.error("Invalid data received from API");
|
||||
console.error(data);
|
||||
}
|
||||
});
|
||||
|
||||
return progress;
|
||||
}
|
||||
Reference in New Issue
Block a user