@@ -17,11 +17,11 @@ let editingComputeItem: ComputeUnit | null = null
1717
1818const computeHeaders = ref <DataTableHeader []>([
1919 { title: " Name" , align: " start" , sortable: true , key: " name" },
20- { title: " Machine type" , align: " start" , sortable: true , key: " flavor " },
20+ { title: " Machine type" , align: " start" , sortable: true , key: " machine_type " },
2121 { title: " CPU cores" , align: " start" , sortable: true , key: " core_count" },
2222 { title: " Memory [GB]" , align: " start" , sortable: true , key: " ram" },
2323 { title: " GPU" , align: " start" , sortable: true , key: " gpu" },
24- { title: " Type " , align: " start" , sortable: true , key: " type " },
24+ { title: " Subscription " , align: " start" , sortable: true , key: " subscription " },
2525 { title: " Price / month" , align: " start" , sortable: true , key: " monthlyPrice" },
2626 { title: " Price / year" , align: " start" , sortable: true , key: " yearlyPrice" },
2727 { title: " Actions" , key: " actions" , align: " end" , sortable: false },
@@ -57,18 +57,14 @@ const storageLabSum = computed(() => {
5757})
5858
5959const LabSum = computed (() => {
60- return (
61- computeLabSum .value .yearlyCostTotal +
62- storageLabSum .value .HDD .yearlyCostTotal +
63- storageLabSum .value .NVME .yearlyCostTotal
64- )
60+ return computeLabSum .value .yearlyCostTotal + storageLabSum .value .HDD .yearlyCostTotal + storageLabSum .value .NVME .yearlyCostTotal
6561})
6662
6763const localTitle = ref (props .lab .title )
6864
6965watch (
7066 () => props .lab .title ,
71- val => {
67+ ( val ) => {
7268 localTitle .value = val
7369 },
7470)
@@ -148,13 +144,7 @@ const removeStorageById = (storageId: number) => {
148144 <v-card flat >
149145 <v-card-title >Compute</v-card-title >
150146
151- <v-data-table-virtual
152- :items =" selectedCompute"
153- :headers =" computeHeaders"
154- hide-default-footer
155- hover
156- item-value =" id"
157- >
147+ <v-data-table-virtual :items =" selectedCompute" :headers =" computeHeaders" hide-default-footer hover item-value =" id" >
158148 <template v-slot :item .monthlyPrice =" { item } " >
159149 {{ item.monthlyPrice.toFixed(2) + " kr" }}
160150 </template >
@@ -163,18 +153,8 @@ const removeStorageById = (storageId: number) => {
163153 </template >
164154 <template v-slot :item .actions =" { item } " >
165155 <div class =" d-flex ga-2 justify-end" >
166- <v-icon
167- color =" medium-emphasis"
168- icon =" mdi-pencil"
169- size =" small"
170- @click =" editCompute(selectedCompute.find(c => c.id === item.id)!)"
171- ></v-icon >
172- <v-icon
173- color =" medium-emphasis"
174- icon =" mdi-delete"
175- size =" small"
176- @click =" removeComputeById(item.id)"
177- ></v-icon >
156+ <v-icon color =" medium-emphasis" icon =" mdi-pencil" size =" small" @click =" editCompute(selectedCompute.find((c) => c.id === item.id)!)" ></v-icon >
157+ <v-icon color =" medium-emphasis" icon =" mdi-delete" size =" small" @click =" removeComputeById(item.id)" ></v-icon >
178158 </div >
179159 </template >
180160
@@ -229,18 +209,8 @@ const removeStorageById = (storageId: number) => {
229209 </template >
230210 <template v-slot :item .actions =" { item } " >
231211 <div class =" d-flex ga-2 justify-end" >
232- <v-icon
233- color =" medium-emphasis"
234- icon =" mdi-pencil"
235- size =" small"
236- @click =" editStorage(selectedStorage.find(s => s.id === item.id)!)"
237- ></v-icon >
238- <v-icon
239- color =" medium-emphasis"
240- icon =" mdi-delete"
241- size =" small"
242- @click =" removeStorageById(item.id)"
243- ></v-icon >
212+ <v-icon color =" medium-emphasis" icon =" mdi-pencil" size =" small" @click =" editStorage(selectedStorage.find((s) => s.id === item.id)!)" ></v-icon >
213+ <v-icon color =" medium-emphasis" icon =" mdi-delete" size =" small" @click =" removeStorageById(item.id)" ></v-icon >
244214 </div >
245215 </template >
246216
@@ -290,22 +260,11 @@ const removeStorageById = (storageId: number) => {
290260 </v-sheet >
291261
292262 <v-dialog v-model =" isComputeModalOpen" max-width =" 600px" min-width =" 600px" >
293- <MachineModal
294- :lab-id =" lab.id"
295- :compute-id =" lab.selectedCompute.length"
296- :edit-data =" editingComputeItem"
297- @close =" closeComputeModal"
298- @open-snackbar =" openSnackbar"
299- />
263+ <MachineModal :lab-id =" lab.id" :compute-id =" lab.selectedCompute.length" :edit-data =" editingComputeItem" @close =" closeComputeModal" @open-snackbar =" openSnackbar" />
300264 </v-dialog >
301265
302266 <v-dialog v-model =" isStorageModalOpen" max-width =" 600px" min-width =" 600px" >
303- <StorageModal
304- :lab-id =" lab.id"
305- :storage-id =" lab.selectedStorage.length"
306- :edit-data =" editingStorageItem"
307- @close =" closeStorageModal"
308- />
267+ <StorageModal :lab-id =" lab.id" :storage-id =" lab.selectedStorage.length" :edit-data =" editingStorageItem" @close =" closeStorageModal" />
309268 </v-dialog >
310269
311270 <v-snackbar v-model =" snackbar.show" >{{ snackbar.message }}</v-snackbar >
0 commit comments