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
1adcb9f9
Commit
1adcb9f9
authored
Jul 01, 2020
by
徐一鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一键部署数据处理
parent
d38804f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
115 additions
and
150 deletions
+115
-150
src/pages/workbench/yygl/deployment.vue
src/pages/workbench/yygl/deployment.vue
+115
-150
No files found.
src/pages/workbench/yygl/deployment.vue
View file @
1adcb9f9
...
@@ -184,10 +184,10 @@
...
@@ -184,10 +184,10 @@
style=
"margin-top: 30px;"
style=
"margin-top: 30px;"
></deployment-info>
></deployment-info>
<div
class=
"apass_button step_action"
>
<div
class=
"apass_button step_action"
>
<el-button
type=
"primary"
>
<el-button
type=
"primary"
v-if=
"finallyState === 1"
>
前往查看
前往查看
</el-button>
</el-button>
<el-button
type=
"primary"
>
<el-button
type=
"primary"
v-if=
"finallyState === 2"
>
重新部署
重新部署
</el-button>
</el-button>
</div>
</div>
...
@@ -238,7 +238,7 @@ export default {
...
@@ -238,7 +238,7 @@ export default {
"
v-apaas-code
"
:
codes
,
"
v-apaas-code
"
:
codes
,
},
},
data
:
()
=>
({
data
:
()
=>
({
step
:
0
,
step
:
2
,
senior_flag
:
false
,
senior_flag
:
false
,
begin_code
:
""
,
begin_code
:
""
,
dialogInfo
:
{
dialogInfo
:
{
...
@@ -314,95 +314,8 @@ export default {
...
@@ -314,95 +314,8 @@ export default {
},
},
evtUuid
:
""
,
evtUuid
:
""
,
evtSource
:
null
,
evtSource
:
null
,
listStatus
:
[],
stateList
:
[],
state
:
""
,
finallyState
:
0
,
text
:
""
,
url
:
""
,
act
:
0
,
stateList
:
[
{
name
:
"
获取部署参数
"
,
value
:
"
values
"
,
content
:
[
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 1.0.0
"
,
""
,
"
======================================
"
,
],
state
:
1
,
},
{
name
:
"
拉取部署文件
"
,
value
:
"
pull-chart
"
,
content
:
[
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 2.0.0
"
,
""
,
"
======================================
"
,
],
state
:
1
,
},
{
name
:
"
开始部署
"
,
value
:
"
install
"
,
content
:
[
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 3.0.0
"
,
""
,
"
======================================
"
,
],
state
:
1
,
},
{
name
:
"
部署状态
"
,
value
:
"
deploy-status
"
,
content
:
[
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
"
host: mapvideo.wodcloud.com
"
,
"
repository: hub.wodcloud.com/apaas/apaas-mapvideos
"
,
"
tag: 4.0.0
"
,
""
,
"
======================================
"
,
],
state
:
2
,
},
],
}),
}),
methods
:
{
methods
:
{
get_step_info
()
{
get_step_info
()
{
...
@@ -454,72 +367,124 @@ export default {
...
@@ -454,72 +367,124 @@ export default {
this
.
evtUuid
=
evtUuid
;
this
.
evtUuid
=
evtUuid
;
this
.
evtSource
=
evtSource
;
this
.
evtSource
=
evtSource
;
evtSource
.
addEventListener
(
"
message
"
,
function
(
e
)
{
let
messages
=
[
if
(
this
.
listStatus
.
map
((
o
)
=>
o
.
status
).
indexOf
(
e
.
lastEventId
)
==
-
1
)
{
{
if
(
this
.
listStatus
.
length
)
{
id
:
"
values
"
,
this
.
listStatus
[
this
.
listStatus
.
length
-
1
].
success
=
"
success
"
;
type
:
"
message
"
,
}
data
:
{
state
:
"
notes
"
,
data
:
"
======================================
"
,
},
},
{
id
:
"
values
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
host: mapvideo.wodcloud.com
\n
repository: hub.wodcloud.com/apaas/apaas-mapvideos
\n
tag: 1.0.0
\n
"
,
},
},
{
id
:
"
values
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
======================================
"
,
},
},
{
id
:
"
pull-chart
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
正在下载charts文件 apaas-mapvideos-1.0
"
,
},
},
{
id
:
"
pull-chart
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
下载charts文件apaas-mapvideos-1.0成功
"
,
},
},
{
id
:
"
pull-chart
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
正在解压 apaas-ui-1.0.0.tgz
"
},
},
{
id
:
"
pull-chart
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
解压 apaas-ui-1.0.0.tgz 完成
"
},
},
{
id
:
"
install
"
,
type
:
"
message
"
,
data
:
{
state
:
"
notes
"
,
data
:
"
NAME: ram001
\n
LAST DEPLOYED: Wed Jul 1 16:09:25 2020
\n
NAMESPACE: test
\n
STATUS: DEPLOYED
\n\n
RESOURCES:
\n
==
\
u003e v1/Pod(related)
\n
NAME READY STATUS RESTARTS AGE
\n
ram001-65c84bfd8d-xmt2k 0/1 ContainerCreating 0
\
u003cinvalid
\
u003e
\n\n
==
\
u003e v1/Service
\n
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
\n
ram001 ClusterIP 10.3.181.74
\
u003cnone
\
u003e 80/TCP
\
u003cinvalid
\
u003e
\n\n
==
\
u003e v1beta1/Deployment
\n
NAME READY UP-TO-DATE AVAILABLE AGE
\n
ram001 0/1 1 0
\
u003cinvalid
\
u003e
\n\n
==
\
u003e v1beta1/Ingress
\n
NAME HOSTS ADDRESS PORTS AGE
\n
ram001 mapvideo.wodcloud.com 80
\
u003cinvalid
\
u003e
\n\n\n
"
,
},
},
{
id
:
"
deploy-status
"
,
type
:
"
message
"
,
data
:
{
state
:
"
success
"
,
data
:
"
在命名空间 test 下部署 ram001 成功!
"
,
},
},
];
this
.
listStatus
.
push
(
{
messages
.
forEach
((
msg
,
index
)
=>
{
status
:
e
.
lastEventId
,
setTimeout
(()
=>
{
success
:
JSON
.
parse
(
e
.
data
).
state
,
this
.
updateStatus
(
msg
);
data
:
JSON
.
parse
(
e
.
data
).
data
,
},
(
index
+
1
)
*
200
);
});
});
this
.
text
=
this
.
listStatus
[
this
.
listStatus
.
length
-
1
].
data
;
evtSource
.
addEventListener
(
"
message
"
,
(
event
)
=>
{
this
.
text
=
"
<span class='linenum'></span>
"
+
this
.
text
;
console
.
log
(
event
);
this
.
text
=
this
.
text
.
replace
(
});
/
\n
/g
,
},
"
\n
<span class='linenum'></span>
"
updateStatus
(
event
)
{
);
let
names
=
{
this
.
text
=
this
.
text
.
replace
(
/>==>/g
,
"
>>
"
);
values
:
"
获取部署参数
"
,
this
.
act
=
this
.
listStatus
.
length
-
1
;
"
pull-chart
"
:
"
拉取部署文件
"
,
}
else
{
install
:
"
开始部署
"
,
let
i
=
this
.
listStatus
.
map
((
o
)
=>
o
.
status
).
indexOf
(
e
.
lastEventId
);
"
deploy-status
"
:
"
部署状态
"
,
let
item
=
this
.
listStatus
[
i
].
data
;
};
let
currentState
=
this
.
stateList
.
find
((
state
)
=>
{
return
state
.
value
===
event
.
id
;
});
item
=
item
+
"
\n
"
+
JSON
.
parse
(
e
.
data
).
data
;
if
(
!
currentState
)
{
if
(
this
.
stateList
.
length
>
0
)
{
this
.
stateList
[
this
.
stateList
.
length
-
1
].
state
=
1
;
}
this
.
listStatus
[
i
].
data
=
item
;
this
.
stateList
.
push
({
this
.
text
=
this
.
listStatus
[
this
.
listStatus
.
length
-
1
].
data
;
name
:
names
[
event
.
id
],
this
.
text
=
"
<span class='linenum'></span>
"
+
this
.
text
;
value
:
event
.
id
,
this
.
text
=
this
.
text
.
replace
(
content
:
[],
/
\n
/g
,
state
:
0
,
"
\n
<span class='linenum'></span>
"
});
);
this
.
text
=
this
.
text
.
replace
(
/>==>/g
,
"
>>
"
);
this
.
act
=
this
.
listStatus
.
length
-
1
;
if
(
JSON
.
parse
(
e
.
data
).
state
!=
"
notes
"
)
{
currentState
=
this
.
stateList
[
this
.
stateList
.
length
-
1
];
this
.
listStatus
[
i
].
success
=
JSON
.
parse
(
e
.
data
).
state
;
}
}
}
if
(
JSON
.
parse
(
e
.
data
).
state
==
"
success
"
)
{
currentState
.
content
.
push
(...
event
.
data
.
data
.
split
(
"
\n
"
));
this
.
state
=
"
部署成功!
"
;
this
.
url
=
`https://
${
window
.
location
.
host
}
/apaas/ui/#/pods?namespace=
${
this
.
baseInfoForm
.
namespace
}
`
;
}
for
(
let
i
=
0
;
i
<
this
.
listStatus
.
length
;
i
++
)
{
if
(
event
.
id
===
"
deploy-status
"
)
{
switch
(
this
.
listStatus
[
i
].
status
)
{
let
finallyState
=
event
.
data
.
state
===
"
success
"
?
1
:
2
;
case
"
values
"
:
this
.
finallyState
=
finallyState
;
this
.
listStatus
[
i
].
statusHan
=
"
获取部署参数
"
;
currentState
.
state
=
finallyState
;
break
;
}
else
{
case
"
pull-chart
"
:
if
(
event
.
data
.
state
!==
"
notes
"
)
{
this
.
listStatus
[
i
].
statusHan
=
"
拉取部署文件
"
;
currentState
.
state
=
2
;
break
;
case
"
install
"
:
this
.
listStatus
[
i
].
statusHan
=
"
开始部署
"
;
break
;
case
"
deploy-status
"
:
this
.
listStatus
[
i
].
statusHan
=
"
部署状态
"
;
break
;
default
:
this
.
listStatus
[
i
].
statusHan
=
"
其他
"
;
break
;
}
}
}
}
});
},
},
},
},
created
()
{
created
()
{
...
...
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