Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
fb88704a
Commit
fb88704a
authored
Jul 23, 2020
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一键部署storage格式修改
parent
6065e9a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
16 deletions
+60
-16
src/pages/workbench/yygl/deployment.vue
src/pages/workbench/yygl/deployment.vue
+60
-16
No files found.
src/pages/workbench/yygl/deployment.vue
View file @
fb88704a
...
...
@@ -162,7 +162,7 @@
<div
class=
"cloud_save_box"
>
<el-checkbox-group
v-model=
"item.value"
>
<p
v-for=
"(it,idx) in pvc_list"
:key=
"idx"
>
<el-checkbox
:label=
"it.disk_serial_number+';'+it.id"
>
{{it.disk_serial_number}}
({{it.disk_cap+'Gi'}})
</el-checkbox>
<el-checkbox
:label=
"it.disk_serial_number+';'+it.id
+';'+it.disk_cap
"
>
{{it.disk_serial_number}}
({{it.disk_cap+'Gi'}})
</el-checkbox>
</p>
</el-checkbox-group>
</div>
...
...
@@ -377,12 +377,11 @@ export default {
if
(
e
.
type
==
"
radio
"
)
{
e
[
"
val
"
]
=
e
.
value
[
0
];
}
else
if
(
e
.
type
==
"
storage
"
)
{
debugger
this
.
select_volumn
=
[]
e
[
'
check_type
'
]
=
0
e
[
'
storage_type
'
]
=
0
console
.
log
(
this
.
pvc_list
);
e
[
'
value
'
]
=
[
this
.
pvc_list
[
0
].
disk_serial_number
+
'
;
'
+
this
.
pvc_list
[
0
].
id
]
e
[
'
value
'
]
=
[
this
.
pvc_list
[
0
].
disk_serial_number
+
'
;
'
+
this
.
pvc_list
[
0
].
id
+
'
;
'
+
this
.
pvc_list
[
0
].
disk_cap
]
}
else
if
(
e
.
type
==
"
resource
"
)
{
let
memory
=
e
.
memory
;
let
cpu
=
e
.
cpu
;
...
...
@@ -413,9 +412,33 @@ export default {
console
.
log
(
key
,
val
);
this
.
$set
(
obj
,
key
,
val
);
},
is_size_toge
(
arr
){
if
(
arr
.
length
){
var
temp
=
arr
[
0
].
split
(
'
;
'
)[
2
]
return
arr
.
some
(
function
(
value
,
index
,
_arr
)
{
return
temp
!==
value
.
split
(
'
;
'
)[
2
]
});
}
else
{
this
.
$message
.
error
(
'
请选择规格
'
)
return
'
kong
'
}
},
is_size_id_arr
(
arr
){
if
(
arr
.
length
){
var
temp_arr
=
[]
arr
.
forEach
(
e
=>
{
temp_arr
.
push
(
e
.
split
(
'
;
'
)[
1
])
});
return
temp_arr
}
else
{
this
.
$message
.
error
(
'
请选择规格
'
)
return
[]
}
},
deal_key_value
(
key_string
,
type
,
value
)
{
var
key_arr
=
key_string
.
split
(
"
.
"
);
var
temp
=
this
.
app_set_info
;
try
{
key_arr
.
forEach
((
e
,
index
)
=>
{
if
(
key_arr
.
length
-
1
==
index
)
{
if
(
type
==
"
resource
"
)
{
...
...
@@ -430,20 +453,35 @@ export default {
},
};
}
else
if
(
type
==
"
storage
"
)
{
//临时存储
if
(
value
[
1
]
==
0
){
temp
[
e
]
=
{
emptyDir
:
true
}
}
else
{
//云存储
if
(
this
.
is_size_toge
(
value
[
0
])
==
true
){
this
.
$message
.
error
(
'
请选择同规格的数据盘
'
)
throw
1
}
else
if
(
this
.
is_size_toge
(
value
[
0
])
==
'
kong
'
){
throw
1
}
temp
[
e
]
=
{
volumeClaimTemplate
:
{
spec
:
{
storageClassName
:
"
nfs-client
"
,
storageClassName
:
value
[
2
]
==
0
?
'
nfs-client
'
:
'
rook-ceph-block
'
,
accessModes
:
[
"
ReadWriteOnce
"
],
resources
:
{
requests
:
{
storage
:
value
,
storage
:
value
[
0
][
0
].
split
(
'
;
'
)[
2
]
+
'
Gi
'
,
},
},
},
selector
:
{},
},
};
this
.
select_volumn
.
push
(...
this
.
is_size_id_arr
(
value
[
0
]))
}
}
else
if
(
type
==
"
volume
"
)
{
//临时存储
if
(
value
[
1
]
==
0
){
...
...
@@ -467,6 +505,10 @@ export default {
temp
=
temp
[
e
];
}
});
}
catch
(
error
)
{
return
}
},
deal_key_text
(
obj
,
key_string
)
{
var
key_arr
=
key_string
.
split
(
"
.
"
);
...
...
@@ -528,6 +570,8 @@ export default {
if
(
response
.
data
.
success
===
1
)
{
// this.$message.success("开始部署成功");
this
.
deploy_id
=
response
.
data
.
data
.
deploy_id
;
}
else
{
this
.
$message
.
error
(
response
.
data
.
errMsg
)
}
})
.
catch
(()
=>
{
...
...
@@ -576,7 +620,7 @@ export default {
if
(
e
.
type
==
"
radio
"
)
{
this
.
deal_key_value
(
e
.
name
,
e
.
type
,
e
.
val
);
}
else
if
(
e
.
type
==
"
storage
"
)
{
this
.
deal_key_value
(
e
.
name
,
e
.
type
,
e
.
storage
);
this
.
deal_key_value
(
e
.
name
,
e
.
type
,
[
e
.
value
,
e
.
check_type
,
e
.
storage_type
]
);
}
else
if
(
e
.
type
==
"
resource
"
)
{
let
memory
=
e
.
memory
;
let
cpu
=
e
.
cpu
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment