Commit 0ad34fa4 by Heechul Kim

added disk partition templates

parent f8e0246d
......@@ -48,6 +48,17 @@
</div>
<br><br>
<div class="stacked-label">
<label>Disk Partition Template</label>
<br>
<q-select
type="radio"
v-model="form.dpt"
ref="dpt"
:options="selectDPT">
</q-select>
</div>
<br><br>
<div class="stacked-label">
<label>IPMI IP주소</label>
<input
type="text"
......@@ -169,6 +180,7 @@ export default {
name: '',
type: '',
os: '',
dpt: '',
ipmi_ip: '',
mac: '',
ip: '',
......@@ -182,7 +194,8 @@ export default {
{'label': 'PM', value: 'PM'},
{'label': 'VM', value: 'VM'}
],
selectOS: selectOS
selectOS: selectOS,
selectDPT: []
}
},
validations: {
......@@ -205,6 +218,7 @@ export default {
name: this.form.name,
type: this.form.type,
os: this.form.os,
dpt: this.form.dpt,
ipmi_ip: this.form.ipmi_ip,
mac: this.form.mac,
ip: this.form.ip,
......@@ -232,11 +246,30 @@ export default {
Toast.create.negative(response.statusText)
this.$refs.name.focus()
})
},
getDPT: function () {
const url = API_URL + '/machine/dpt'
const token = this.$store.state.token
const headers = {
headers: {
'Authorization': `Bearer ${token}`
}
}
this.$http.get(url, headers).then(response => {
let self = this
response.body.forEach(function (el) {
self.selectDPT.push({'label': el, 'value': el})
})
}, response => {
Toast.create.negative('디스크 파티션 템플릿 정보 수신 실패')
})
}
},
mounted () {
if (!this.$store.state.login) { this.$router.push('/') }
this.getDPT()
this.$refs.name.focus()
}
}
......
......@@ -272,6 +272,15 @@ export default {
model: row.os,
items: selectOS
},
header11: {
type: 'heading',
label: '디스크 파티션 템플릿'
},
dpt: {
type: 'radio',
model: row.dpt,
items: this.getDPT()
},
header2: {
type: 'heading',
label: '그룹'
......@@ -383,6 +392,24 @@ export default {
]
})
},
getDPT: function () {
const url = API_URL + '/machine/dpt'
const token = this.$store.state.token
const headers = {
headers: {
'Authorization': `Bearer ${token}`
}
}
let selectDPT = []
this.$http.get(url, headers).then(response => {
response.body.forEach(function (el) {
selectDPT.push({'label': el, 'value': el})
})
}, response => {
Toast.create.negative('디스크 파티션 템플릿 정보 수신 실패')
})
return selectDPT
},
getSectionList: function () {
const url = API_URL + '/section'
const token = this.$store.state.token
......@@ -446,13 +473,13 @@ export default {
return this.$store.state.role === 'admin'
},
loadData: function () {
const url = API_URL + '/machine'
const token = this.$store.state.token
const headers = {
headers: {
'Authorization': `Bearer ${token}`
}
}
let url = API_URL + '/machine'
this.$http.get(url, headers).then(response => {
this.machines = response.body
}, response => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment