mirror of https://github.com/grafana/grafana.git
Chore: Fix times in schemas (#64906)
* Fix times in schemas * Fix frontend lints
This commit is contained in:
parent
9ca01cc070
commit
1328a32a31
|
|
@ -24,8 +24,8 @@ system account
|
||||||
| `role` | string | **Yes** | OrgRole is a Grafana Organization Role which can be 'Viewer', 'Editor', 'Admin'.<br/>Possible values are: `Admin`, `Editor`, `Viewer`. |
|
| `role` | string | **Yes** | OrgRole is a Grafana Organization Role which can be 'Viewer', 'Editor', 'Admin'.<br/>Possible values are: `Admin`, `Editor`, `Viewer`. |
|
||||||
| `tokens` | integer | **Yes** | Tokens is the number of active tokens for the service account.<br/>Tokens are used to authenticate the service account against Grafana. |
|
| `tokens` | integer | **Yes** | Tokens is the number of active tokens for the service account.<br/>Tokens are used to authenticate the service account against Grafana. |
|
||||||
| `accessControl` | map[string]boolean | No | AccessControl metadata associated with a given resource. |
|
| `accessControl` | map[string]boolean | No | AccessControl metadata associated with a given resource. |
|
||||||
| `created` | integer | No | Created indicates when the service account was created. |
|
| `created` | string | No | Created indicates when the service account was created. |
|
||||||
| `teams` | string[] | No | Teams is a list of teams the service account belongs to. |
|
| `teams` | string[] | No | Teams is a list of teams the service account belongs to. |
|
||||||
| `updated` | integer | No | Updated indicates when the service account was updated. |
|
| `updated` | string | No | Updated indicates when the service account was updated. |
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,12 @@ A team is a named grouping of Grafana users to which access control rules may be
|
||||||
|
|
||||||
| Property | Type | Required | Description |
|
| Property | Type | Required | Description |
|
||||||
|-----------------|--------------------|----------|----------------------------------------------------------|
|
|-----------------|--------------------|----------|----------------------------------------------------------|
|
||||||
| `created` | integer | **Yes** | Created indicates when the team was created. |
|
| `created` | string | **Yes** | Created indicates when the team was created. |
|
||||||
| `memberCount` | integer | **Yes** | MemberCount is the number of the team members. |
|
| `memberCount` | integer | **Yes** | MemberCount is the number of the team members. |
|
||||||
| `name` | string | **Yes** | Name of the team. |
|
| `name` | string | **Yes** | Name of the team. |
|
||||||
| `orgId` | integer | **Yes** | OrgId is the ID of an organisation the team belongs to. |
|
| `orgId` | integer | **Yes** | OrgId is the ID of an organisation the team belongs to. |
|
||||||
| `permission` | integer | **Yes** | Possible values are: `0`, `1`, `2`, `4`. |
|
| `permission` | integer | **Yes** | Possible values are: `0`, `1`, `2`, `4`. |
|
||||||
| `updated` | integer | **Yes** | Updated indicates when the team was updated. |
|
| `updated` | string | **Yes** | Updated indicates when the team was updated. |
|
||||||
| `accessControl` | map[string]boolean | No | AccessControl metadata associated with a given resource. |
|
| `accessControl` | map[string]boolean | No | AccessControl metadata associated with a given resource. |
|
||||||
| `avatarUrl` | string | No | AvatarUrl is the team's avatar URL. |
|
| `avatarUrl` | string | No | AvatarUrl is the team's avatar URL. |
|
||||||
| `email` | string | No | Email of the team. |
|
| `email` | string | No | Email of the team. |
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package kind
|
package kind
|
||||||
|
|
||||||
import "strings"
|
import (
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
name: "LibraryPanel"
|
name: "LibraryPanel"
|
||||||
maturity: "experimental"
|
maturity: "experimental"
|
||||||
|
|
@ -52,8 +55,8 @@ lineage: seqs: [
|
||||||
folderUid: string @grafanamaturity(ToMetadata="sys")
|
folderUid: string @grafanamaturity(ToMetadata="sys")
|
||||||
connectedDashboards: int64
|
connectedDashboards: int64
|
||||||
|
|
||||||
created: string @grafanamaturity(ToMetadata="sys") // time.Time in golang
|
created: string & time.Time
|
||||||
updated: string @grafanamaturity(ToMetadata="sys") // time.Time in golang
|
updated: string & time.Time
|
||||||
|
|
||||||
createdBy: #LibraryElementDTOMetaUser @grafanamaturity(ToMetadata="sys")
|
createdBy: #LibraryElementDTOMetaUser @grafanamaturity(ToMetadata="sys")
|
||||||
updatedBy: #LibraryElementDTOMetaUser @grafanamaturity(ToMetadata="sys")
|
updatedBy: #LibraryElementDTOMetaUser @grafanamaturity(ToMetadata="sys")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package kind
|
package kind
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
name: "ServiceAccount"
|
name: "ServiceAccount"
|
||||||
maturity: "merged"
|
maturity: "merged"
|
||||||
description: "system account"
|
description: "system account"
|
||||||
|
|
@ -35,9 +37,9 @@ lineage: seqs: [
|
||||||
// Teams is a list of teams the service account belongs to.
|
// Teams is a list of teams the service account belongs to.
|
||||||
teams?: [...string] @grafanamaturity(ToMetadata="sys")
|
teams?: [...string] @grafanamaturity(ToMetadata="sys")
|
||||||
// Created indicates when the service account was created.
|
// Created indicates when the service account was created.
|
||||||
created?: int64 @grafanamaturity(ToMetadata="sys")
|
created?: string & time.Time
|
||||||
// Updated indicates when the service account was updated.
|
// Updated indicates when the service account was updated.
|
||||||
updated?: int64 @grafanamaturity(ToMetadata="sys")
|
updated?: string & time.Time
|
||||||
|
|
||||||
// OrgRole is a Grafana Organization Role which can be 'Viewer', 'Editor', 'Admin'.
|
// OrgRole is a Grafana Organization Role which can be 'Viewer', 'Editor', 'Admin'.
|
||||||
#OrgRole: "Admin" | "Editor" | "Viewer" @cuetsy(kind="type")
|
#OrgRole: "Admin" | "Editor" | "Viewer" @cuetsy(kind="type")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package kind
|
package kind
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
name: "Team"
|
name: "Team"
|
||||||
maturity: "merged"
|
maturity: "merged"
|
||||||
description: "A team is a named grouping of Grafana users to which access control rules may be assigned."
|
description: "A team is a named grouping of Grafana users to which access control rules may be assigned."
|
||||||
|
|
@ -26,9 +28,9 @@ lineage: seqs: [
|
||||||
[string]: bool @grafanamaturity(ToMetadata="sys")
|
[string]: bool @grafanamaturity(ToMetadata="sys")
|
||||||
}
|
}
|
||||||
// Created indicates when the team was created.
|
// Created indicates when the team was created.
|
||||||
created: int64 @grafanamaturity(ToMetadata="sys")
|
created: string & time.Time
|
||||||
// Updated indicates when the team was updated.
|
// Updated indicates when the team was updated.
|
||||||
updated: int64 @grafanamaturity(ToMetadata="sys")
|
updated: string & time.Time
|
||||||
|
|
||||||
#Permission: 0 | 1 | 2 | 4 @cuetsy(kind="enum",memberNames="Member|Viewer|Editor|Admin")
|
#Permission: 0 | 1 | 2 | 4 @cuetsy(kind="enum",memberNames="Member|Viewer|Editor|Admin")
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ export interface ServiceAccount {
|
||||||
/**
|
/**
|
||||||
* Created indicates when the service account was created.
|
* Created indicates when the service account was created.
|
||||||
*/
|
*/
|
||||||
created?: number;
|
created?: string;
|
||||||
/**
|
/**
|
||||||
* ID is the unique identifier of the service account in the database.
|
* ID is the unique identifier of the service account in the database.
|
||||||
*/
|
*/
|
||||||
|
|
@ -63,7 +63,7 @@ export interface ServiceAccount {
|
||||||
/**
|
/**
|
||||||
* Updated indicates when the service account was updated.
|
* Updated indicates when the service account was updated.
|
||||||
*/
|
*/
|
||||||
updated?: number;
|
updated?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const defaultServiceAccount: Partial<ServiceAccount> = {
|
export const defaultServiceAccount: Partial<ServiceAccount> = {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export interface Team {
|
||||||
/**
|
/**
|
||||||
* Created indicates when the team was created.
|
* Created indicates when the team was created.
|
||||||
*/
|
*/
|
||||||
created: number;
|
created: string;
|
||||||
/**
|
/**
|
||||||
* Email of the team.
|
* Email of the team.
|
||||||
*/
|
*/
|
||||||
|
|
@ -51,5 +51,5 @@ export interface Team {
|
||||||
/**
|
/**
|
||||||
* Updated indicates when the team was updated.
|
* Updated indicates when the team was updated.
|
||||||
*/
|
*/
|
||||||
updated: number;
|
updated: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ spec:
|
||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
created:
|
created:
|
||||||
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
createdBy:
|
createdBy:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -55,6 +56,7 @@ spec:
|
||||||
folderUid:
|
folderUid:
|
||||||
type: string
|
type: string
|
||||||
updated:
|
updated:
|
||||||
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
updatedBy:
|
updatedBy:
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,18 @@
|
||||||
|
|
||||||
package librarypanel
|
package librarypanel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
// LibraryElementDTOMeta defines model for LibraryElementDTOMeta.
|
// LibraryElementDTOMeta defines model for LibraryElementDTOMeta.
|
||||||
type LibraryElementDTOMeta struct {
|
type LibraryElementDTOMeta struct {
|
||||||
ConnectedDashboards int64 `json:"connectedDashboards"`
|
ConnectedDashboards int64 `json:"connectedDashboards"`
|
||||||
Created string `json:"created"`
|
Created time.Time `json:"created"`
|
||||||
CreatedBy LibraryElementDTOMetaUser `json:"createdBy"`
|
CreatedBy LibraryElementDTOMetaUser `json:"createdBy"`
|
||||||
FolderName string `json:"folderName"`
|
FolderName string `json:"folderName"`
|
||||||
FolderUid string `json:"folderUid"`
|
FolderUid string `json:"folderUid"`
|
||||||
Updated string `json:"updated"`
|
Updated time.Time `json:"updated"`
|
||||||
UpdatedBy LibraryElementDTOMetaUser `json:"updatedBy"`
|
UpdatedBy LibraryElementDTOMetaUser `json:"updatedBy"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
created:
|
created:
|
||||||
description: Created indicates when the service account was created.
|
description: Created indicates when the service account was created.
|
||||||
format: int64
|
format: date-time
|
||||||
type: integer
|
type: string
|
||||||
id:
|
id:
|
||||||
description: ID is the unique identifier of the service account in the database.
|
description: ID is the unique identifier of the service account in the database.
|
||||||
format: int64
|
format: int64
|
||||||
|
|
@ -73,8 +73,8 @@ spec:
|
||||||
type: integer
|
type: integer
|
||||||
updated:
|
updated:
|
||||||
description: Updated indicates when the service account was updated.
|
description: Updated indicates when the service account was updated.
|
||||||
format: int64
|
format: date-time
|
||||||
type: integer
|
type: string
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
- orgId
|
- orgId
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
|
|
||||||
package serviceaccount
|
package serviceaccount
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
// Defines values for OrgRole.
|
// Defines values for OrgRole.
|
||||||
const (
|
const (
|
||||||
OrgRoleAdmin OrgRole = "Admin"
|
OrgRoleAdmin OrgRole = "Admin"
|
||||||
|
|
@ -30,7 +34,7 @@ type ServiceAccount struct {
|
||||||
AvatarUrl string `json:"avatarUrl"`
|
AvatarUrl string `json:"avatarUrl"`
|
||||||
|
|
||||||
// Created indicates when the service account was created.
|
// Created indicates when the service account was created.
|
||||||
Created *int64 `json:"created,omitempty"`
|
Created *time.Time `json:"created,omitempty"`
|
||||||
|
|
||||||
// ID is the unique identifier of the service account in the database.
|
// ID is the unique identifier of the service account in the database.
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
|
|
@ -58,5 +62,5 @@ type ServiceAccount struct {
|
||||||
Tokens int64 `json:"tokens"`
|
Tokens int64 `json:"tokens"`
|
||||||
|
|
||||||
// Updated indicates when the service account was updated.
|
// Updated indicates when the service account was updated.
|
||||||
Updated *int64 `json:"updated,omitempty"`
|
Updated *time.Time `json:"updated,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
created:
|
created:
|
||||||
description: Created indicates when the team was created.
|
description: Created indicates when the team was created.
|
||||||
format: int64
|
format: date-time
|
||||||
type: integer
|
type: string
|
||||||
email:
|
email:
|
||||||
description: Email of the team.
|
description: Email of the team.
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -58,8 +58,8 @@ spec:
|
||||||
type: integer
|
type: integer
|
||||||
updated:
|
updated:
|
||||||
description: Updated indicates when the team was updated.
|
description: Updated indicates when the team was updated.
|
||||||
format: int64
|
format: date-time
|
||||||
type: integer
|
type: string
|
||||||
required:
|
required:
|
||||||
- orgId
|
- orgId
|
||||||
- name
|
- name
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
|
|
||||||
package team
|
package team
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
// Defines values for Permission.
|
// Defines values for Permission.
|
||||||
const (
|
const (
|
||||||
PermissionN0 Permission = 0
|
PermissionN0 Permission = 0
|
||||||
|
|
@ -30,7 +34,7 @@ type Team struct {
|
||||||
AvatarUrl *string `json:"avatarUrl,omitempty"`
|
AvatarUrl *string `json:"avatarUrl,omitempty"`
|
||||||
|
|
||||||
// Created indicates when the team was created.
|
// Created indicates when the team was created.
|
||||||
Created int64 `json:"created"`
|
Created time.Time `json:"created"`
|
||||||
|
|
||||||
// Email of the team.
|
// Email of the team.
|
||||||
Email *string `json:"email,omitempty"`
|
Email *string `json:"email,omitempty"`
|
||||||
|
|
@ -46,5 +50,5 @@ type Team struct {
|
||||||
Permission Permission `json:"permission"`
|
Permission Permission `json:"permission"`
|
||||||
|
|
||||||
// Updated indicates when the team was updated.
|
// Updated indicates when the team was updated.
|
||||||
Updated int64 `json:"updated"`
|
Updated time.Time `json:"updated"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -878,7 +878,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"description": "A standalone panel",
|
"description": "A standalone panel",
|
||||||
"grafanaMaturityCount": 10,
|
"grafanaMaturityCount": 8,
|
||||||
"lineageIsGroup": false,
|
"lineageIsGroup": false,
|
||||||
"links": {
|
"links": {
|
||||||
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/core/librarypanel/schema-reference",
|
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/core/librarypanel/schema-reference",
|
||||||
|
|
@ -1492,7 +1492,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"description": "system account",
|
"description": "system account",
|
||||||
"grafanaMaturityCount": 9,
|
"grafanaMaturityCount": 7,
|
||||||
"lineageIsGroup": false,
|
"lineageIsGroup": false,
|
||||||
"links": {
|
"links": {
|
||||||
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/core/serviceaccount/schema-reference",
|
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/core/serviceaccount/schema-reference",
|
||||||
|
|
@ -1642,7 +1642,7 @@
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"description": "A team is a named grouping of Grafana users to which access control rules may be assigned.",
|
"description": "A team is a named grouping of Grafana users to which access control rules may be assigned.",
|
||||||
"grafanaMaturityCount": 7,
|
"grafanaMaturityCount": 5,
|
||||||
"lineageIsGroup": false,
|
"lineageIsGroup": false,
|
||||||
"links": {
|
"links": {
|
||||||
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/core/team/schema-reference",
|
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/core/team/schema-reference",
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ export const getMockTeam = (i = 1, overrides = {}): Team => {
|
||||||
memberCount: i,
|
memberCount: i,
|
||||||
permission: TeamPermissionLevel.Member,
|
permission: TeamPermissionLevel.Member,
|
||||||
accessControl: { isEditor: false },
|
accessControl: { isEditor: false },
|
||||||
created: 0,
|
created: '',
|
||||||
orgId: 0,
|
orgId: 0,
|
||||||
updated: 0,
|
updated: '',
|
||||||
...overrides,
|
...overrides,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ const loadingTeam = {
|
||||||
memberCount: 0,
|
memberCount: 0,
|
||||||
permission: TeamPermissionLevel.Member,
|
permission: TeamPermissionLevel.Member,
|
||||||
accessControl: { isEditor: false },
|
accessControl: { isEditor: false },
|
||||||
created: 0,
|
created: '',
|
||||||
orgId: 0,
|
orgId: 0,
|
||||||
updated: 0,
|
updated: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function buildNavModel(team: Team): NavModelItem {
|
export function buildNavModel(team: Team): NavModelItem {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue