Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppMonitorSubscriber
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nongyingchen
AppMonitorSubscriber
Commits
150b64f6
Commit
150b64f6
authored
Jul 14, 2019
by
trace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上下链接添加, 标识
parent
8d3c8870
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
play.js
+16
-16
No files found.
play.js
View file @
150b64f6
let
version
=
'1.
2
'
let
version
=
'1.
3
'
let
release
=
`<div><br/>
let
release
=
`<div><br/>
<br/>1. <br/>
<br/>1. <br/>
限制排名获取的监控数量, 减少监控总数量, 加快循环时间
<br/>
添加"上", "下", 单独搜索客户 id 加上上下标识, 如: "上2002"
<br/>
从 Top 表单里获取的 APP 不在累积监控名单, 只监控获取当次的 APP. <br/>
从 Top 表单里获取的 APP 不在累积监控名单, 只监控获取当次的 APP. <br/>
监控数量控制在: (贷超 APP 数) + (OurApp 数) + Top表单(国家 * 类型 * Top获取数量[如获取 Top100, 就是100]) <br/>
监控数量控制在: (贷超 APP 数) + (OurApp 数) + Top表单(国家 * 类型 * Top获取数量[如获取 Top100, 就是100]) <br/>
<div/>
<div/>
...
@@ -481,15 +481,15 @@ async function monitorIfOnline(names) {
...
@@ -481,15 +481,15 @@ async function monitorIfOnline(names) {
log
(
`连接超时:
${
err
.
toString
()}
`
,
true
)
log
(
`连接超时:
${
err
.
toString
()}
`
,
true
)
throw
err
throw
err
}
else
{
}
else
{
errorLog
.
push
(
`Motitor Online Error:
${
link
(
name
,
true
)}
-
${
err
.
message
}
`
)
errorLog
.
push
(
`Motitor Online Error:
${
link
(
name
,
"error "
)}
-
${
err
.
message
}
`
)
log
(
`获取在线错误:
${
name
}
,
${
err
.
message
}
`
,
true
)
log
(
`获取在线错误:
${
name
}
,
${
err
.
message
}
`
,
true
)
}
}
})
})
}
}
}
}
function
link
(
name
,
countOurs
)
{
function
link
(
name
,
tag
)
{
let
ourName
=
isOurs
(
name
,
countOurs
)
let
ourName
=
isOurs
(
name
,
tag
)
return
`
${
ourName
}
____
return
`
${
ourName
}
____
<a href="
${
base_gp_url
}${
name
}
">
<a href="
${
base_gp_url
}${
name
}
">
${
getRegion
(
name
)}
[
${
monitorType
[
status
[
name
]
&&
status
[
name
].
category
||
''
]
||
''
}
] -
${
name
}
${
getRegion
(
name
)}
[
${
monitorType
[
status
[
name
]
&&
status
[
name
].
category
||
''
]
||
''
}
] -
${
name
}
...
@@ -555,7 +555,7 @@ function genMail() {
...
@@ -555,7 +555,7 @@ function genMail() {
if
(
failedApps
.
length
>
0
&&
isFirstRun
)
{
if
(
failedApps
.
length
>
0
&&
isFirstRun
)
{
emailContent
+=
`<div>本次第一次监控</div>`
emailContent
+=
`<div>本次第一次监控</div>`
failedApps
.
forEach
(
name
=>
{
failedApps
.
forEach
(
name
=>
{
emailContent
+=
`<div>获取失败}:
${
link
(
name
,
true
)}
</div>`
emailContent
+=
`<div>获取失败}:
${
link
(
name
,
"failed"
)}
</div>`
})
})
}
}
if
(
isFirstRun
)
{
if
(
isFirstRun
)
{
...
@@ -589,7 +589,7 @@ function genMail() {
...
@@ -589,7 +589,7 @@ function genMail() {
ourTop
=
[...
ourTop
,
...
ourAppIds
.
filter
(
val
=>
names
.
includes
(
val
))]
ourTop
=
[...
ourTop
,
...
ourAppIds
.
filter
(
val
=>
names
.
includes
(
val
))]
daichaoTop
=
[...
daichaoTop
,
...
daichaoApps
.
filter
(
val
=>
names
.
includes
(
val
))]
daichaoTop
=
[...
daichaoTop
,
...
daichaoApps
.
filter
(
val
=>
names
.
includes
(
val
))]
emailContent
+=
wrapSummary
(
`本次在<
${
monitorRegion
[
key
]}
>top
${
requestTopAppNum
}
监控列表:
${
names
.
length
}
个`
,
emailContent
+=
wrapSummary
(
`本次在<
${
monitorRegion
[
key
]}
>top
${
requestTopAppNum
}
监控列表:
${
names
.
length
}
个`
,
names
.
map
(
n
=>
`
${
link
(
n
.
id
,
true
)}
进top
${
requestTopAppNum
}
`
))
names
.
map
(
n
=>
`
${
link
(
n
.
id
)}
进top
${
requestTopAppNum
}
`
))
}
}
})
})
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
...
@@ -622,7 +622,7 @@ function genMail() {
...
@@ -622,7 +622,7 @@ function genMail() {
newOffline
.
forEach
(
name
=>
{
newOffline
.
forEach
(
name
=>
{
let
his
=
(
status
[
name
]
&&
status
[
name
].
permissionHis
&&
status
[
name
].
permissionHis
)
||
{}
let
his
=
(
status
[
name
]
&&
status
[
name
].
permissionHis
&&
status
[
name
].
permissionHis
)
||
{}
his
.
lastPermissions
=
(
status
[
name
]
&&
status
[
name
].
permissions
&&
status
[
name
].
permissions
)
||
[]
his
.
lastPermissions
=
(
status
[
name
]
&&
status
[
name
].
permissions
&&
status
[
name
].
permissions
)
||
[]
emailContent
+=
getPermissionChangeContent
(
name
,
his
,
`新下架ಥ_ಥ(及上次权限情况)`
)
emailContent
+=
getPermissionChangeContent
(
name
,
his
,
`新下架ಥ_ಥ(及上次权限情况)`
,
'下'
)
// emailContent += `<div>检测到新下架ಥ_ಥ: ${link(name)}</div>`
// emailContent += `<div>检测到新下架ಥ_ಥ: ${link(name)}</div>`
})
})
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
...
@@ -634,11 +634,11 @@ function genMail() {
...
@@ -634,11 +634,11 @@ function genMail() {
emailContent
+=
`<div>-----------新上架:
${
newOnline
.
length
}
个---------------------</div>`
emailContent
+=
`<div>-----------新上架:
${
newOnline
.
length
}
个---------------------</div>`
newOnline
.
forEach
(
name
=>
{
newOnline
.
forEach
(
name
=>
{
if
(
permissionChange
[
name
])
{
if
(
permissionChange
[
name
])
{
emailContent
+=
getPermissionChangeContent
(
name
,
permissionChange
[
name
],
`新上架😃: `
)
emailContent
+=
getPermissionChangeContent
(
name
,
permissionChange
[
name
],
`新上架😃: `
,
'上'
)
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
delete
permissionChange
[
name
]
delete
permissionChange
[
name
]
}
else
{
}
else
{
emailContent
+=
wrapSummary
(
`<div>新上架^_^:
${
link
(
name
,
true
)}
</div>`
,
emailContent
+=
wrapSummary
(
`<div>新上架^_^:
${
link
(
name
,
"上"
)}
</div>`
,
((
status
[
name
]
&&
status
[
name
].
permissions
&&
status
[
name
].
permissions
)
||
[]))
((
status
[
name
]
&&
status
[
name
].
permissions
&&
status
[
name
].
permissions
)
||
[]))
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
emailContent
+=
`<br/>/>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br/>`
}
}
...
@@ -664,7 +664,7 @@ function genMail() {
...
@@ -664,7 +664,7 @@ function genMail() {
emailContent
+=
`<div>下面是监控列表<br/>当前监控
${
countrys
.
length
}
个国家</div>`
emailContent
+=
`<div>下面是监控列表<br/>当前监控
${
countrys
.
length
}
个国家</div>`
Object
.
keys
(
monitorNames
).
forEach
(
val
=>
{
Object
.
keys
(
monitorNames
).
forEach
(
val
=>
{
let
num
=
monitorNames
[
val
].
length
let
num
=
monitorNames
[
val
].
length
emailContent
+=
wrapSummary
(
`
${
monitorRegion
[
val
]
||
val
}
(
${
num
}
个)`
,
monitorNames
[
val
].
map
(
id
=>
link
(
id
,
false
)))
emailContent
+=
wrapSummary
(
`
${
monitorRegion
[
val
]
||
val
}
(
${
num
}
个)`
,
monitorNames
[
val
].
map
(
id
=>
link
(
id
)))
})
})
status
.
sendListDate
=
today
.
toString
()
status
.
sendListDate
=
today
.
toString
()
}
}
...
@@ -682,7 +682,7 @@ function genMail() {
...
@@ -682,7 +682,7 @@ function genMail() {
return
`<div>
${
firstLine
}
</div><br/>
${
emailContent
}
<br/>version:
${
version
}
`
return
`<div>
${
firstLine
}
</div><br/>
${
emailContent
}
<br/>version:
${
version
}
`
}
}
function
isOurs
(
name
,
countOurs
)
{
function
isOurs
(
name
,
tag
)
{
let
prefix
=
''
let
prefix
=
''
if
(
daichaoApps
.
includes
(
name
))
{
if
(
daichaoApps
.
includes
(
name
))
{
prefix
=
`🏦(贷超.
${
daichaoAppInfoes
[
name
].
region
}
[
${
daichaoAppInfoes
[
name
].
daichaoId
}
]__<a href="
${
daichaoAppInfoes
[
name
].
mgt
}${
daichaoAppInfoes
[
name
]
&&
prefix
=
`🏦(贷超.
${
daichaoAppInfoes
[
name
].
region
}
[
${
daichaoAppInfoes
[
name
].
daichaoId
}
]__<a href="
${
daichaoAppInfoes
[
name
].
mgt
}${
daichaoAppInfoes
[
name
]
&&
...
@@ -690,15 +690,15 @@ function isOurs(name, countOurs) {
...
@@ -690,15 +690,15 @@ function isOurs(name, countOurs) {
}
}
if
(
ourAppIds
.
includes
(
name
))
{
if
(
ourAppIds
.
includes
(
name
))
{
if
(
prefix
!=
''
)
{
if
(
prefix
!=
''
)
{
prefix
=
`📌(
${
ourApps
[
name
]}
|
${
prefix
}
`
prefix
=
`📌(
${
tag
||
""
}${
ourApps
[
name
]}
|
${
prefix
}
`
}
else
{
}
else
{
prefix
=
`📌(
${
ourApps
[
name
]
||
'No Name in Gitlab'
}
)`
prefix
=
`📌(
${
tag
||
""
}${
ourApps
[
name
]
||
'No Name in Gitlab'
}
)`
}
}
}
}
return
prefix
return
prefix
}
}
function
getPermissionChangeContent
(
id
,
obj
,
title
)
{
function
getPermissionChangeContent
(
id
,
obj
,
title
,
tag
)
{
changes
=
[]
changes
=
[]
if
(
obj
.
adds
&&
obj
.
adds
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`添加`
,
obj
.
adds
,
"green"
))
}
if
(
obj
.
adds
&&
obj
.
adds
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`添加`
,
obj
.
adds
,
"green"
))
}
if
(
obj
.
deletes
&&
obj
.
deletes
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`删除`
,
obj
.
deletes
,
"red"
))
}
if
(
obj
.
deletes
&&
obj
.
deletes
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`删除`
,
obj
.
deletes
,
"red"
))
}
...
@@ -706,7 +706,7 @@ function getPermissionChangeContent(id, obj, title) {
...
@@ -706,7 +706,7 @@ function getPermissionChangeContent(id, obj, title) {
if
(
obj
.
newPermission
&&
obj
.
newPermission
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`新权限`
,
obj
.
newPermission
))
}
if
(
obj
.
newPermission
&&
obj
.
newPermission
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`新权限`
,
obj
.
newPermission
))
}
if
(
obj
.
lastPermissions
&&
obj
.
lastPermissions
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`旧权限`
,
obj
.
lastPermissions
))
}
if
(
obj
.
lastPermissions
&&
obj
.
lastPermissions
.
length
>
0
)
{
changes
.
push
(
wrapSummary
(
`旧权限`
,
obj
.
lastPermissions
))
}
log
(
`权限改变:
${
id
}
:
${
changes
.
length
}
`
)
log
(
`权限改变:
${
id
}
:
${
changes
.
length
}
`
)
return
wrapSummary
(
`- <div>
${
title
||
'权限改变'
}
:<br/>
${
link
(
id
,
t
rue
)}
</div>`
,
changes
)
return
wrapSummary
(
`- <div>
${
title
||
'权限改变'
}
:<br/>
${
link
(
id
,
t
ag
)}
</div>`
,
changes
)
}
}
function
setPermissionHis
(
name
,
obj
)
{
function
setPermissionHis
(
name
,
obj
)
{
...
...
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