Skip to content

Commit 105bdb9

Browse files
committed
wip #92
1 parent 558ddf4 commit 105bdb9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/common/coderbot.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class CoderBot {
314314
}
315315

316316
saveProgram(overwrite, name, dom_code, code, is_default) {
317-
return this.$axios.post(`${this.CB}/saveProgram`, {
317+
return this.$axios.post(`${this.CB}/programs`, {
318318
overwrite,
319319
name,
320320
dom_code,
@@ -332,9 +332,7 @@ class CoderBot {
332332
}
333333

334334
deleteProgram(name) {
335-
return this.$axios.delete(`${this.CB}/programs/${name}`, {
336-
name,
337-
});
335+
return this.$axios.delete(`${this.CB}/programs/${name}`);
338336
}
339337

340338
runProgram(name, code) {

src/components/Activity.vue

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
</v-card>
9292
</v-dialog>
9393
<!-- Load Program -->
94-
<v-dialog v-model="carica" max-width="290">
95-
<v-card>
94+
<v-dialog v-model="carica" max-width="600">
95+
<v-card width="480">
9696
<v-card-title class="headline">
9797
{{ $t("message.program_list") }}
9898
</v-card-title>
@@ -101,11 +101,11 @@
101101
<v-list-item-title ripple @click="loadProgram(program.name)">
102102
{{ program.name }}
103103
</v-list-item-title>
104-
<template v-slot:prepend>
105-
<v-btn v-if="program.default" @click="deleteProgramDlg(program.name)">
106-
<v-icon icon="mdi-delete"></v-icon>
107-
</v-btn>
108-
</template>
104+
<template v-slot:append>
105+
<v-btn v-if="!program.default" @click="deleteProgramDlg(program.name)">
106+
<v-icon icon="mdi-delete"></v-icon>
107+
</v-btn>
108+
</template>
109109
</v-list-item>
110110
</v-list>
111111
<v-card-actions>
@@ -217,7 +217,7 @@
217217
{{ $t("message.no") }}
218218
</v-btn>
219219
<v-btn color="green darken-1" text="text"
220-
@click="del = false, carica = false, deleteProgram(newProgramName)">
220+
@click="del = false, carica = false, deleteProgram(programName)">
221221
{{ $t("message.yes") }}
222222
</v-btn>
223223
</v-card-actions>
@@ -586,15 +586,16 @@ export default {
586586
},
587587
588588
deleteProgramDlg(program) {
589-
this.$data.newProgramName = program;
589+
console.log(program)
590+
this.$data.programName = program;
590591
this.$data.del = true;
591592
},
592593
593594
deleteProgram(program) {
594595
if (this.$data.programName == program) {
595596
this.$data.programName = '';
596597
this.$data.code = '';
597-
this.$data.workspace.clear();
598+
this.$refs.workspace.clear();
598599
}
599600
console.log('delete');
600601
this.$coderbot.deleteProgram(program).then(() => {

src/i18n/locales/it/messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"overwrite": "Sovrascrivi",
2828
"program_exists_overwrite": "Esiste già un programma con nome : \"{programName}\" vuoi sovrascriverlo?",
2929
"delete": "Cancella",
30-
"delete_sure": "Sei sicuro di voler cancellare: \"{newProgramName}\"?",
30+
"delete_sure": "Sei sicuro di voler cancellare: \"{programName}\"?",
3131
"clear_sure": "Sei sicuro di voler pulire lo spazio di lavoro?",
3232
"coderbot_status": "Stato del CoderBot",
3333
"activity_new": "Nuova Attività",

src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ $coderbot.load().then(() => {
6161
app.mount('#app');
6262
app.defaultTheme = 'dark';
6363
}).catch((errors) => {
64+
console.log('oops');
6465
console.error(errors);
6566
});

0 commit comments

Comments
 (0)