bernardodemarco commented on code in PR #10484:
URL: https://github.com/apache/cloudstack/pull/10484#discussion_r1976471725


##########
ui/public/locales/en.json:
##########
@@ -3066,6 +3066,7 @@
 "message.no.description": "No description entered.",
 "message.offering.internet.protocol.warning": "WARNING: IPv6 supported 
Networks use static routing and will require upstream routes to be configured 
manually.",
 "message.offering.ipv6.warning": "Please refer documentation for creating IPv6 
enabled Network/VPC offering <a 
href='http://docs.cloudstack.apache.org/en/latest/plugins/ipv6.html#isolated-network-and-vpc-tier'>IPv6
 support in CloudStack - Isolated Networks and VPC Network Tiers</a>",
+"message.oobm.configured": "Successfully configured Out of Band Management for 
host",

Review Comment:
   ```suggestion
   "message.oobm.configured": "Successfully configured out-of-band management 
for host",
   ```



##########
ui/src/views/infra/ConfigureHostOOBM.vue:
##########
@@ -0,0 +1,172 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+<template>
+  <div class="form-layout">
+    <a-form
+      :ref="formRef"
+      :model="form"
+      :rules="rules"
+      @finish="handleSubmit"
+      v-ctrl-enter="handleSubmit"
+      class="form"
+      layout="vertical"
+    >
+      <a-alert type="warning">
+        <template #message>
+          <span v-html="$t('label.outofbandmanagement.configure')" />
+        </template>
+      </a-alert>
+      <div style="margin-top: 10px;">
+        <a-form-item name="address" ref="address">
+          <template #label>
+            <tooltip-label :title="$t('label.address')" 
:tooltip="apiParams.address.description"/>
+          </template>
+          <a-input
+            v-model:value="form.address"
+            v-focus="true" />
+        </a-form-item>
+        <a-form-item name="port" ref="port">
+          <template #label>
+            <tooltip-label :title="$t('label.port')" 
:tooltip="apiParams.port.description"/>
+          </template>
+          <a-input
+            v-model:value="form.port" />
+        </a-form-item>
+        <a-form-item name="username" ref="username">
+          <template #label>
+            <tooltip-label :title="$t('label.username')" 
:tooltip="apiParams.username.description"/>
+          </template>
+          <a-input
+            v-model:value="form.username" />
+        </a-form-item>
+        <a-form-item name="password" ref="password">
+          <template #label>
+            <tooltip-label :title="$t('label.password')" 
:tooltip="apiParams.password.description"/>
+          </template>
+          <a-input-password
+            v-model:value="form.password"
+            :placeholder="apiParams.password.description"/>
+        </a-form-item>
+        <a-form-item name="driver" ref="driver">
+          <template #label>
+            <tooltip-label :title="$t('label.driver')" 
:tooltip="apiParams.driver.description"/>
+          </template>
+          <a-select
+            v-model:value="form.driver"
+              style="width: 100%;"
+              optionFilterProp="value"
+              :filterOption="(input, option) => {
+                return option.value.toLowerCase().indexOf(input.toLowerCase()) 
>= 0
+              }" >
+              <a-select-option key="" label="">{{ }}</a-select-option>
+              <a-select-option value="ipmitool">ipmitool</a-select-option>
+              <a-select-option 
value="nestedcloudstack">nestedcloudstack</a-select-option>
+              <a-select-option value="redfish">redfish</a-select-option>
+            </a-select>
+        </a-form-item>
+      </div>
+      <div :span="24" class="action-button">
+        <a-button @click="$emit('close-action')">{{ $t('label.cancel') 
}}</a-button>
+        <a-button type="primary" @click="handleSubmit" ref="submit">{{ 
$t('label.ok') }}</a-button>
+      </div>
+    </a-form>
+  </div>
+</template>
+
+<script>
+import TooltipLabel from '@/components/widgets/TooltipLabel'
+import { ref, reactive, toRaw } from 'vue'
+import { api } from '@/api'
+
+export default {
+  name: 'ConfigureHostOOBM',
+  components: {
+    TooltipLabel
+  },
+  props: {
+    resource: {
+      type: Object,
+      required: true
+    }
+  },
+  data () {
+    return {
+    }
+  },
+  beforeCreate () {
+    this.apiParams = this.$getApiParams('configureOutOfBandManagement')
+  },
+  created () {
+    this.initForm()
+  },
+  methods: {
+    initForm () {
+      this.formRef = ref()
+      this.form = reactive({
+        address: this.resource.outofbandmanagement.address || '',
+        port: this.resource.outofbandmanagement.port || '',
+        username: this.resource.outofbandmanagement.username || '',
+        password: '',
+        driver: this.resource.outofbandmanagement.driver || ''
+      })
+      this.rules = reactive({
+        address: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        port: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        username: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        password: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        driver: [{ required: true, message: 
this.$t('message.error.required.input') }]
+      })
+    },
+    handleSubmit (e) {
+      e.preventDefault()
+      this.formRef.value.validate().then(() => {
+        const values = toRaw(this.form)
+        var params = {

Review Comment:
   ```suggestion
           const params = {
   ```



##########
ui/src/views/infra/ConfigureHostOOBM.vue:
##########
@@ -0,0 +1,172 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+<template>
+  <div class="form-layout">
+    <a-form
+      :ref="formRef"
+      :model="form"
+      :rules="rules"
+      @finish="handleSubmit"
+      v-ctrl-enter="handleSubmit"
+      class="form"
+      layout="vertical"
+    >
+      <a-alert type="warning">
+        <template #message>
+          <span v-html="$t('label.outofbandmanagement.configure')" />
+        </template>
+      </a-alert>
+      <div style="margin-top: 10px;">
+        <a-form-item name="address" ref="address">
+          <template #label>
+            <tooltip-label :title="$t('label.address')" 
:tooltip="apiParams.address.description"/>
+          </template>
+          <a-input
+            v-model:value="form.address"
+            v-focus="true" />
+        </a-form-item>
+        <a-form-item name="port" ref="port">
+          <template #label>
+            <tooltip-label :title="$t('label.port')" 
:tooltip="apiParams.port.description"/>
+          </template>
+          <a-input
+            v-model:value="form.port" />
+        </a-form-item>
+        <a-form-item name="username" ref="username">
+          <template #label>
+            <tooltip-label :title="$t('label.username')" 
:tooltip="apiParams.username.description"/>
+          </template>
+          <a-input
+            v-model:value="form.username" />
+        </a-form-item>
+        <a-form-item name="password" ref="password">
+          <template #label>
+            <tooltip-label :title="$t('label.password')" 
:tooltip="apiParams.password.description"/>
+          </template>
+          <a-input-password
+            v-model:value="form.password"
+            :placeholder="apiParams.password.description"/>
+        </a-form-item>
+        <a-form-item name="driver" ref="driver">
+          <template #label>
+            <tooltip-label :title="$t('label.driver')" 
:tooltip="apiParams.driver.description"/>
+          </template>
+          <a-select
+            v-model:value="form.driver"
+              style="width: 100%;"
+              optionFilterProp="value"
+              :filterOption="(input, option) => {
+                return option.value.toLowerCase().indexOf(input.toLowerCase()) 
>= 0
+              }" >
+              <a-select-option key="" label="">{{ }}</a-select-option>
+              <a-select-option value="ipmitool">ipmitool</a-select-option>
+              <a-select-option 
value="nestedcloudstack">nestedcloudstack</a-select-option>
+              <a-select-option value="redfish">redfish</a-select-option>
+            </a-select>
+        </a-form-item>
+      </div>
+      <div :span="24" class="action-button">
+        <a-button @click="$emit('close-action')">{{ $t('label.cancel') 
}}</a-button>
+        <a-button type="primary" @click="handleSubmit" ref="submit">{{ 
$t('label.ok') }}</a-button>
+      </div>
+    </a-form>
+  </div>
+</template>
+
+<script>
+import TooltipLabel from '@/components/widgets/TooltipLabel'
+import { ref, reactive, toRaw } from 'vue'
+import { api } from '@/api'
+
+export default {
+  name: 'ConfigureHostOOBM',
+  components: {
+    TooltipLabel
+  },
+  props: {
+    resource: {
+      type: Object,
+      required: true
+    }
+  },
+  data () {
+    return {
+    }
+  },
+  beforeCreate () {
+    this.apiParams = this.$getApiParams('configureOutOfBandManagement')
+  },
+  created () {
+    this.initForm()
+  },
+  methods: {
+    initForm () {
+      this.formRef = ref()
+      this.form = reactive({
+        address: this.resource.outofbandmanagement.address || '',
+        port: this.resource.outofbandmanagement.port || '',
+        username: this.resource.outofbandmanagement.username || '',
+        password: '',
+        driver: this.resource.outofbandmanagement.driver || ''
+      })
+      this.rules = reactive({
+        address: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        port: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        username: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        password: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        driver: [{ required: true, message: 
this.$t('message.error.required.input') }]
+      })
+    },
+    handleSubmit (e) {
+      e.preventDefault()
+      this.formRef.value.validate().then(() => {
+        const values = toRaw(this.form)
+        var params = {
+          hostid: this.resource.id,
+          address: values.address,
+          port: values.port,
+          username: values.username,
+          password: values.password,
+          driver: values.driver
+        }
+
+        api('configureOutOfBandManagement', {}, 'POST', params).then(_ => {
+          this.$message.success(`${this.$t('message.oobm.configured')}`)

Review Comment:
   ```suggestion
             this.$message.success(this.$t('message.oobm.configured'))
   ```



##########
ui/src/views/infra/ConfigureHostOOBM.vue:
##########
@@ -0,0 +1,172 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+<template>
+  <div class="form-layout">
+    <a-form
+      :ref="formRef"
+      :model="form"
+      :rules="rules"
+      @finish="handleSubmit"
+      v-ctrl-enter="handleSubmit"
+      class="form"
+      layout="vertical"
+    >
+      <a-alert type="warning">
+        <template #message>
+          <span v-html="$t('label.outofbandmanagement.configure')" />
+        </template>
+      </a-alert>
+      <div style="margin-top: 10px;">
+        <a-form-item name="address" ref="address">
+          <template #label>
+            <tooltip-label :title="$t('label.address')" 
:tooltip="apiParams.address.description"/>
+          </template>
+          <a-input
+            v-model:value="form.address"
+            v-focus="true" />
+        </a-form-item>
+        <a-form-item name="port" ref="port">
+          <template #label>
+            <tooltip-label :title="$t('label.port')" 
:tooltip="apiParams.port.description"/>
+          </template>
+          <a-input
+            v-model:value="form.port" />
+        </a-form-item>
+        <a-form-item name="username" ref="username">
+          <template #label>
+            <tooltip-label :title="$t('label.username')" 
:tooltip="apiParams.username.description"/>
+          </template>
+          <a-input
+            v-model:value="form.username" />
+        </a-form-item>
+        <a-form-item name="password" ref="password">
+          <template #label>
+            <tooltip-label :title="$t('label.password')" 
:tooltip="apiParams.password.description"/>
+          </template>
+          <a-input-password
+            v-model:value="form.password"
+            :placeholder="apiParams.password.description"/>
+        </a-form-item>
+        <a-form-item name="driver" ref="driver">
+          <template #label>
+            <tooltip-label :title="$t('label.driver')" 
:tooltip="apiParams.driver.description"/>
+          </template>
+          <a-select
+            v-model:value="form.driver"
+              style="width: 100%;"
+              optionFilterProp="value"
+              :filterOption="(input, option) => {
+                return option.value.toLowerCase().indexOf(input.toLowerCase()) 
>= 0
+              }" >
+              <a-select-option key="" label="">{{ }}</a-select-option>
+              <a-select-option value="ipmitool">ipmitool</a-select-option>
+              <a-select-option 
value="nestedcloudstack">nestedcloudstack</a-select-option>
+              <a-select-option value="redfish">redfish</a-select-option>
+            </a-select>
+        </a-form-item>
+      </div>
+      <div :span="24" class="action-button">
+        <a-button @click="$emit('close-action')">{{ $t('label.cancel') 
}}</a-button>
+        <a-button type="primary" @click="handleSubmit" ref="submit">{{ 
$t('label.ok') }}</a-button>
+      </div>
+    </a-form>
+  </div>
+</template>
+
+<script>
+import TooltipLabel from '@/components/widgets/TooltipLabel'
+import { ref, reactive, toRaw } from 'vue'
+import { api } from '@/api'
+
+export default {
+  name: 'ConfigureHostOOBM',
+  components: {
+    TooltipLabel
+  },
+  props: {
+    resource: {
+      type: Object,
+      required: true
+    }
+  },
+  data () {
+    return {
+    }
+  },
+  beforeCreate () {
+    this.apiParams = this.$getApiParams('configureOutOfBandManagement')
+  },
+  created () {
+    this.initForm()
+  },
+  methods: {
+    initForm () {
+      this.formRef = ref()
+      this.form = reactive({
+        address: this.resource.outofbandmanagement.address || '',
+        port: this.resource.outofbandmanagement.port || '',
+        username: this.resource.outofbandmanagement.username || '',
+        password: '',
+        driver: this.resource.outofbandmanagement.driver || ''
+      })
+      this.rules = reactive({
+        address: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        port: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        username: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        password: [{ required: true, message: 
this.$t('message.error.required.input') }],
+        driver: [{ required: true, message: 
this.$t('message.error.required.input') }]
+      })
+    },
+    handleSubmit (e) {
+      e.preventDefault()
+      this.formRef.value.validate().then(() => {
+        const values = toRaw(this.form)
+        var params = {
+          hostid: this.resource.id,
+          address: values.address,
+          port: values.port,
+          username: values.username,
+          password: values.password,
+          driver: values.driver
+        }
+
+        api('configureOutOfBandManagement', {}, 'POST', params).then(_ => {
+          this.$message.success(`${this.$t('message.oobm.configured')}`)
+          this.$emit('close-action')
+        }).catch(error => {
+          this.$notifyError(error)
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.reason {
+  padding-top: 20px
+}

Review Comment:
   ```suggestion
   ```
   
   Apparently, this CSS class is not being used in the component



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to