diff --git a/app/components/dialog/RunConfigDialog.vue b/app/components/dialog/RunConfigDialog.vue
index 8da9c35..df62eb5 100644
--- a/app/components/dialog/RunConfigDialog.vue
+++ b/app/components/dialog/RunConfigDialog.vue
@@ -26,12 +26,20 @@
+
+
@@ -46,6 +54,7 @@ import {
MUTATION_SET_RUN_CONFIG,
RunConfiguration,
ACTION_UPLOAD_TEAM_LOGO,
+ ACTION_UPLOAD_PATCH,
} from "@/store";
export default Vue.extend({
@@ -71,16 +80,29 @@ export default Vue.extend({
} as RunConfiguration);
this.$emit("close");
},
- imageChanged() {
- const team_logo_file = (this.$refs as any).file.files[0];
+ imageUpload() {
+ const team_logo_file = (this.$refs as any).imageFile.files[0];
if (!team_logo_file) return;
- console.log(`Uploading ${team_logo_file.name}...`);
+ console.log(`Uploading team image ${team_logo_file.name}...`);
this.$store.dispatch(ACTION_UPLOAD_TEAM_LOGO, team_logo_file);
+ this.$emit("close");
+ },
+ patchUpload() {
+ const patch_file = (this.$refs as any).patchFile.files[0];
+ if (!patch_file) return;
+
+ console.log(`Uploading patch ${patch_file.name}...`);
+
+ this.$store.dispatch(ACTION_UPLOAD_PATCH, patch_file);
+ this.$emit("close");
},
uploadTeamLogo() {
- (this.$refs as any).file.click();
+ (this.$refs as any).imageFile.click();
+ },
+ uploadPatch() {
+ (this.$refs as any).patchFile.click();
},
},
});
diff --git a/app/store.ts b/app/store.ts
index fde80a8..49bca26 100644
--- a/app/store.ts
+++ b/app/store.ts
@@ -95,7 +95,7 @@ export const SERVICE_NOTES = {
"shepherd-run": "Code runner",
"shepherd-watch": "Status information",
"shepherd-ws": "Logs and images",
- hopper: "Logs and images",
+ "hopper": "Logs and images",
};
export interface StatusSummary {
@@ -168,6 +168,7 @@ export const ACTION_INIT_CAMERA_WEBSOCKET = "INIT_CAMERA_WEBSOCKET";
export const ACTION_INIT_LOG_WEBSOCKET = "INIT_LOG_WEBSOCKET";
export const ACTION_INIT_STATUS_WEBSOCKET = "INIT_STATUS_WEBSOCKET";
export const ACTION_UPLOAD_TEAM_LOGO = "UPLOAD_TEAM_LOGO";
+export const ACTION_UPLOAD_PATCH = "UPLOAD_PATCH";
// Messages which can be displayed to the user
const MESSAGE_RUN = "RUN";
@@ -251,7 +252,7 @@ export default new Vuex.Store({
"shepherd-watch": "unknown",
"shepherd-ws": "unknown",
"shepherd-run": "unknown",
- "hopper": "unknown"
+ hopper: "unknown",
},
},
statusOpen: false,
@@ -590,6 +591,17 @@ export default new Vuex.Store({
});
},
+ /**Upload a patch file*/
+ [ACTION_UPLOAD_PATCH]({ state }, file: File) {
+ const formData = new FormData();
+ formData.append("patch.zip", file);
+
+ return fetch("/patch/upload", {
+ method: "POST",
+ body: formData,
+ });
+ },
+
/**Saves the project:
* First checks if using blockly, if so:
* - Validates that all the blocks are okay