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 >
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
6268export 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