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
4fa4c275
Commit
4fa4c275
authored
Sep 04, 2018
by
Erik Sundell
Committed by
Daniel Lee
Sep 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload: Fixing link function in directive
parent
ef3beb1f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
public/app/features/dashboard/upload.ts
+3
-3
No files found.
public/app/features/dashboard/upload.ts
View file @
4fa4c275
import
coreModule
from
'app/core/core_module'
;
const
template
=
`
<input type="file" id="dashupload" name="dashupload" class="hide"/>
<input type="file" id="dashupload" name="dashupload" class="hide"
onchange="angular.element(this).scope().file_selected"
/>
<label class="btn btn-success" for="dashupload">
<i class="fa fa-upload"></i>
Upload .json File
...
...
@@ -16,7 +16,7 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
scope
:
{
onUpload
:
'&'
,
},
link
:
scope
=>
{
link
:
(
scope
,
elem
)
=>
{
function
file_selected
(
evt
)
{
const
files
=
evt
.
target
.
files
;
// FileList object
const
readerOnload
=
()
=>
{
...
...
@@ -52,7 +52,7 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
// Check for the various File API support.
if
(
wnd
.
File
&&
wnd
.
FileReader
&&
wnd
.
FileList
&&
wnd
.
Blob
)
{
// Something
document
.
getElementById
(
'dashupload'
)
.
addEventListener
(
'change'
,
file_selected
,
false
);
elem
[
0
]
.
addEventListener
(
'change'
,
file_selected
,
false
);
}
else
{
alertSrv
.
set
(
'Oops'
,
'Sorry, the HTML5 File APIs are not fully supported in this browser.'
,
'error'
);
}
...
...
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