Skip to content

Commit 030a7e6

Browse files
committed
Fix JS errors
1 parent 0a336fb commit 030a7e6

3 files changed

Lines changed: 51 additions & 43 deletions

File tree

frontend/src/components/host-manager/DirectoryList.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
v-model="focused"
3030
fit
3131
class="q-my-none q-py-none"
32-
@hide="
33-
$refs.input.focus()
34-
$refs.input.blur()
35-
"
32+
@hide="$refs.input.focus(); $refs.input.blur()"
3633
>
3734
<q-list
3835
class="q-my-none q-py-none shadow-3"

frontend/src/pages/system/FileManager.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
color="primary"
1919
icon="mdi-form-textbox"
2020
:disable="selected.length == 0 || selected.length > 1"
21-
@click="
22-
renameDialogItem = JSON.parse(JSON.stringify(selected[0]))
23-
renameDialog = true
24-
"
21+
@click="openRenameDialog"
2522
>
2623
<q-tooltip :offset="[0, 5]"> Rename </q-tooltip>
2724
</q-btn>
@@ -44,7 +41,7 @@
4441
this.$refs.confirmDialog.show(
4542
'Are you sure?',
4643
['Do you really want to remove this?', 'This action is not reversable!'],
47-
removePath,
44+
removePath
4845
)
4946
"
5047
>
@@ -333,6 +330,10 @@ export default {
333330
this.$refs.errorDialog.show('Error renaming folder', [errormsg])
334331
})
335332
},
333+
openRenameDialog() {
334+
this.renameDialogItem = JSON.parse(JSON.stringify(this.selected[0]))
335+
this.renameDialog = true
336+
},
336337
},
337338
mounted() {
338339
this.getPath(this.currentPath)

frontend/src/pages/vm/TemplateOverviewPage.vue

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@
3939
<q-separator color="transparent" spaced="lg" inset />
4040
<q-card-section class="q-pt-none">
4141
<div v-for="(value, key) in selectedTemplate[0]" :key="key">
42-
<strong>{{ key.replace(/_/g, ' ').toUpperCase() }}:</strong>
42+
<strong>{{ key.replace(/_/g, " ").toUpperCase() }}:</strong>
4343
{{ value }}
4444
</div>
4545
</q-card-section>
4646
<q-card-section>
4747
<div><strong>XML Template:</strong></div>
48-
<q-input filled v-model="selectedTemplateXml" type="textarea" autogrow readonly />
48+
<q-input
49+
filled
50+
v-model="selectedTemplateXml"
51+
type="textarea"
52+
autogrow
53+
readonly
54+
/>
4955
</q-card-section>
5056
</q-card>
5157
</q-dialog>
@@ -55,42 +61,42 @@
5561
</template>
5662

5763
<script>
58-
import ErrorDialog from 'src/components/ErrorDialog.vue'
59-
import ConfirmDialog from 'src/components/ConfirmDialog.vue'
60-
import ToolTip from 'src/components/ToolTip.vue'
64+
import ErrorDialog from "src/components/ErrorDialog.vue";
65+
import ConfirmDialog from "src/components/ConfirmDialog.vue";
66+
import ToolTip from "src/components/ToolTip.vue";
6167
6268
export default {
6369
data() {
6470
return {
6571
data: [],
6672
columns: [
6773
{
68-
name: 'id',
69-
label: 'ID',
70-
field: 'id',
71-
align: 'left',
74+
name: "id",
75+
label: "ID",
76+
field: "id",
77+
align: "left",
7278
sortable: true,
7379
},
7480
{
75-
name: 'name',
76-
label: 'Name',
77-
field: 'name',
78-
align: 'left',
81+
name: "name",
82+
label: "Name",
83+
field: "name",
84+
align: "left",
7985
sortable: true,
8086
},
8187
{
82-
name: 'description',
83-
label: 'Description',
84-
field: 'description',
85-
align: 'left',
88+
name: "description",
89+
label: "Description",
90+
field: "description",
91+
align: "left",
8692
sortable: false,
8793
},
8894
],
8995
tableLoading: false,
9096
selectedTemplate: [],
9197
selectedTemplateXml: null,
9298
viewtemplate: false,
93-
}
99+
};
94100
},
95101
components: {
96102
ErrorDialog,
@@ -99,34 +105,38 @@ export default {
99105
},
100106
methods: {
101107
getData() {
102-
this.selectedTemplate = []
103-
this.tableLoading = true
108+
this.selectedTemplate = [];
109+
this.tableLoading = true;
104110
this.$api
105-
.get('/vm/templates')
111+
.get("/vm/templates")
106112
.then((response) => {
107-
this.data = response.data
108-
this.tableLoading = false
113+
this.data = response.data;
114+
this.tableLoading = false;
109115
})
110116
.catch((error) => {
111-
this.$refs.errorDialog.show('Error loading VM templates', [error.response.data.detail])
112-
this.tableLoading = false
113-
})
117+
this.$refs.errorDialog.show("Error loading VM templates", [
118+
error.response.data.detail,
119+
]);
120+
this.tableLoading = false;
121+
});
114122
},
115123
viewTemplate() {
116-
this.viewtemplate = true
117-
this.selectedTemplateXml = null
124+
this.viewtemplate = true;
125+
this.selectedTemplateXml = null;
118126
this.$api
119-
.get('/vm/xml_templates/' + this.selectedTemplate[0].xml_template_id)
127+
.get("/vm/xml_templates/" + this.selectedTemplate[0].xml_template_id)
120128
.then((response) => {
121-
this.selectedTemplateXml = response.data.content
129+
this.selectedTemplateXml = response.data.content;
122130
})
123131
.catch((error) => {
124-
this.$refs.errorDialog.show('Error loading XML template', [error.response.data.detail])
125-
})
132+
this.$refs.errorDialog.show("Error loading XML template", [
133+
error.response.data.detail,
134+
]);
135+
});
126136
},
127137
},
128138
mounted() {
129-
this.getData()
139+
this.getData();
130140
},
131-
}
141+
};
132142
</script>

0 commit comments

Comments
 (0)