Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
609f2144
Unverified
Commit
609f2144
authored
Jan 10, 2024
by
gaoyan
Committed by
GitHub
Jan 10, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix]Fix Email smtpSslTrust NPE (#2979)
Co-authored-by:
gaoyan1998
<
gaoyan1998@users.noreply.github.com
>
parent
e0ba0c54
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
EmailParams.java
...c/main/java/org/dinky/alert/email/params/EmailParams.java
+1
-1
URLUtils.java
dinky-common/src/main/java/org/dinky/utils/URLUtils.java
+4
-5
index.tsx
dinky-web/src/components/FormSingleColumnList/index.tsx
+4
-1
index.tsx
...e/components/AlertTypeChoose/InstanceForm/Email/index.tsx
+1
-1
No files found.
dinky-alert/dinky-alert-email/src/main/java/org/dinky/alert/email/params/EmailParams.java
View file @
609f2144
...
@@ -44,5 +44,5 @@ public class EmailParams {
...
@@ -44,5 +44,5 @@ public class EmailParams {
private
boolean
sslEnable
;
private
boolean
sslEnable
;
private
String
user
;
private
String
user
;
private
String
password
;
private
String
password
;
private
String
smtpSslTrust
;
private
String
smtpSslTrust
=
""
;
}
}
dinky-common/src/main/java/org/dinky/utils/URLUtils.java
View file @
609f2144
...
@@ -32,6 +32,7 @@ import java.util.Set;
...
@@ -32,6 +32,7 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.text.StrFormatter
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
/**
/**
...
@@ -50,16 +51,14 @@ public class URLUtils {
...
@@ -50,16 +51,14 @@ public class URLUtils {
try
{
try
{
URL
url
=
new
URL
(
urlPath
);
URL
url
=
new
URL
(
urlPath
);
URLConnection
urlConnection
=
url
.
openConnection
();
URLConnection
urlConnection
=
url
.
openConnection
();
if
(
"http"
.
equals
(
url
.
getProtocol
())
if
(
"rs"
.
equals
(
url
.
getProtocol
()))
{
||
"https"
.
equals
(
url
.
getProtocol
())
||
"hdfs"
.
equals
(
url
.
getProtocol
()))
{
}
else
if
(
"rs"
.
equals
(
url
.
getProtocol
()))
{
String
path
=
StrUtil
.
join
(
File
.
separator
,
TMP_PATH
,
"rs"
,
url
.
getPath
());
String
path
=
StrUtil
.
join
(
File
.
separator
,
TMP_PATH
,
"rs"
,
url
.
getPath
());
return
FileUtil
.
writeFromStream
(
urlConnection
.
getInputStream
(),
path
);
return
FileUtil
.
writeFromStream
(
urlConnection
.
getInputStream
(),
path
);
}
else
if
(
"file"
.
equals
(
url
.
getProtocol
()))
{
}
else
if
(
"file"
.
equals
(
url
.
getProtocol
()))
{
return
new
File
(
url
.
getPath
());
return
new
File
(
url
.
getPath
());
}
}
return
null
;
throw
new
RuntimeException
(
StrFormatter
.
format
(
"The path {} unsupported protocol: {},please use rs:// or file://"
,
urlPath
,
url
.
getProtocol
()));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
...
dinky-web/src/components/FormSingleColumnList/index.tsx
View file @
609f2144
...
@@ -106,12 +106,15 @@ export const FormSingleColumnList = (props: FormSingleColumnListProps) => {
...
@@ -106,12 +106,15 @@ export const FormSingleColumnList = (props: FormSingleColumnListProps) => {
onClick=
{
async
()
=>
{
onClick=
{
async
()
=>
{
// 获取前一项的值
// 获取前一项的值
const
lastItem
=
fields
[
fields
.
length
===
0
?
0
:
fields
.
length
-
1
];
const
lastItem
=
fields
[
fields
.
length
===
0
?
0
:
fields
.
length
-
1
];
if
(
!
lastItem
)
{
add
();
return
;
}
const
addBeforePreItem
=
form
.
getFieldValue
([...
namePath
,
lastItem
.
name
]);
const
addBeforePreItem
=
form
.
getFieldValue
([...
namePath
,
lastItem
.
name
]);
if
(
!
addBeforePreItem
)
{
if
(
!
addBeforePreItem
)
{
await
ErrorMessageAsync
(
l
(
'rc.ai.previousItemRequired'
));
await
ErrorMessageAsync
(
l
(
'rc.ai.previousItemRequired'
));
return
;
return
;
}
else
if
(
fields
.
length
>=
max
)
{
}
else
if
(
fields
.
length
>=
max
)
{
console
.
log
(
fields
.
length
);
await
ErrorMessageAsync
(
l
(
'rc.ai.atMost'
,
''
,
{
max
}));
await
ErrorMessageAsync
(
l
(
'rc.ai.atMost'
,
''
,
{
max
}));
return
;
return
;
}
else
{
}
else
{
...
...
dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/Email/index.tsx
View file @
609f2144
...
@@ -123,7 +123,7 @@ const Email = (props: EmailProps) => {
...
@@ -123,7 +123,7 @@ const Email = (props: EmailProps) => {
inputPlaceholder=
{
l
(
'rc.ai.receiverCcsPleaseHolder'
)
}
inputPlaceholder=
{
l
(
'rc.ai.receiverCcsPleaseHolder'
)
}
title=
{
l
(
'rc.ai.receiverCcsMax'
,
''
,
{
max
:
10
})
}
title=
{
l
(
'rc.ai.receiverCcsMax'
,
''
,
{
max
:
10
})
}
max=
{
10
}
max=
{
10
}
min=
{
1
}
min=
{
0
}
plain=
{
true
}
plain=
{
true
}
/>
/>
</
ProCard
>
</
ProCard
>
...
...
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