498498 </a-row >
499499 </a-tab-pane >
500500 <a-tab-pane :key =2 tab =" Import VM Tasks" v-if =" isMigrateFromVmware" >
501- <a-card class =" instances-card" >
502- <template #title >
503- Import VM Tasks
504- <a-tooltip :title =" 'Running Import VM Tasks'" >
505- <info-circle-outlined />
506- </a-tooltip >
507- <a-button
508- style =" margin-left : 12px ; margin-top : 4px "
509- :loading =" loadingImportVmTasks"
510- size =" small"
511- shape =" round"
512- @click =" fetchImportVmTasks()" >
513- <template #icon ><reload-outlined /></template >
514- </a-button >
515- <a-select
516- :placeholder =" $t('label.filterby')"
517- :value =" importVmTasksFilterValue"
518- style =" min-width : 100px ; margin-left : 10px ; margin-bottom : 5px "
519- size =small
520- @change =" onImportVmTasksFilterChange"
521- showSearch
522- optionFilterProp =" label"
523- :filterOption =" (input, option) => {
524- return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
525- }"
526- >
527- <template #suffixIcon ><filter-outlined class =" ant-select-suffix" /></template >
528- <a-select-option
529- v-for =" filter in importVmTasksFilters"
530- :key =" filter"
531- :label =" $t('label.' + filter)"
532- >
533- {{ $t('label.' + filter) }}
534- </a-select-option >
535- </a-select >
536- </template >
537- <a-table
538- :data-source =" importVmTasks"
539- :columns =" importVmTasksColumn" >
540- <template #bodyCell =" { column , record } " >
541- <template v-if =" column .key === ' convertinstancehostid' " >
542- <router-link :to =" { path: '/host/' + record.convertinstancehostid }" >{{ record.convertinstancehostname }}</router-link >
543- </template >
544- <template v-else-if =" column .key === ' displayname' " >
545- <router-link v-if =" record.virtualmachineid" :to =" { path: '/vm/' + record.virtualmachineid }" >{{ record.displayname }}</router-link >
546- <span v-else >{{ record.displayname }}</span >
547- </template >
548- </template >
549- </a-table >
550- </a-card >
501+ <ImportVmTasks
502+ :tasks =" importVmTasks"
503+ :loading =" loadingImportVmTasks"
504+ @fetch-import-vm-tasks =" fetchImportVmTasks"
505+ />
551506 </a-tab-pane >
552507 </a-tabs >
553508
@@ -604,6 +559,7 @@ import ImportUnmanagedInstances from '@/views/tools/ImportUnmanagedInstance'
604559import ResourceIcon from ' @/components/view/ResourceIcon'
605560import SelectVmwareVcenter from ' @/views/tools/SelectVmwareVcenter'
606561import TooltipLabel from ' @/components/widgets/TooltipLabel.vue'
562+ import ImportVmTasks from ' @/views/tools/ImportVmTasks.vue'
607563
608564export default {
609565 components: {
@@ -613,7 +569,8 @@ export default {
613569 SearchView,
614570 ImportUnmanagedInstances,
615571 ResourceIcon,
616- SelectVmwareVcenter
572+ SelectVmwareVcenter,
573+ ImportVmTasks
617574 },
618575 name: ' ManageVms' ,
619576 data () {
@@ -726,53 +683,6 @@ export default {
726683 dataIndex: ' templatedisplaytext'
727684 }
728685 ]
729- const importVmTasksColumn = [
730- {
731- key: ' displayname' ,
732- title: ' VM Display Name' ,
733- dataIndex: ' displayname'
734- },
735- {
736- key: ' convertinstancehostid' ,
737- title: ' Conversion Host' ,
738- dataIndex: ' convertinstancehostid'
739- },
740- {
741- key: ' step' ,
742- title: ' Current Step' ,
743- dataIndex: ' step'
744- },
745- {
746- key: ' stepduration' ,
747- title: ' Current Step Duration' ,
748- dataIndex: ' stepduration'
749- },
750- {
751- key: ' description' ,
752- title: ' Description' ,
753- dataIndex: ' description'
754- },
755- {
756- key: ' duration' ,
757- title: ' Total Duration' ,
758- dataIndex: ' duration'
759- },
760- {
761- key: ' sourcevmname' ,
762- title: ' Source VM Name' ,
763- dataIndex: ' sourcevmname'
764- },
765- {
766- key: ' vcenter' ,
767- title: ' vCenter' ,
768- dataIndex: ' vcenter'
769- },
770- {
771- key: ' datacentername' ,
772- title: ' Datacenter Name' ,
773- dataIndex: ' datacentername'
774- }
775- ]
776686 return {
777687 options: {
778688 hypervisors: [],
@@ -855,10 +765,7 @@ export default {
855765 selectedVmwareVcenter: undefined ,
856766 activeTabKey: 1 ,
857767 loadingImportVmTasks: false ,
858- importVmTasks: [],
859- importVmTasksColumn,
860- importVmTasksFilters: [' running' , ' completed' ],
861- importVmTasksFilterValue: ' running'
768+ importVmTasks: []
862769 }
863770 },
864771 created () {
@@ -1271,16 +1178,12 @@ export default {
12711178 this .fetchImportVmTasks ()
12721179 }
12731180 },
1274- onImportVmTasksFilterChange (e ) {
1275- this .importVmTasksFilterValue = e
1276- this .fetchImportVmTasks ()
1277- },
1278- fetchImportVmTasks () {
1181+ fetchImportVmTasks (filter ) {
12791182 this .loadingImportVmTasks = true
12801183 const params = {
12811184 zoneid: this .zoneId
12821185 }
1283- if (this . importVmTasksFilterValue === ' completed' ) {
1186+ if (filter && filter === ' completed' ) {
12841187 params .showcompleted = true
12851188 }
12861189 getAPI (' listImportVmTasks' , params).then (response => {
0 commit comments