Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ed1864e0
Commit
ed1864e0
authored
Mar 16, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(dashlist): stores recently visited dashboards per orgid
parent
0998ce81
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
public/app/features/dashboard/impression_store.ts
+10
-4
No files found.
public/app/features/dashboard/impression_store.ts
View file @
ed1864e0
...
@@ -2,14 +2,16 @@
...
@@ -2,14 +2,16 @@
import
store
from
'app/core/store'
;
import
store
from
'app/core/store'
;
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
config
from
'app/core/config'
;
export
class
ImpressionsStore
{
export
class
ImpressionsStore
{
constructor
()
{}
constructor
()
{}
addDashboardImpression
(
dashboardId
)
{
addDashboardImpression
(
dashboardId
)
{
var
impressionsKey
=
this
.
impressionKey
(
config
);
var
impressions
=
[];
var
impressions
=
[];
if
(
store
.
exists
(
"dashboard_impressions"
))
{
if
(
store
.
exists
(
impressionsKey
))
{
impressions
=
JSON
.
parse
(
store
.
get
(
"dashboard_impressions"
));
impressions
=
JSON
.
parse
(
store
.
get
(
impressionsKey
));
if
(
!
_
.
isArray
(
impressions
))
{
if
(
!
_
.
isArray
(
impressions
))
{
impressions
=
[];
impressions
=
[];
}
}
...
@@ -24,11 +26,11 @@ export class ImpressionsStore {
...
@@ -24,11 +26,11 @@ export class ImpressionsStore {
if
(
impressions
.
length
>
50
)
{
if
(
impressions
.
length
>
50
)
{
impressions
.
pop
();
impressions
.
pop
();
}
}
store
.
set
(
"dashboard_impressions"
,
JSON
.
stringify
(
impressions
));
store
.
set
(
impressionsKey
,
JSON
.
stringify
(
impressions
));
}
}
getDashboardOpened
()
{
getDashboardOpened
()
{
var
impressions
=
store
.
get
(
"dashboard_impressions"
)
||
"[]"
;
var
impressions
=
store
.
get
(
this
.
impressionKey
(
config
)
)
||
"[]"
;
impressions
=
JSON
.
parse
(
impressions
);
impressions
=
JSON
.
parse
(
impressions
);
...
@@ -38,6 +40,10 @@ export class ImpressionsStore {
...
@@ -38,6 +40,10 @@ export class ImpressionsStore {
return
impressions
;
return
impressions
;
}
}
impressionKey
(
config
)
{
return
"dashboard_impressions-"
+
config
.
bootData
.
user
.
orgId
;
}
}
}
var
impressions
=
new
ImpressionsStore
();
var
impressions
=
new
ImpressionsStore
();
...
...
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