Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qahome-diamond
Commits
56204ae1
Commit
56204ae1
authored
Dec 20, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建服务增加镜像默认值
parent
dbb774e5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
48 deletions
+39
-48
notify.js
src/api/notify.js
+2
-1
pipelineNode.js
src/api/pipelineNode.js
+4
-4
envDetail.vue
src/views/docker/envDetail.vue
+8
-6
application.vue
src/views/pipeline/application.vue
+25
-37
No files found.
src/api/notify.js
View file @
56204ae1
...
...
@@ -4,7 +4,8 @@ export function getNotify(data) {
return
request
({
url
:
'
/notify/getNotify
'
,
method
:
'
post
'
,
data
})
data
})
}
export
function
saveNotify
(
data
)
{
...
...
src/api/pipelineNode.js
View file @
56204ae1
import
request
from
'
@/utils/request
'
export
function
get
Master
(
data
)
{
export
function
get
Branch
(
query
)
{
return
request
({
url
:
'
/pipeline/
master
'
,
method
:
'
pos
t
'
,
data
url
:
'
/pipeline/
getGitBranch
'
,
method
:
'
ge
t
'
,
params
:
query
})
}
export
function
saveApplication
(
data
)
{
...
...
src/views/docker/envDetail.vue
View file @
56204ae1
...
...
@@ -328,7 +328,7 @@
v-for=
"(item,index) in tagOptions"
:key=
"index"
:label=
"item.tagName"
:value=
"item.
repo_name + ':' +item.
tagName"
/>
:value=
"item.tagName"
/>
</el-select>
</el-col>
</el-row>
...
...
@@ -367,7 +367,7 @@
:closable=
"false"
title=
"温馨提醒"
type=
"warning"
description=
"警告:该操作
会
将会更新这个服务为指定版本,在这个pod上做的所有操作将会丢失。"
description=
"警告:该操作将会更新这个服务为指定版本,在这个pod上做的所有操作将会丢失。"
/>
<p
class=
"title-sub"
>
选择服务
</p>
<el-row
:gutter=
"20"
>
...
...
@@ -387,7 +387,7 @@
v-for=
"(item,index) in tagOptions"
:key=
"index"
:label=
"item.tagName"
:value=
"item.
repo_name + ':' +item.
tagName"
/>
:value=
"item.tagName"
/>
</el-select>
</el-col>
</el-row>
...
...
@@ -587,6 +587,7 @@ export default {
}).
then
(
res
=>
{
if
(
res
.
data
.
tagCount
)
{
this
.
tagOptions
=
res
.
data
.
tagInfo
this
.
tagName
=
`latest`
}
})
},
...
...
@@ -602,7 +603,7 @@ export default {
CreateCluService
({
serviceName
:
serviceName
,
namespace
:
this
.
namespace
,
image
:
this
.
tagName
,
image
:
`
${
this
.
reponame
}
:
${
this
.
tagName
}
`
,
label
:
this
.
label
,
type
:
this
.
type
,
domain
:
this
.
domain
.
split
(
'
.
'
)[
0
],
...
...
@@ -695,7 +696,6 @@ export default {
},
updateService
(
value
)
{
this
.
tagName
=
''
this
.
updateDialog
=
true
this
.
serviceName
=
value
.
serviceName
this
.
type
=
value
.
labels
.
type
...
...
@@ -703,6 +703,8 @@ export default {
fetchTaglist
({
reponame
:
'
qa-
'
+
value
.
labels
.
type
+
'
/
'
+
this
.
serviceName
}).
then
(
res
=>
{
if
(
res
.
data
.
tagCount
)
{
this
.
tagOptions
=
res
.
data
.
tagInfo
this
.
reponame
=
res
.
data
.
reponame
this
.
tagName
=
'
latest
'
this
.
server
=
res
.
data
.
server
}
})
...
...
@@ -726,7 +728,7 @@ export default {
updateClusterService
()
{
const
self
=
this
modifyCluService
({
serviceName
:
this
.
serviceName
,
image
:
this
.
tagName
,
namespace
:
this
.
namespace
,
type
:
this
.
type
}).
then
(
res
=>
{
modifyCluService
({
serviceName
:
this
.
serviceName
,
image
:
`
${
this
.
reponame
}
:
${
this
.
tagName
}
`
,
namespace
:
this
.
namespace
,
type
:
this
.
type
}).
then
(
res
=>
{
this
.
$message
({
message
:
`更新
${
this
.
serviceName
}
成功`
,
type
:
'
success
'
,
...
...
src/views/pipeline/application.vue
View file @
56204ae1
...
...
@@ -43,7 +43,7 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"namespace"
label=
"命名空间"
align=
"center"
/>
<el-table-column
prop=
"create_time"
label=
"创建
时间"
align=
"center"
/>
<el-table-column
:formatter=
"formatDate"
label=
"
时间"
align=
"center"
/>
<el-table-column
:label=
"$t('table.actions')"
align=
"center"
width=
"180"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
{{
$t
(
'
table.edit
'
)
}}
</el-button>
...
...
@@ -123,7 +123,7 @@
</template>
<
script
>
import
{
getApplications
,
saveApplication
,
updateApplication
,
deleteApplication
,
get
Master
}
from
'
@/api/pipelineNode
'
import
{
getApplications
,
saveApplication
,
updateApplication
,
deleteApplication
,
get
Branch
}
from
'
@/api/pipelineNode
'
import
{
getProjects
}
from
'
@/api/proconfig
'
import
waves
from
'
@/directive/waves
'
// Waves directive
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
...
...
@@ -132,18 +132,14 @@ import { getCluster } from '@/api/cluster'
import
{
fetchKubernetesList
}
from
'
@/api/docker
'
export
default
{
name
:
'
ComplexTable
'
,
components
:
{
Pagination
},
directives
:
{
waves
},
filters
:
{
replaceeRef
(
ref
)
{
return
ref
?
ref
.
replace
(
'
refs/heads/
'
,
''
)
:
''
},
formatDeploy
(
ref
)
{
return
ref
?
'
是
'
:
'
否
'
},
formatDate
(
date
,
pattern
=
'
YYYY-MM-DD HH:mm:ss
'
)
{
return
moment
(
date
).
format
(
pattern
)
formatDeploy
(
data
)
{
return
data
?
'
是
'
:
'
否
'
}
},
data
()
{
...
...
@@ -151,17 +147,13 @@ export default {
value1
:
true
,
repository
:
''
,
total
:
0
,
cacheData
:
{},
listQuery
:
{
},
temp
:
{
},
listQuery
:
{},
temp
:
{},
dialogFormVisible
:
false
,
dialogDeleteVisible
:
false
,
dialogStatus
:
''
,
rules
:
{
application_name
:
[{
required
:
true
,
message
:
'
请输入
'
,
trigger
:
'
change
'
}],
// timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }],
namespace
:
[{
required
:
true
,
message
:
'
请输入
'
,
trigger
:
'
blur
'
}],
cluster
:
[{
required
:
true
,
message
:
'
请输入
'
,
trigger
:
'
blur
'
}]
},
...
...
@@ -239,6 +231,11 @@ export default {
this
.
getApplications
()
},
formatDate
(
row
,
val
)
{
const
pattern
=
'
YYYY-MM-DD HH:mm:ss
'
return
moment
(
row
.
updatedAt
||
row
.
createdAt
).
format
(
pattern
)
},
resetTemp
()
{
this
.
temp
=
{
id
:
0
,
...
...
@@ -248,24 +245,28 @@ export default {
isDeploy
:
false
,
repos
:
[{
repository
:
''
,
ref
:
{
id
:
'
请选择
'
}}],
application_name
:
''
,
create_time
:
moment
().
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
new_user
:
''
,
update_user
:
''
,
cluster
:
this
.
$store
.
getters
.
cluster
}
},
handleCreate
()
{
this
.
resetTemp
()
this
.
dialogStatus
=
'
新建
'
getProjects
()
{
getProjects
({
is_active
:
true
,
deploy_to_testenv
:
true
}).
then
(
res
=>
{
this
.
repos
=
res
.
data
this
.
repos
.
sort
((
s1
,
s2
)
=>
{
return
s1
.
project_name
.
localeCompare
(
s2
.
project_name
)
})
})
},
handleCreate
()
{
this
.
resetTemp
()
this
.
dialogStatus
=
'
新建
'
this
.
getProjects
()
this
.
dialogFormVisible
=
true
},
getRefs
(
repo
,
flag
)
{
if
(
flag
)
{
this
.
temp
.
repos
.
forEach
(
item
=>
{
...
...
@@ -274,9 +275,7 @@ export default {
}
})
}
// 拿出gitlab地址信息
const
gitlabAddress
=
this
.
screen
(
repo
,
this
.
repos
)
getMaster
({
name
:
repo
,
gitlabAddress
}).
then
(
res
=>
{
getBranch
({
name
:
repo
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
'
0001
'
)
{
this
.
$notify
({
title
:
'
error
'
,
...
...
@@ -296,14 +295,7 @@ export default {
}
})
},
screen
(
name
,
list
)
{
const
data
=
list
.
filter
(
item
=>
{
if
(
name
===
item
.
project_name
)
{
return
item
}
})
return
data
[
0
].
git_lab
},
createData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
...
...
@@ -374,16 +366,12 @@ export default {
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
dialogStatus
=
'
编辑
'
this
.
dialogFormVisible
=
true
getProjects
({
is_active
:
true
}).
then
(
res
=>
{
this
.
repos
=
res
.
data
this
.
repos
.
sort
((
s1
,
s2
)
=>
{
return
s1
.
project_name
.
localeCompare
(
s2
.
project_name
)
})
row
.
repos
.
forEach
(
item
=>
{
this
.
getRefs
(
item
.
repository
)
})
this
.
getProjects
()
row
.
repos
.
forEach
(
item
=>
{
this
.
getRefs
(
item
.
repository
)
})
},
handleDelete
(
row
)
{
this
.
temp
=
row
this
.
dialogDeleteVisible
=
true
...
...
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