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
2d0f5f06
Commit
2d0f5f06
authored
Dec 19, 2017
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashfolders: support creating new folder when saving a dashboard. #10197
parent
7f9c0df4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
public/app/features/dashboard/save_as_modal.ts
+14
-2
No files found.
public/app/features/dashboard/save_as_modal.ts
View file @
2d0f5f06
...
@@ -22,13 +22,16 @@ const template = `
...
@@ -22,13 +22,16 @@ const template = `
<div class="gf-form">
<div class="gf-form">
<folder-picker initial-folder-id="ctrl.folderId"
<folder-picker initial-folder-id="ctrl.folderId"
on-change="ctrl.onFolderChange($folder)"
on-change="ctrl.onFolderChange($folder)"
enter-folder-creation="ctrl.onEnterFolderCreation()"
exit-folder-creation="ctrl.onExitFolderCreation()"
enable-create-new="true"
label-class="width-7">
label-class="width-7">
</folder-picker>
</folder-picker>
</div>
</div>
</div>
</div>
<div class="gf-form-button-row text-center">
<div class="gf-form-button-row text-center">
<button type="submit" class="btn btn-success" ng-disabled="ctrl.saveForm.$invalid">Save</button>
<button type="submit" class="btn btn-success" ng-disabled="ctrl.saveForm.$invalid
|| !ctrl.isValidFolderSelection
">Save</button>
<a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a>
<a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a>
</div>
</div>
</form>
</form>
...
@@ -38,6 +41,7 @@ const template = `
...
@@ -38,6 +41,7 @@ const template = `
export
class
SaveDashboardAsModalCtrl
{
export
class
SaveDashboardAsModalCtrl
{
clone
:
any
;
clone
:
any
;
folderId
:
any
;
folderId
:
any
;
isValidFolderSelection
=
true
;
dismiss
:
()
=>
void
;
dismiss
:
()
=>
void
;
/** @ngInject */
/** @ngInject */
...
@@ -68,8 +72,16 @@ export class SaveDashboardAsModalCtrl {
...
@@ -68,8 +72,16 @@ export class SaveDashboardAsModalCtrl {
return
this
.
dashboardSrv
.
save
(
this
.
clone
).
then
(
this
.
dismiss
);
return
this
.
dashboardSrv
.
save
(
this
.
clone
).
then
(
this
.
dismiss
);
}
}
onEnterFolderCreation
()
{
this
.
isValidFolderSelection
=
false
;
}
onExitFolderCreation
()
{
this
.
isValidFolderSelection
=
true
;
}
keyDown
(
evt
)
{
keyDown
(
evt
)
{
if
(
evt
.
keyCode
===
13
)
{
if
(
this
.
isValidFolderSelection
&&
evt
.
keyCode
===
13
)
{
this
.
save
();
this
.
save
();
}
}
}
}
...
...
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