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
aa4b593d
Commit
aa4b593d
authored
Mar 15, 2019
by
Hugo Häggmark
Committed by
Hugo Häggmark
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Cleaning up implicit anys in app.ts
progress: #14714
parent
1db7913a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
38 deletions
+48
-38
public/app/app.ts
+48
-38
No files found.
public/app/app.ts
View file @
aa4b593d
...
@@ -17,12 +17,13 @@ import 'vendor/angular-other/angular-strap';
...
@@ -17,12 +17,13 @@ import 'vendor/angular-other/angular-strap';
import
$
from
'jquery'
;
import
$
from
'jquery'
;
import
angular
from
'angular'
;
import
angular
from
'angular'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
// @ts-ignore ignoring this for now, otherwise we would have to extend _ interface with move
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
addClassIfNoOverlayScrollbar
}
from
'app/core/utils/scrollbar'
;
import
{
addClassIfNoOverlayScrollbar
}
from
'app/core/utils/scrollbar'
;
// add move to lodash for backward compatabiltiy
// add move to lodash for backward compatabiltiy
_
.
move
=
(
array
,
fromIndex
,
toIndex
)
=>
{
_
.
move
=
(
array
:
[],
fromIndex
:
number
,
toIndex
:
number
)
=>
{
array
.
splice
(
toIndex
,
0
,
array
.
splice
(
fromIndex
,
1
)[
0
]);
array
.
splice
(
toIndex
,
0
,
array
.
splice
(
fromIndex
,
1
)[
0
]);
return
array
;
return
array
;
};
};
...
@@ -36,7 +37,7 @@ import 'app/features/all';
...
@@ -36,7 +37,7 @@ import 'app/features/all';
// import symlinked extensions
// import symlinked extensions
const
extensionsIndex
=
(
require
as
any
).
context
(
'.'
,
true
,
/extensions
\/
index.ts/
);
const
extensionsIndex
=
(
require
as
any
).
context
(
'.'
,
true
,
/extensions
\/
index.ts/
);
extensionsIndex
.
keys
().
forEach
(
key
=>
{
extensionsIndex
.
keys
().
forEach
(
(
key
:
any
)
=>
{
extensionsIndex
(
key
);
extensionsIndex
(
key
);
});
});
...
@@ -52,7 +53,7 @@ export class GrafanaApp {
...
@@ -52,7 +53,7 @@ export class GrafanaApp {
this
.
ngModuleDependencies
=
[];
this
.
ngModuleDependencies
=
[];
}
}
useModule
(
module
)
{
useModule
(
module
:
angular
.
IModule
)
{
if
(
this
.
preBootModules
)
{
if
(
this
.
preBootModules
)
{
this
.
preBootModules
.
push
(
module
);
this
.
preBootModules
.
push
(
module
);
}
else
{
}
else
{
...
@@ -67,40 +68,49 @@ export class GrafanaApp {
...
@@ -67,40 +68,49 @@ export class GrafanaApp {
moment
.
locale
(
config
.
bootData
.
user
.
locale
);
moment
.
locale
(
config
.
bootData
.
user
.
locale
);
app
.
config
((
$locationProvider
,
$controllerProvider
,
$compileProvider
,
$filterProvider
,
$httpProvider
,
$provide
)
=>
{
app
.
config
(
// pre assing bindings before constructor calls
(
$compileProvider
.
preAssignBindingsEnabled
(
true
);
$locationProvider
:
angular
.
ILocationProvider
,
$controllerProvider
:
angular
.
IControllerProvider
,
if
(
config
.
buildInfo
.
env
!==
'development'
)
{
$compileProvider
:
angular
.
ICompileProvider
,
$compileProvider
.
debugInfoEnabled
(
false
);
$filterProvider
:
angular
.
IFilterProvider
,
}
$httpProvider
:
angular
.
IHttpProvider
,
$provide
:
angular
.
auto
.
IProvideService
$httpProvider
.
useApplyAsync
(
true
);
)
=>
{
// pre assing bindings before constructor calls
this
.
registerFunctions
.
controller
=
$controllerProvider
.
register
;
$compileProvider
.
preAssignBindingsEnabled
(
true
);
this
.
registerFunctions
.
directive
=
$compileProvider
.
directive
;
this
.
registerFunctions
.
factory
=
$provide
.
factory
;
if
(
config
.
buildInfo
.
env
!==
'development'
)
{
this
.
registerFunctions
.
service
=
$provide
.
service
;
$compileProvider
.
debugInfoEnabled
(
false
);
this
.
registerFunctions
.
filter
=
$filterProvider
.
register
;
}
$provide
.
decorator
(
'$http'
,
[
$httpProvider
.
useApplyAsync
(
true
);
'$delegate'
,
'$templateCache'
,
this
.
registerFunctions
.
controller
=
$controllerProvider
.
register
;
(
$delegate
,
$templateCache
)
=>
{
this
.
registerFunctions
.
directive
=
$compileProvider
.
directive
;
const
get
=
$delegate
.
get
;
this
.
registerFunctions
.
factory
=
$provide
.
factory
;
$delegate
.
get
=
(
url
,
config
)
=>
{
this
.
registerFunctions
.
service
=
$provide
.
service
;
if
(
url
.
match
(
/
\.
html$/
))
{
this
.
registerFunctions
.
filter
=
$filterProvider
.
register
;
// some template's already exist in the cache
if
(
!
$templateCache
.
get
(
url
))
{
$provide
.
decorator
(
'$http'
,
[
url
+=
'?v='
+
new
Date
().
getTime
();
'$delegate'
,
'$templateCache'
,
(
$delegate
:
any
,
$templateCache
:
any
)
=>
{
const
get
=
$delegate
.
get
;
$delegate
.
get
=
(
url
:
string
,
config
:
any
)
=>
{
if
(
url
.
match
(
/
\.
html$/
))
{
// some template's already exist in the cache
if
(
!
$templateCache
.
get
(
url
))
{
url
+=
'?v='
+
new
Date
().
getTime
();
}
}
}
}
return
get
(
url
,
config
);
return
get
(
url
,
config
)
;
}
;
}
;
return
$delegate
;
return
$delegate
;
},
},
]);
]);
}
}
);
);
this
.
ngModuleDependencies
=
[
this
.
ngModuleDependencies
=
[
'grafana.core'
,
'grafana.core'
,
...
@@ -116,7 +126,7 @@ export class GrafanaApp {
...
@@ -116,7 +126,7 @@ export class GrafanaApp {
];
];
// makes it possible to add dynamic stuff
// makes it possible to add dynamic stuff
_
.
each
(
angularModules
,
m
=>
{
_
.
each
(
angularModules
,
(
m
:
angular
.
IModule
)
=>
{
this
.
useModule
(
m
);
this
.
useModule
(
m
);
});
});
...
@@ -129,7 +139,7 @@ export class GrafanaApp {
...
@@ -129,7 +139,7 @@ export class GrafanaApp {
// bootstrap the app
// bootstrap the app
angular
.
bootstrap
(
document
,
this
.
ngModuleDependencies
).
invoke
(()
=>
{
angular
.
bootstrap
(
document
,
this
.
ngModuleDependencies
).
invoke
(()
=>
{
_
.
each
(
this
.
preBootModules
,
module
=>
{
_
.
each
(
this
.
preBootModules
,
(
module
:
angular
.
IModule
)
=>
{
_
.
extend
(
module
,
this
.
registerFunctions
);
_
.
extend
(
module
,
this
.
registerFunctions
);
});
});
...
...
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