Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaowei
dlink
Commits
c9fe01bb
Commit
c9fe01bb
authored
May 20, 2022
by
zhu-mingye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add @mobile mode of dingTalk Alert
parent
55e50632
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
DingTalkSender.java
...rc/main/java/com/dlink/alert/dingtalk/DingTalkSender.java
+7
-2
DingTalkForm.tsx
...k-web/src/pages/AlertInstance/components/DingTalkForm.tsx
+12
-0
No files found.
dlink-alert/dlink-alert-dingtalk/src/main/java/com/dlink/alert/dingtalk/DingTalkSender.java
View file @
c9fe01bb
...
@@ -168,6 +168,7 @@ public class DingTalkSender {
...
@@ -168,6 +168,7 @@ public class DingTalkSender {
builder
.
append
(
" "
);
builder
.
append
(
" "
);
});
});
}
}
builder
.
append
(
"\n\n"
);
String
txt
=
genrateResultMsg
(
title
,
content
,
builder
);
String
txt
=
genrateResultMsg
(
title
,
content
,
builder
);
text
.
put
(
"title"
,
title
);
text
.
put
(
"title"
,
title
);
text
.
put
(
"text"
,
txt
);
text
.
put
(
"text"
,
txt
);
...
@@ -226,9 +227,13 @@ public class DingTalkSender {
...
@@ -226,9 +227,13 @@ public class DingTalkSender {
String
[]
atMobileArray
=
Asserts
.
isNotNullString
(
atMobiles
)
?
atMobiles
.
split
(
","
)
:
new
String
[
0
];
String
[]
atMobileArray
=
Asserts
.
isNotNullString
(
atMobiles
)
?
atMobiles
.
split
(
","
)
:
new
String
[
0
];
String
[]
atUserArray
=
Asserts
.
isNotNullString
(
atUserIds
)
?
atUserIds
.
split
(
","
)
:
new
String
[
0
];
String
[]
atUserArray
=
Asserts
.
isNotNullString
(
atUserIds
)
?
atUserIds
.
split
(
","
)
:
new
String
[
0
];
boolean
isAtAll
=
Objects
.
isNull
(
atAll
)
?
false
:
atAll
;
boolean
isAtAll
=
Objects
.
isNull
(
atAll
)
?
false
:
atAll
;
at
.
put
(
"atMobiles"
,
atMobileArray
);
at
.
put
(
"atUserIds"
,
atUserArray
);
at
.
put
(
"isAtAll"
,
isAtAll
);
at
.
put
(
"isAtAll"
,
isAtAll
);
if
(
atMobileArray
.
length
>
0
){
at
.
put
(
"atMobiles"
,
atMobileArray
);
}
if
(
atMobileArray
.
length
>
0
){
at
.
put
(
"atUserIds"
,
atUserArray
);
}
items
.
put
(
"at"
,
at
);
items
.
put
(
"at"
,
at
);
}
}
...
...
dlink-web/src/pages/AlertInstance/components/DingTalkForm.tsx
View file @
c9fe01bb
...
@@ -119,6 +119,18 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -119,6 +119,18 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
defaultChecked=
{
vals
.
isAtAll
}
/>
defaultChecked=
{
vals
.
isAtAll
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
vals
.
isAtAll
?
undefined
:
<>
<
Form
.
Item
name=
"atMobiles"
label=
"@手机号"
rules=
{
[{
required
:
true
,
message
:
'请输入@手机号!'
}]
}
>
<
Input
placeholder=
"请输入@手机号 多个使用英文逗号分开 "
/>
</
Form
.
Item
>
</>
}
<
Form
.
Item
<
Form
.
Item
name=
"enabled"
name=
"enabled"
label=
"是否启用"
>
label=
"是否启用"
>
...
...
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