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
b752cfee
Commit
b752cfee
authored
Nov 24, 2017
by
Patrick O'Carroll
Committed by
Torkel Ödegaard
Nov 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrated four files to ts, addd some code to config to make it work (#9980)
parent
8ce05a7c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
81 deletions
+70
-81
public/app/core/config.ts
+4
-0
public/app/core/controllers/invited_ctrl.ts
+8
-11
public/app/core/controllers/login_ctrl.ts
+13
-16
public/app/features/dashboard/shareModalCtrl.ts
+9
-16
public/app/features/panel/solo_panel_ctrl.ts
+36
-38
No files found.
public/app/core/config.ts
View file @
b752cfee
...
@@ -17,6 +17,10 @@ class Settings {
...
@@ -17,6 +17,10 @@ class Settings {
alertingEnabled
:
boolean
;
alertingEnabled
:
boolean
;
authProxyEnabled
:
boolean
;
authProxyEnabled
:
boolean
;
ldapEnabled
:
boolean
;
ldapEnabled
:
boolean
;
oauth
:
any
;
disableUserSignUp
:
boolean
;
loginHint
:
any
;
loginError
:
any
;
constructor
(
options
)
{
constructor
(
options
)
{
var
defaults
=
{
var
defaults
=
{
...
...
public/app/core/controllers/invited_ctrl.
j
s
→
public/app/core/controllers/invited_ctrl.
t
s
View file @
b752cfee
define
([
import
coreModule
from
'../core_module'
;
'angular'
,
import
config
from
'app/core/config'
;
'../core_module'
,
'app/core/config'
,
],
function
(
angular
,
coreModule
,
config
)
{
'use strict'
;
config
=
config
.
default
;
export
class
InvitedCtrl
{
coreModule
.
default
.
controller
(
'InvitedCtrl'
,
function
(
$scope
,
$routeParams
,
contextSrv
,
backendSrv
)
{
/** @ngInject */
constructor
(
$scope
,
$routeParams
,
contextSrv
,
backendSrv
)
{
contextSrv
.
sidemenu
=
false
;
contextSrv
.
sidemenu
=
false
;
$scope
.
formModel
=
{};
$scope
.
formModel
=
{};
...
@@ -35,6 +31,7 @@ function (angular, coreModule, config) {
...
@@ -35,6 +31,7 @@ function (angular, coreModule, config) {
};
};
$scope
.
init
();
$scope
.
init
();
}
}
});
coreModule
.
controller
(
'InvitedCtrl'
,
InvitedCtrl
);
});
public/app/core/controllers/login_ctrl.
j
s
→
public/app/core/controllers/login_ctrl.
t
s
View file @
b752cfee
define
([
import
_
from
'lodash'
;
'angular'
,
import
coreModule
from
'../core_module'
;
'lodash'
,
import
config
from
'app/core/config'
;
'../core_module'
,
'app/core/config'
,
export
class
LoginCtrl
{
],
function
(
angular
,
_
,
coreModule
,
config
)
{
/** @ngInject */
'use strict'
;
constructor
(
$scope
,
backendSrv
,
contextSrv
,
$location
)
{
config
=
config
.
default
;
coreModule
.
default
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
backendSrv
,
contextSrv
,
$location
)
{
$scope
.
formModel
=
{
$scope
.
formModel
=
{
user
:
''
,
user
:
''
,
email
:
''
,
email
:
''
,
...
@@ -74,8 +70,7 @@ function (angular, _, coreModule, config) {
...
@@ -74,8 +70,7 @@ function (angular, _, coreModule, config) {
if
(
params
.
redirect
&&
params
.
redirect
[
0
]
===
'/'
)
{
if
(
params
.
redirect
&&
params
.
redirect
[
0
]
===
'/'
)
{
window
.
location
.
href
=
config
.
appSubUrl
+
params
.
redirect
;
window
.
location
.
href
=
config
.
appSubUrl
+
params
.
redirect
;
}
}
else
if
(
result
.
redirectUrl
)
{
else
if
(
result
.
redirectUrl
)
{
window
.
location
.
href
=
result
.
redirectUrl
;
window
.
location
.
href
=
result
.
redirectUrl
;
}
else
{
}
else
{
window
.
location
.
href
=
config
.
appSubUrl
+
'/'
;
window
.
location
.
href
=
config
.
appSubUrl
+
'/'
;
...
@@ -84,5 +79,7 @@ function (angular, _, coreModule, config) {
...
@@ -84,5 +79,7 @@ function (angular, _, coreModule, config) {
};
};
$scope
.
init
();
$scope
.
init
();
});
}
});
}
coreModule
.
controller
(
'LoginCtrl'
,
LoginCtrl
);
public/app/features/dashboard/shareModalCtrl.
j
s
→
public/app/features/dashboard/shareModalCtrl.
t
s
View file @
b752cfee
define
([
'angular'
,
import
angular
from
'angular'
;
'lodash'
,
import
moment
from
'moment'
;
'jquery'
,
import
config
from
'app/core/config'
;
'moment'
,
'app/core/config'
,
],
function
(
angular
,
_
,
$
,
moment
,
config
)
{
'use strict'
;
config
=
config
.
default
;
export
class
ShareModalCtrl
{
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'ShareModalCtrl'
,
function
(
$scope
,
$rootScope
,
$location
,
$timeout
,
timeSrv
,
templateSrv
,
linkSrv
)
{
/** @ngInject */
constructor
(
$scope
,
$rootScope
,
$location
,
$timeout
,
timeSrv
,
templateSrv
,
linkSrv
)
{
$scope
.
options
=
{
forCurrent
:
true
,
includeTemplateVars
:
true
,
theme
:
'current'
};
$scope
.
options
=
{
forCurrent
:
true
,
includeTemplateVars
:
true
,
theme
:
'current'
};
$scope
.
editor
=
{
index
:
$scope
.
tabIndex
||
0
};
$scope
.
editor
=
{
index
:
$scope
.
tabIndex
||
0
};
...
@@ -93,7 +86,7 @@ function (angular, _, $, moment, config) {
...
@@ -93,7 +86,7 @@ function (angular, _, $, moment, config) {
$scope
.
getShareUrl
=
function
()
{
$scope
.
getShareUrl
=
function
()
{
return
$scope
.
shareUrl
;
return
$scope
.
shareUrl
;
};
};
}
}
});
angular
.
module
(
'grafana.controllers'
).
controller
(
'ShareModalCtrl'
,
ShareModalCtrl
);
});
public/app/features/panel/solo_panel_ctrl.
j
s
→
public/app/features/panel/solo_panel_ctrl.
t
s
View file @
b752cfee
define
([
import
angular
from
'angular'
;
'angular'
,
import
$
from
'jquery'
;
'jquery'
,
],
function
(
angular
,
$
)
{
"use strict"
;
var
module
=
angular
.
module
(
'grafana.routes'
);
export
class
SoloPanelCtrl
{
module
.
controller
(
'SoloPanelCtrl'
,
function
(
$scope
,
$routeParams
,
$location
,
dashboardLoaderSrv
,
contextSrv
)
{
/** @ngInject */
constructor
(
$scope
,
$routeParams
,
$location
,
dashboardLoaderSrv
,
contextSrv
)
{
var
panelId
;
var
panelId
;
$scope
.
init
=
function
()
{
$scope
.
init
=
function
()
{
contextSrv
.
sidemenu
=
false
;
contextSrv
.
sidemenu
=
false
;
var
params
=
$location
.
search
();
panelId
=
parseInt
(
params
.
panelId
);
var
params
=
$location
.
search
();
$scope
.
onAppEvent
(
"dashboard-initialized"
,
$scope
.
initPanelScope
);
panelId
=
parseInt
(
params
.
panelId
);
$scope
.
onAppEvent
(
"dashboard-initialized"
,
$scope
.
initPanelScope
);
dashboardLoaderSrv
.
loadDashboard
(
$routeParams
.
type
,
$routeParams
.
slug
).
then
(
function
(
result
)
{
result
.
meta
.
soloMode
=
true
;
$scope
.
initDashboard
(
result
,
$scope
);
});
};
dashboardLoaderSrv
.
loadDashboard
(
$routeParams
.
type
,
$routeParams
.
slug
).
then
(
function
(
result
)
{
$scope
.
initPanelScope
=
function
()
{
result
.
meta
.
soloMode
=
true
;
var
panelInfo
=
$scope
.
dashboard
.
getPanelInfoById
(
panelId
);
$scope
.
initDashboard
(
result
,
$scope
);
});
};
$scope
.
initPanelScope
=
function
()
{
// fake row ctrl scope
var
panelInfo
=
$scope
.
dashboard
.
getPanelInfoById
(
panelId
);
$scope
.
ctrl
=
{
row
:
panelInfo
.
row
,
dashboard
:
$scope
.
dashboard
,
};
// fake row ctrl scope
$scope
.
ctrl
.
row
.
height
=
$
(
window
).
height
();
$scope
.
ctrl
=
{
$scope
.
panel
=
panelInfo
.
panel
;
row
:
panelInfo
.
row
,
$scope
.
$index
=
0
;
dashboard
:
$scope
.
dashboard
,
};
$scope
.
ctrl
.
row
.
height
=
$
(
window
).
height
();
if
(
!
$scope
.
panel
)
{
$scope
.
panel
=
panelInfo
.
panel
;
$scope
.
appEvent
(
'alert-error'
,
[
'Panel not found'
,
''
]);
$scope
.
$index
=
0
;
return
;
}
if
(
!
$scope
.
panel
)
{
$scope
.
panel
.
span
=
12
;
$scope
.
appEvent
(
'alert-error'
,
[
'Panel not found'
,
''
]);
};
return
;
}
$scope
.
panel
.
span
=
12
;
$scope
.
init
();
};
}
}
$scope
.
init
();
angular
.
module
(
'grafana.routes'
).
controller
(
'SoloPanelCtrl'
,
SoloPanelCtrl
);
});
});
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