diff --git a/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.html b/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.html
index d9b923b..64dbf26 100644
--- a/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.html
+++ b/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.html
@@ -78,7 +78,7 @@
Some Flags may show up with NONE
but be in different Contests
- you can select Flags to delete or change by clicking on them.
+ you can select Flags to delete by clicking on them.
diff --git a/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.ts b/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.ts
index 96b10a9..a102f4a 100644
--- a/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.ts
+++ b/CTF/CTF-Frontend/src/app/modify-contest/modify-contest.component.ts
@@ -51,6 +51,7 @@ handlePopupMessage(event: MessageEvent): void {
this.modifyContestService.loadFlagsForContest(event.data.contestId)
.then(flags => this.flagsForContest = flags)
.catch(err => console.error('Error reloading flags:', err));
+ this.getImages();
}
}
@@ -70,7 +71,7 @@ handlePopupMessage(event: MessageEvent): void {
this.activeContest = await this.modifyContestService.getActiveContest(this.getEmail());
}
- async getImages(): Promise{
+ async getImages(): Promise {
const email = this.getEmail();
try{
const imageData = await this.modifyContestService.getImages(email);
@@ -79,13 +80,18 @@ handlePopupMessage(event: MessageEvent): void {
// get all of the images that are not linked to a flag
let images : Image[] = [];
for (let i=0; i < this.flagsForContest.length; i++) {
+
+ // if the image for the flag is Ubuntu so no image
+ if (this.allImages[i] === undefined) {
+ continue;
+ }
if (this.flagsForContest[i].Image === this.allImages[i].Name) {
images.push(this.allImages[i]); // images that are connected to a flag
}
}
this.allImages = this.allImages.filter(item => !images.includes(item)); // change allImages to just have the ones that are not in images
}catch(error){
- console.error('Error loading images');
+ console.error(error);
}
}
@@ -203,6 +209,7 @@ handlePopupMessage(event: MessageEvent): void {
this.isDialogVisible = false;
this.selectedFlag = null;
this.selectedFlagImage = null;
+ this.getImages();
}
async DeleteImage(): Promise {
@@ -217,7 +224,7 @@ handlePopupMessage(event: MessageEvent): void {
this.allImages = await this.modifyContestService.getImages(this.getEmail());
}
catch(err) {
- console.error("Filed deleting image");
+ console.error("Failed deleting image");
}
console.log("Deleted Image");
@@ -225,6 +232,8 @@ handlePopupMessage(event: MessageEvent): void {
this.isDialogVisible = false;
this.selectedFlag = null;
this.selectedFlagImage = null;
+ console.log(this.allImages);
+ this.selectContest(this.selectedContestId);
}
async TestImage(): Promise{
diff --git a/CTF/CTF-Server/AdminImages/2/Root/file.txt b/CTF/CTF-Server/AdminImages/2/Root/file.txt
deleted file mode 100644
index 6595635..0000000
--- a/CTF/CTF-Server/AdminImages/2/Root/file.txt
+++ /dev/null
@@ -1 +0,0 @@
-this is fle
\ No newline at end of file
diff --git a/CTF/CTF-Server/AdminImages/2/Root/print.py b/CTF/CTF-Server/AdminImages/2/Root/print.py
new file mode 100644
index 0000000..93a8797
--- /dev/null
+++ b/CTF/CTF-Server/AdminImages/2/Root/print.py
@@ -0,0 +1 @@
+print("[FLAG]")
\ No newline at end of file
diff --git a/CTF/CTF-Server/AdminImages/2/file163616.dockerfile b/CTF/CTF-Server/AdminImages/2/python175523.dockerfile
similarity index 100%
rename from CTF/CTF-Server/AdminImages/2/file163616.dockerfile
rename to CTF/CTF-Server/AdminImages/2/python175523.dockerfile