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
77e7d840
Unverified
Commit
77e7d840
authored
Dec 21, 2023
by
gaoyan
Committed by
GitHub
Dec 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the method of adding a quick alarm template (#2708)
* fix log error * Added the method of adding a quick alarm template
parent
3218724e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
index.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
+6
-4
service.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/service.tsx
+0
-1
index.tsx
...tingCenter/AlertRule/AlertRuleList/RuleEditForm/index.tsx
+19
-1
No files found.
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
View file @
77e7d840
...
...
@@ -28,8 +28,8 @@ import {
isCanPushDolphin
,
isOnline
,
isRunning
,
projectCommonShow
,
isSql
isSql
,
projectCommonShow
}
from
'@/pages/DataStudio/HeaderContainer/function'
;
import
PushDolphin
from
'@/pages/DataStudio/HeaderContainer/PushDolphin'
;
import
{
...
...
@@ -191,7 +191,9 @@ const HeaderContainer = (props: connect) => {
let
selectsql
=
null
;
if
(
currentTab
.
editorInstance
)
{
selectsql
=
currentTab
.
editorInstance
.
getModel
().
getValueInRange
(
currentTab
.
editorInstance
.
getSelection
());
selectsql
=
currentTab
.
editorInstance
.
getModel
()
.
getValueInRange
(
currentTab
.
editorInstance
.
getSelection
());
}
if
(
selectsql
==
null
||
selectsql
==
''
)
{
selectsql
=
currentData
.
statement
;
...
...
@@ -199,7 +201,7 @@ const HeaderContainer = (props: connect) => {
const
res
=
await
debugTask
(
l
(
'pages.datastudio.editor.debugging'
,
''
,
{
jobName
:
currentData
.
name
}),
{
...
currentData
,
statement
:
selectsql
}
{
...
currentData
,
statement
:
selectsql
}
);
if
(
!
res
)
return
;
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/service.tsx
View file @
77e7d840
...
...
@@ -18,7 +18,6 @@
*/
import
{
handleGetOption
,
handleOption
}
from
'@/services/BusinessCrud'
;
import
{
DIALECT
}
from
'@/services/constants'
;
export
async
function
explainSql
(
title
:
string
,
params
:
any
)
{
return
handleOption
(
'/api/task/explainSql'
,
title
,
params
);
...
...
dinky-web/src/pages/SettingCenter/AlertRule/AlertRuleList/RuleEditForm/index.tsx
View file @
77e7d840
...
...
@@ -17,6 +17,7 @@
*
*/
import
{
Authorized
}
from
'@/hooks/useAccess'
;
import
{
RuleType
,
TriggerType
...
...
@@ -45,7 +46,9 @@ import {
ProFormTextArea
}
from
'@ant-design/pro-components'
;
import
{
ProFormDependency
}
from
'@ant-design/pro-form'
;
import
{
Button
,
Divider
,
Form
,
Space
}
from
'antd'
;
import
{
Button
,
Divider
,
Form
,
Space
,
Typography
}
from
'antd'
;
const
{
Link
}
=
Typography
;
type
AlertRuleFormProps
=
{
onCancel
:
(
flag
?:
boolean
)
=>
void
;
...
...
@@ -72,6 +75,20 @@ const RuleEditForm = (props: AlertRuleFormProps) => {
return
handleSubmit
({
...
fieldsValue
,
rule
:
JSON
.
stringify
(
fieldsValue
.
rule
)
});
};
const
renderTemplateDropDown
=
(
item
:
any
)
=>
{
return
(
<>
{
item
}
<
Authorized
key=
'create'
path=
'/registration/alert/template/add'
>
<>
<
Divider
style=
{
{
margin
:
'8px 0'
}
}
/>
<
Link
href=
{
'#/registration/alert/template'
}
>
+
{
l
(
'rc.alert.template.new'
)
}
</
Link
>
</>
</
Authorized
>
</>
);
};
const
renderFooter
=
()
=>
{
return
[
<
Button
key=
{
'RuleCancel'
}
onClick=
{
()
=>
handleModalVisible
(
false
)
}
>
...
...
@@ -119,6 +136,7 @@ const RuleEditForm = (props: AlertRuleFormProps) => {
request=
{
async
()
=>
getAlertTemplate
()
}
placeholder=
{
l
(
'sys.alert.rule.template'
)
}
rules=
{
[{
required
:
true
,
message
:
l
(
'sys.alert.rule.template'
)
}]
}
fieldProps=
{
{
dropdownRender
:
(
item
)
=>
renderTemplateDropDown
(
item
)
}
}
/>
</
ProFormGroup
>
...
...
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