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
1dc581bd
Commit
1dc581bd
authored
Nov 18, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(gettingstarted): progress on getting started panel, #6466
parent
fd512457
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
44 deletions
+85
-44
public/app/features/dashboard/row/row_model.ts
+1
-0
public/app/plugins/panel/gettingstarted/module.html
+4
-23
public/app/plugins/panel/gettingstarted/module.ts
+79
-19
public/app/plugins/panel/pluginlist/module.ts
+1
-2
No files found.
public/app/features/dashboard/row/row_model.ts
View file @
1dc581bd
...
@@ -19,6 +19,7 @@ export class DashboardRow {
...
@@ -19,6 +19,7 @@ export class DashboardRow {
showTitle
:
false
,
showTitle
:
false
,
titleSize
:
'h6'
,
titleSize
:
'h6'
,
height
:
250
,
height
:
250
,
isNew
:
false
,
repeat
:
null
,
repeat
:
null
,
repeatRowId
:
null
,
repeatRowId
:
null
,
repeatIteration
:
null
,
repeatIteration
:
null
,
...
...
public/app/plugins/panel/gettingstarted/module.html
View file @
1dc581bd
...
@@ -7,29 +7,10 @@
...
@@ -7,29 +7,10 @@
</button>
</button>
</h6>
</h6>
<ul
class=
"progress-tracker"
>
<ul
class=
"progress-tracker"
>
<li
class=
"progress-step completed"
>
<li
class=
"progress-step"
ng-repeat=
"step in ctrl.steps"
ng-class=
"step.cssClass"
>
<span
class=
"progress-marker"
><i
class=
"icon-gf icon-gf-check"
></i></span>
<span
class=
"progress-marker"
><i
class=
"{{step.icon}}"
></i></span>
<span
class=
"progress-text"
>
Install Grafana
</span>
<span
class=
"progress-text"
>
{{step.title}}
</span>
</li>
<a
class=
"btn progress-step-cta"
ng-href=
"{{step.href}}"
>
{{step.cta}}
</a>
<li
class=
"progress-step"
ng-class=
"ctrl.getStateClass(2)"
>
<span
class=
"progress-marker"
><i
class=
"icon-gf icon-gf-datasources"
></i></span>
<span
class=
"progress-text"
>
Create your first data source
</span>
<a
class=
"btn progress-step-cta"
href=
"datasources/new?gettingstarted"
>
Add Data Source
</a>
</li>
<li
class=
"progress-step"
ng-class=
"ctrl.getStateClass(3)"
>
<span
class=
"progress-marker"
><i
class=
"icon-gf icon-gf-dashboard"
></i></span>
<span
class=
"progress-text"
>
Create your first dashboard.
</span>
<a
class=
"btn progress-step-cta"
href=
"dashboard/new?gettingstarted"
>
New Dashboard
</a>
</li>
<li
class=
"progress-step"
>
<span
class=
"progress-marker"
><i
class=
"icon-gf icon-gf-users"
></i></span>
<span
class=
"progress-text"
>
Invite your team.
</span>
<a
class=
"btn progress-step-cta"
href=
"org/users?gettingstarted"
>
Invite Users
</a>
</li>
<li
class=
"progress-step"
>
<span
class=
"progress-marker"
><i
class=
"icon-gf icon-gf-apps"
></i></span>
<span
class=
"progress-text"
>
Install apps
&
plugins
</span>
<a
class=
"btn progress-step-cta"
href=
"https://grafana.net/plugins?utm_source=grafana_getting_started"
>
Explore Plugins
</a>
</li>
</li>
</ul>
</ul>
</div>
</div>
...
...
public/app/plugins/panel/gettingstarted/module.ts
View file @
1dc581bd
...
@@ -7,10 +7,11 @@ import {contextSrv} from 'app/core/core';
...
@@ -7,10 +7,11 @@ import {contextSrv} from 'app/core/core';
class
GettingStartedPanelCtrl
extends
PanelCtrl
{
class
GettingStartedPanelCtrl
extends
PanelCtrl
{
static
templateUrl
=
'public/app/plugins/panel/gettingstarted/module.html'
;
static
templateUrl
=
'public/app/plugins/panel/gettingstarted/module.html'
;
checksDone
:
boolean
;
checksDone
:
boolean
;
step
:
number
;
stepIndex
:
number
;
steps
:
any
;
/** @ngInject **/
/** @ngInject **/
constructor
(
$scope
,
$injector
,
private
backendSrv
,
private
datasourceSrv
)
{
constructor
(
$scope
,
$injector
,
private
backendSrv
,
private
datasourceSrv
,
private
$q
)
{
super
(
$scope
,
$injector
);
super
(
$scope
,
$injector
);
/* tslint:disable */
/* tslint:disable */
...
@@ -20,32 +21,91 @@ class GettingStartedPanelCtrl extends PanelCtrl {
...
@@ -20,32 +21,91 @@ class GettingStartedPanelCtrl extends PanelCtrl {
}
}
/* tslint:enable */
/* tslint:enable */
var
datasources
=
datasourceSrv
.
getMetricSources
().
filter
(
item
=>
{
this
.
stepIndex
=
0
;
return
item
.
meta
.
builtIn
===
false
;
this
.
steps
=
[];
this
.
steps
.
push
({
title
:
'Install Grafana'
,
icon
:
'icon-gf icon-gf-check'
,
check
:
()
=>
$q
.
when
(
true
),
});
this
.
steps
.
push
({
title
:
'Create your first data source'
,
cta
:
'Add data source'
,
icon
:
'icon-gf icon-gf-datasources'
,
href
:
'datasources/new?gettingstarted'
,
check
:
()
=>
{
return
$q
.
when
(
datasourceSrv
.
getMetricSources
().
filter
(
item
=>
{
return
item
.
meta
.
builtIn
===
false
;
}).
length
>
0
);
}
});
this
.
steps
.
push
({
title
:
'Create your first dashboard'
,
cta
:
'New dashboard'
,
icon
:
'icon-gf icon-gf-dashboard'
,
href
:
'dashboard/new?gettingstarted'
,
check
:
()
=>
{
return
this
.
backendSrv
.
search
({
limit
:
1
}).
then
(
result
=>
{
return
result
.
length
>
0
;
});
}
});
this
.
steps
.
push
({
title
:
'Invite your team'
,
cta
:
'Add Users'
,
icon
:
'icon-gf icon-gf-users'
,
href
:
'org/users?gettingstarted'
,
check
:
()
=>
{
return
this
.
backendSrv
.
get
(
'api/org/users'
).
then
(
res
=>
{
return
res
.
length
>
1
;
});
}
});
});
this
.
step
=
2
;
if
(
datasources
.
length
===
0
)
{
this
.
checksDone
=
true
;
return
;
}
this
.
step
=
3
;
this
.
steps
.
push
({
this
.
backendSrv
.
search
({
limit
:
1
}).
then
(
result
=>
{
title
:
'Install apps & plugins'
,
if
(
result
.
length
===
0
)
{
cta
:
'Explore plugin repository'
,
this
.
checksDone
=
true
;
icon
:
'icon-gf icon-gf-apps'
,
return
;
href
:
'https://grafana.net/plugins?utm_source=grafana_getting_started'
,
check
:
()
=>
{
return
this
.
backendSrv
.
get
(
'api/plugins'
,
{
embedded
:
0
,
core
:
0
}).
then
(
plugins
=>
{
return
plugins
.
length
>
0
;
});
}
}
});
}
this
.
step
=
4
;
$onInit
()
{
this
.
stepIndex
=
-
1
;
return
this
.
nextStep
().
then
(
res
=>
{
this
.
checksDone
=
true
;
this
.
checksDone
=
true
;
console
.
log
(
this
.
steps
);
});
});
}
}
getStateClass
(
step
)
{
nextStep
()
{
if
(
step
===
this
.
step
)
{
return
'active'
;
}
if
(
this
.
stepIndex
===
this
.
steps
.
length
-
1
)
{
if
(
step
<
this
.
step
)
{
return
'completed'
;
}
return
this
.
$q
.
when
();
return
''
;
}
this
.
stepIndex
+=
1
;
var
currentStep
=
this
.
steps
[
this
.
stepIndex
];
return
currentStep
.
check
().
then
(
passed
=>
{
if
(
passed
)
{
currentStep
.
cssClass
=
'completed'
;
return
this
.
nextStep
();
}
currentStep
.
cssClass
=
'active'
;
return
this
.
$q
.
when
();
});
}
}
dismiss
()
{
dismiss
()
{
...
...
public/app/plugins/panel/pluginlist/module.ts
View file @
1dc581bd
...
@@ -11,8 +11,7 @@ class PluginListCtrl extends PanelCtrl {
...
@@ -11,8 +11,7 @@ class PluginListCtrl extends PanelCtrl {
viewModel
:
any
;
viewModel
:
any
;
// Set and populate defaults
// Set and populate defaults
panelDefaults
=
{
panelDefaults
=
{};
};
/** @ngInject */
/** @ngInject */
constructor
(
$scope
,
$injector
,
private
backendSrv
,
private
$location
)
{
constructor
(
$scope
,
$injector
,
private
backendSrv
,
private
$location
)
{
...
...
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