mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 18:44:54 +08:00
fix: alert list links did not work, changed dashboardUri to Url, this is breaking api change in alert api (#10756)
This commit is contained in:
@ -62,7 +62,7 @@ Content-Type: application/json
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Example Response**:
|
**Example Response**:
|
||||||
|
|
||||||
```http
|
```http
|
||||||
HTTP/1.1 200
|
HTTP/1.1 200
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
@ -94,7 +94,7 @@ Content-Type: application/json
|
|||||||
```http
|
```http
|
||||||
HTTP/1.1 200
|
HTTP/1.1 200
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
{
|
{
|
||||||
```
|
```
|
||||||
|
|
||||||
## Pause all alerts
|
## Pause all alerts
|
||||||
|
@ -105,7 +105,7 @@ func transformToDTOs(alerts []*models.Alert, c *middleware.Context) ([]*dtos.Ale
|
|||||||
for _, alert := range alertDTOs {
|
for _, alert := range alertDTOs {
|
||||||
for _, dash := range dashboardsQuery.Result {
|
for _, dash := range dashboardsQuery.Result {
|
||||||
if alert.DashboardId == dash.Id {
|
if alert.DashboardId == dash.Id {
|
||||||
alert.DashbboardUri = dash.GenerateUrl()
|
alert.Url = dash.GenerateUrl()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ type AlertRule struct {
|
|||||||
EvalDate time.Time `json:"evalDate"`
|
EvalDate time.Time `json:"evalDate"`
|
||||||
EvalData *simplejson.Json `json:"evalData"`
|
EvalData *simplejson.Json `json:"evalData"`
|
||||||
ExecutionError string `json:"executionError"`
|
ExecutionError string `json:"executionError"`
|
||||||
DashbboardUri string `json:"dashboardUri"`
|
Url string `json:"url"`
|
||||||
CanEdit bool `json:"canEdit"`
|
CanEdit bool `json:"canEdit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ describe('AlertRuleList', () => {
|
|||||||
.format(),
|
.format(),
|
||||||
evalData: {},
|
evalData: {},
|
||||||
executionError: '',
|
executionError: '',
|
||||||
dashboardUri: 'd/ufkcofof/my-goal',
|
url: 'd/ufkcofof/my-goal',
|
||||||
canEdit: true,
|
canEdit: true,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
@ -137,7 +137,7 @@ export class AlertRuleItem extends React.Component<AlertRuleItemProps, any> {
|
|||||||
'fa-pause': !rule.isPaused,
|
'fa-pause': !rule.isPaused,
|
||||||
});
|
});
|
||||||
|
|
||||||
let ruleUrl = `${rule.dashboardUri}?panelId=${rule.panelId}&fullscreen=true&edit=true&tab=alert`;
|
let ruleUrl = `${rule.url}?panelId=${rule.panelId}&fullscreen=true&edit=true&tab=alert`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="alert-rule-item">
|
<li className="alert-rule-item">
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<div class="alert-rule-item__body">
|
<div class="alert-rule-item__body">
|
||||||
<div class="alert-rule-item__header">
|
<div class="alert-rule-item__header">
|
||||||
<p class="alert-rule-item__name">
|
<p class="alert-rule-item__name">
|
||||||
<a href="dashboard/{{alert.dashboardUri}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert">
|
<a href="{{alert.url}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert">
|
||||||
{{alert.name}}
|
{{alert.name}}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -14,7 +14,7 @@ function getRule(name, state, info) {
|
|||||||
.format(),
|
.format(),
|
||||||
evalData: {},
|
evalData: {},
|
||||||
executionError: '',
|
executionError: '',
|
||||||
dashboardUri: 'db/mygool',
|
url: 'db/mygool',
|
||||||
stateText: state,
|
stateText: state,
|
||||||
stateIcon: 'fa',
|
stateIcon: 'fa',
|
||||||
stateClass: 'asd',
|
stateClass: 'asd',
|
||||||
|
@ -13,7 +13,7 @@ export const AlertRule = types
|
|||||||
stateClass: types.string,
|
stateClass: types.string,
|
||||||
stateAge: types.string,
|
stateAge: types.string,
|
||||||
info: types.optional(types.string, ''),
|
info: types.optional(types.string, ''),
|
||||||
dashboardUri: types.string,
|
url: types.string,
|
||||||
canEdit: types.boolean,
|
canEdit: types.boolean,
|
||||||
})
|
})
|
||||||
.views(self => ({
|
.views(self => ({
|
||||||
|
Reference in New Issue
Block a user