Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tke-eos
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
tke-eos
Commits
521350a7
Commit
521350a7
authored
Apr 12, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
过滤掉tagName中包含Code的记录
parent
131a1b3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
service.js
app/service.js
+3
-4
tag.js
app/tag.js
+7
-0
No files found.
app/service.js
View file @
521350a7
...
...
@@ -13,7 +13,7 @@ module.exports = router
router
.
get
(
'
/
'
,
async
(
ctx
)
=>
{
// 取节点列表的第一个作为服务的访问ip
const
cacheKey
=
'
k8s.nodes.first
'
le
t
c
=
lruCache
.
get
(
cacheKey
)
cons
t
c
=
lruCache
.
get
(
cacheKey
)
let
wanIp
=
lruCache
.
get
(
cacheKey
)
if
(
!
c
)
{
const
res
=
await
ctx
.
cluster
.
node_list
()
...
...
@@ -23,13 +23,12 @@ router.get('/', async (ctx) => {
const
data
=
await
ctx
.
cluster
.
service_list
(
ctx
.
query
.
namespace
)
const
getDetail
=
async
(
item
)
=>
{
le
t
resData
=
await
ctx
.
cluster
.
service_get
(
item
.
serviceName
,
ctx
.
query
.
namespace
)
cons
t
resData
=
await
ctx
.
cluster
.
service_get
(
item
.
serviceName
,
ctx
.
query
.
namespace
)
item
.
image
=
resData
.
service
.
containers
[
0
].
image
if
(
item
.
userLabels
.
type
===
'
base
'
)
{
item
.
portMappings
=
resData
.
service
.
portMappings
item
.
wanIp
=
wanIp
}
return
}
const
task
=
[]
for
(
let
i
=
0
;
i
<
data
.
services
.
length
;
i
+=
1
)
{
...
...
@@ -78,8 +77,8 @@ router.post('/details', async (ctx) => {
ctx
.
body
=
ctx
.
ok
(
data
)
})
router
.
post
(
'
/delete
'
,
async
(
ctx
)
=>
{
await
ingressDelete
(
ctx
.
request
.
body
.
namespace
,
ctx
.
request
.
body
.
serviceName
)
await
ctx
.
cluster
.
service_delete
(
ctx
.
request
.
body
.
serviceName
,
ctx
.
request
.
body
.
namespace
)
await
ingressDelete
(
ctx
.
request
.
body
.
namespace
,
ctx
.
request
.
body
.
serviceName
)
ctx
.
body
=
ctx
.
ok
(
'
删除成功
'
)
})
...
...
app/tag.js
View file @
521350a7
...
...
@@ -4,5 +4,12 @@ const router = new Router()
module
.
exports
=
router
router
.
post
(
'
/
'
,
async
(
ctx
)
=>
{
const
data
=
await
ctx
.
container
.
tag_get
(
ctx
.
request
.
body
.
reponame
)
// 过滤掉tagName中包含Code的记录
data
.
tagInfo
=
data
.
tagInfo
.
filter
((
item
)
=>
{
if
(
item
.
tagName
.
indexOf
(
'
Code
'
)
===
-
1
)
{
return
item
}
return
null
})
ctx
.
body
=
ctx
.
ok
(
data
)
})
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