mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
RestoreDashboards: add IsDeleted and PermanentlyDeleteDate to deleted search (#89283)
RestoreDashboards: add IsDeleted and PermanentlyDeleteDate to deleted items in Search
This commit is contained in:
@@ -741,7 +741,9 @@ func makeQueryResult(query *dashboards.FindPersistedDashboardsQuery, res []dashb
|
|||||||
hit.Tags = append(hit.Tags, item.Term)
|
hit.Tags = append(hit.Tags, item.Term)
|
||||||
}
|
}
|
||||||
if item.Deleted != nil {
|
if item.Deleted != nil {
|
||||||
hit.RemainingTrashAtAge = util.RemainingDaysUntil((*item.Deleted).Add(daysInTrash))
|
deletedDate := (*item.Deleted).Add(daysInTrash)
|
||||||
|
hit.IsDeleted = true
|
||||||
|
hit.PermanentlyDeleteDate = &deletedDate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return hitList
|
return hitList
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package model
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FilterWhere limits the set of dashboard IDs to the dashboards for
|
// FilterWhere limits the set of dashboard IDs to the dashboards for
|
||||||
@@ -62,22 +63,23 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Hit struct {
|
type Hit struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
UID string `json:"uid"`
|
UID string `json:"uid"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
Type HitType `json:"type"`
|
Type HitType `json:"type"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
IsStarred bool `json:"isStarred"`
|
IsStarred bool `json:"isStarred"`
|
||||||
FolderID int64 `json:"folderId,omitempty"` // Deprecated: use FolderUID instead
|
FolderID int64 `json:"folderId,omitempty"` // Deprecated: use FolderUID instead
|
||||||
FolderUID string `json:"folderUid,omitempty"`
|
FolderUID string `json:"folderUid,omitempty"`
|
||||||
FolderTitle string `json:"folderTitle,omitempty"`
|
FolderTitle string `json:"folderTitle,omitempty"`
|
||||||
FolderURL string `json:"folderUrl,omitempty"`
|
FolderURL string `json:"folderUrl,omitempty"`
|
||||||
SortMeta int64 `json:"sortMeta"`
|
SortMeta int64 `json:"sortMeta"`
|
||||||
SortMetaName string `json:"sortMetaName,omitempty"`
|
SortMetaName string `json:"sortMetaName,omitempty"`
|
||||||
RemainingTrashAtAge string `json:"remainingTrashAtAge,omitempty"`
|
IsDeleted bool `json:"isDeleted"`
|
||||||
|
PermanentlyDeleteDate *time.Time `json:"permanentlyDeleteDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type HitList []*Hit
|
type HitList []*Hit
|
||||||
|
|||||||
@@ -4703,11 +4703,15 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
"isDeleted": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"isStarred": {
|
"isStarred": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"remainingTrashAtAge": {
|
"permanentlyDeleteDate": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"slug": {
|
"slug": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -7049,6 +7053,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"State": {
|
"State": {
|
||||||
|
"description": "+enum",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"Status": {
|
"Status": {
|
||||||
@@ -7492,6 +7497,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Type": {
|
"Type": {
|
||||||
|
"description": "+enum",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"TypeMeta": {
|
"TypeMeta": {
|
||||||
|
|||||||
@@ -15815,11 +15815,15 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
"isDeleted": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"isStarred": {
|
"isStarred": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"remainingTrashAtAge": {
|
"permanentlyDeleteDate": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"slug": {
|
"slug": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|||||||
@@ -6194,10 +6194,14 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"isDeleted": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"isStarred": {
|
"isStarred": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"remainingTrashAtAge": {
|
"permanentlyDeleteDate": {
|
||||||
|
"format": "date-time",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"slug": {
|
"slug": {
|
||||||
|
|||||||
Reference in New Issue
Block a user