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
65cbcc06
Commit
65cbcc06
authored
Sep 12, 2018
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload: make the button text configurable
parent
11c45002
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
public/app/features/dashboard/upload.ts
+5
-1
No files found.
public/app/features/dashboard/upload.ts
View file @
65cbcc06
import
coreModule
from
'app/core/core_module'
;
import
coreModule
from
'app/core/core_module'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
angular
from
'angular'
;
const
template
=
`
const
template
=
`
<input type="file" id="dashupload" name="dashupload" class="hide" onchange="angular.element(this).scope().file_selected"/>
<input type="file" id="dashupload" name="dashupload" class="hide" onchange="angular.element(this).scope().file_selected"/>
<label class="btn btn-success" for="dashupload">
<label class="btn btn-success" for="dashupload">
<i class="fa fa-upload"></i>
<i class="fa fa-upload"></i>
Upload .json File
{{btnText}}
</label>
</label>
`
;
`
;
...
@@ -16,8 +17,11 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
...
@@ -16,8 +17,11 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
template
:
template
,
template
:
template
,
scope
:
{
scope
:
{
onUpload
:
'&'
,
onUpload
:
'&'
,
btnText
:
'@?'
,
},
},
link
:
(
scope
,
elem
)
=>
{
link
:
(
scope
,
elem
)
=>
{
scope
.
btnText
=
angular
.
isDefined
(
scope
.
btnText
)
?
scope
.
btnText
:
'Upload .json File'
;
function
file_selected
(
evt
)
{
function
file_selected
(
evt
)
{
const
files
=
evt
.
target
.
files
;
// FileList object
const
files
=
evt
.
target
.
files
;
// FileList object
const
readerOnload
=
()
=>
{
const
readerOnload
=
()
=>
{
...
...
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