IDC.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div>
  3. <a-form
  4. class="mt-3"
  5. :form="form.fc"
  6. @submit="handleConfirm">
  7. <a-divider orientation="left">{{$t('compute.text_300')}}</a-divider>
  8. <a-form-item :label="$t('compute.text_297', [$t('dictionary.project')])" v-bind="formItemLayout">
  9. <domain-project :fc="form.fc" :decorators="{ project: decorators.project, domain: decorators.domain }" :project.sync="projectId" :domain.sync="domainId" />
  10. </a-form-item>
  11. <a-form-item :label="$t('compute.text_177')" class="mb-0" v-bind="formItemLayout" v-if="!isInstallOperationSystem">
  12. <cloudregion-zone
  13. :zone-params="params.zone"
  14. :cloudregion-params="params.region"
  15. :decorator="decorators.regionZone"
  16. filterBrandResource="compute_engine" />
  17. </a-form-item>
  18. <a-form-item
  19. :label="$t('compute.text_228')"
  20. v-bind="formItemLayout"
  21. :extra="$t('compute.text_301')">
  22. <a-input v-decorator="decorators.name" :placeholder="$t('validator.resourceCreateName')" />
  23. </a-form-item>
  24. <a-form-item :label="$t('compute.text_312')" v-bind="formItemLayout" v-if="!isInstallOperationSystem">
  25. <a-input v-decorator="decorators.description" />
  26. </a-form-item>
  27. <a-form-item :label="$t('compute.text_294')" v-bind="formItemLayout">
  28. <a-input-number v-decorator="decorators.count" :min="1" :max="100" :disabled="isInstallOperationSystem" />
  29. </a-form-item>
  30. <a-form-item v-bind="formItemLayout" :label="$t('compute.text_267')" :extra="$t('compute.text_302')">
  31. <os-select
  32. type="baremetal"
  33. :form="form"
  34. :types="osSelectTypes"
  35. hypervisor="baremetal"
  36. :image-params="imageParams"
  37. :decorator="decorators.imageOS"
  38. @updateImageMsg="setSelectedImage"
  39. :imageType.sync="osSelectImageType" />
  40. </a-form-item>
  41. <a-form-item v-bind="formItemLayout" :label="$t('compute.text_178')">
  42. <a-select v-decorator="decorators.specifications" :disabled="isInstallOperationSystem" @change="specificationChange">
  43. <a-select-option v-for="i in specOptions" :key="i.value" :value="i.value">
  44. {{i.text}}
  45. </a-select-option>
  46. </a-select>
  47. </a-form-item>
  48. <a-form-item v-bind="formItemLayout" :label="$t('compute.text_303')">
  49. <div class="d-flex flex-wrap">
  50. <template v-for="(item, idx) of diskOptionsDate">
  51. <div :key="idx" class="disk-option-item">
  52. <a-card hoverable>
  53. <template slot="title">
  54. <icon type="res-disk" />
  55. {{ item.title }}
  56. <a-tooltip :title="$t('compute.text_304')">
  57. <a-icon type="check-circle" theme="twoTone" twoToneColor="#52c41a" v-show="(idx === 0 && !isShowFalseIcon) || idx !== 0" />
  58. </a-tooltip>
  59. <a-tooltip :title="$t('compute.text_305')">
  60. <a-icon type="close-circle" theme="twoTone" twoToneColor="#eb2f96" v-show="idx === 0 && isShowFalseIcon" />
  61. </a-tooltip>
  62. </template>
  63. <a href="javascript:;" slot="extra" @click="handleDiskItemRemove(idx)" v-show="idx === diskOptionsDate.length - 1">{{$t('compute.perform_delete')}}</a>
  64. <div class="d-flex align-items-center">
  65. <ve-pie :data="item.chartData" :settings="chartSettings" :events="chartFun(idx)" width="200px" height="200px" :legend-visible="false" />
  66. <div class="flex-fill ml-2">
  67. <template v-for="k in item.diskInfo">
  68. <div :key="k">
  69. <a-checkbox defaultChecked disabled>
  70. {{k}}
  71. </a-checkbox>
  72. </div>
  73. </template>
  74. <a-tag color="blue">{{$t('compute.text_306', [item.size])}}</a-tag>
  75. </div>
  76. </div>
  77. </a-card>
  78. </div>
  79. </template>
  80. </div>
  81. </a-form-item>
  82. <a-form-item v-bind="offsetFormItemLayout">
  83. <a-button type="primary" @click="addDisk" :disabled="specOptions.length === 0">{{$t('compute.text_307')}}</a-button>
  84. </a-form-item>
  85. <a-form-item :label="$t('compute.text_308')" v-bind="formItemLayout" v-if="!isCheckedIso">
  86. <server-password :form="form" :login-types="loginTypes" :isSnapshotImageType="false" :decorator="decorators.loginConfig" />
  87. </a-form-item>
  88. <a-form-item :label="$t('compute.text_1154')" class="mb-0" v-bind="formItemLayout">
  89. <tag
  90. v-decorator="decorators.__meta__" :allowNoValue="false" :default-checked="tagDefaultChecked" />
  91. </a-form-item>
  92. <a-divider orientation="left">{{$t('compute.text_309')}}</a-divider>
  93. <a-form-item :label="$t('compute.text_104')" v-bind="formItemLayout" class="mb-0">
  94. <server-network
  95. ref="networkRef"
  96. :form="form"
  97. :decorator="decorators.network"
  98. :isBonding="isBonding"
  99. :network-list-params="networkParam"
  100. :network-resource-mapper="networkResourceMapper"
  101. :schedtag-params="params.policySchedtag"
  102. :networkVpcParams="params.vpcParams"
  103. :vpcResource="vpcResource"
  104. :vpcResourceMapper="vpcResourceMapper" />
  105. </a-form-item>
  106. <a-form-item v-bind="offsetFormItemLayout">
  107. <a-checkbox v-model="isBonding">{{$t('compute.text_310')}}</a-checkbox>
  108. </a-form-item>
  109. <a-form-item :label="$t('compute.text_311')" v-bind="formItemLayout" class="mb-0" v-if="!isInstallOperationSystem">
  110. <sched-policy
  111. ref="schedPolicyRef"
  112. server-type="baremetal"
  113. :form="form"
  114. :disabled-host="policyHostDisabled"
  115. :policy-host-params="params.policyHostParams"
  116. :decorators="decorators.schedPolicy"
  117. :policy-schedtag-params="policySchedtagParams"
  118. @change="hostChange"
  119. :hostData="filterHostData" />
  120. </a-form-item>
  121. <a-form-item :label="$t('compute.text_312')" v-bind="formItemLayout" v-if="isInstallOperationSystem">
  122. <a-input v-decorator="decorators.description" />
  123. </a-form-item>
  124. <bottom-bar
  125. :loading="submiting"
  126. :form="form"
  127. :selectedSpecItem="selectedSpecItem"
  128. type="baremetal"
  129. :isOpenWorkflow="isOpenWorkflow"
  130. :errors.sync="errors"
  131. :isServertemplate="false"
  132. :hasMeterService="hasMeterService"
  133. :isInitForm="isInitForm"
  134. @cancel="handleCancel" />
  135. </a-form>
  136. </div>
  137. </template>
  138. <script>
  139. import WindowsMixin from '@/mixins/windows'
  140. import workflowMixin from '@/mixins/workflow'
  141. import CreateMixin from './mixins'
  142. export default {
  143. name: 'BaremetalCreateIDC',
  144. mixins: [WindowsMixin, workflowMixin, CreateMixin],
  145. }
  146. </script>
  147. <style lang="less" scoped>
  148. .disk-option-item {
  149. & + .disk-option-item {
  150. margin-left: 15px;
  151. }
  152. }
  153. </style>