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
e26cd210
Commit
e26cd210
authored
Jan 19, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted ctrl to typescript
parent
6e99eed4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
50 deletions
+26
-50
public/app/core/routes/all.js
+2
-1
public/app/features/snapshot/all.js
+0
-3
public/app/features/snapshot/all.ts
+1
-0
public/app/features/snapshot/partials/snapshots.html
+3
-3
public/app/features/snapshot/snapshot_ctrl.js
+0
-43
public/app/features/snapshot/snapshot_ctrl.ts
+20
-0
No files found.
public/app/core/routes/all.js
View file @
e26cd210
...
...
@@ -134,7 +134,8 @@ define([
})
.
when
(
'/dashboard/snapshots'
,
{
templateUrl
:
'app/features/snapshot/partials/snapshots.html'
,
controller
:
'SnapshotsCtrl'
controller
:
'SnapshotsCtrl'
,
controllerAs
:
'ctrl'
,
})
.
when
(
'/apps'
,
{
templateUrl
:
'app/features/apps/partials/list.html'
,
...
...
public/app/features/snapshot/all.js
deleted
100644 → 0
View file @
6e99eed4
define
([
'./snapshot_ctrl'
,
],
function
()
{});
public/app/features/snapshot/all.ts
0 → 100644
View file @
e26cd210
import
'./snapshot_ctrl'
;
public/app/features/snapshot/partials/snapshots.html
View file @
e26cd210
<navbar
icon=
"fa fa-fw fa-camera-retro"
title=
"Dashboard snapshots"
></navbar>
<div
class=
"page-container"
>
<div
class=
"page-wide"
>
<div
class=
"page-wide"
ng-init=
"ctrl.init()"
>
<h2>
Available snapshots
</h2>
...
...
@@ -14,7 +14,7 @@
</thead>
<tr
ng-repeat=
"snapshot in snapshots"
>
<tr
ng-repeat=
"snapshot in
ctrl.
snapshots"
>
<td>
<a
href=
"dashboard/snapshot/{{snapshot.Key}}"
>
{{snapshot.Name}}
</a>
</td>
...
...
@@ -28,7 +28,7 @@
</a>
</td>
<td
class=
"text-right"
>
<a
ng-click=
"removeSnapshot(snapshot)"
class=
"btn btn-danger btn-mini"
>
<a
ng-click=
"
ctrl.
removeSnapshot(snapshot)"
class=
"btn btn-danger btn-mini"
>
<i
class=
"fa fa-remove"
></i>
</a>
</td>
...
...
public/app/features/snapshot/snapshot_ctrl.js
deleted
100644 → 0
View file @
6e99eed4
define
([
'angular'
,
'lodash'
],
function
(
angular
,
_
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'SnapshotsCtrl'
,
function
(
$scope
,
$location
,
backendSrv
)
{
backendSrv
.
get
(
'/api/dashboard/snapshots'
)
.
then
(
function
(
result
)
{
$scope
.
snapshots
=
result
;
});
$scope
.
removeSnapshotConfirmed
=
function
(
snapshot
)
{
_
.
remove
(
$scope
.
snapshots
,
{
Key
:
snapshot
.
Key
});
backendSrv
.
get
(
'/api/snapshots-delete/'
+
snapshot
.
DeleteKey
)
.
then
(
function
()
{
$scope
.
appEvent
(
'alert-success'
,
[
'Snapshot deleted'
,
''
]);
},
function
()
{
$scope
.
appEvent
(
'alert-error'
,
[
'Unable to delete snapshot'
,
''
]);
$scope
.
snapshots
.
push
(
snapshot
);
});
};
$scope
.
removeSnapshot
=
function
(
snapshot
)
{
$scope
.
appEvent
(
'confirm-modal'
,
{
title
:
'Confirm delete snapshot'
,
text
:
'Are you sure you want to delete snapshot '
+
snapshot
.
Name
+
'?'
,
yesText
:
"Delete"
,
icon
:
"fa-warning"
,
onConfirm
:
function
()
{
$scope
.
removeSnapshotConfirmed
(
snapshot
);
}
});
};
});
});
public/app/features/snapshot/snapshot_ctrl.ts
0 → 100644
View file @
e26cd210
///<reference path="../../headers/common.d.ts" />
import
angular
from
'angular'
;
import
_
from
'lodash'
;
export
class
SnapshotsCtrl
{
snapshots
:
any
[];
/** @ngInject */
constructor
(
private
backendSrv
:
any
)
{}
init
()
{
this
.
backendSrv
.
get
(
'/api/dashboard/snapshots'
).
then
(
snapshots
=>
{
this
.
snapshots
=
snapshots
;
});
console
.
log
(
this
.
snapshots
);
}
}
angular
.
module
(
'grafana.controllers'
).
controller
(
'SnapshotsCtrl'
,
SnapshotsCtrl
);
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