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
77843623
Commit
77843623
authored
Dec 26, 2017
by
Alexander Zobnin
Committed by
Torkel Ödegaard
Dec 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't save dashboard on make editable, #10236
parent
d4ff603e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
40 deletions
+52
-40
public/app/features/dashboard/dashboard_srv.ts
+2
-0
public/app/features/dashboard/save_modal.ts
+38
-38
public/app/features/dashboard/settings/settings.ts
+12
-2
No files found.
public/app/features/dashboard/dashboard_srv.ts
View file @
77843623
...
@@ -80,6 +80,8 @@ export class DashboardSrv {
...
@@ -80,6 +80,8 @@ export class DashboardSrv {
this
.
$rootScope
.
appEvent
(
'dashboard-saved'
,
this
.
dash
);
this
.
$rootScope
.
appEvent
(
'dashboard-saved'
,
this
.
dash
);
this
.
$rootScope
.
appEvent
(
'alert-success'
,
[
'Dashboard saved'
]);
this
.
$rootScope
.
appEvent
(
'alert-success'
,
[
'Dashboard saved'
]);
return
this
.
dash
;
}
}
save
(
clone
,
options
)
{
save
(
clone
,
options
)
{
...
...
public/app/features/dashboard/save_modal.ts
View file @
77843623
...
@@ -4,47 +4,47 @@ import coreModule from 'app/core/core_module';
...
@@ -4,47 +4,47 @@ import coreModule from 'app/core/core_module';
const
template
=
`
const
template
=
`
<div class="modal-body">
<div class="modal-body">
<div class="modal-header">
<div class="modal-header">
<h2 class="modal-header-title">
<h2 class="modal-header-title">
<i class="fa fa-save"></i>
<i class="fa fa-save"></i>
<span class="p-l-1">Save changes</span>
<span class="p-l-1">Save changes</span>
</h2>
</h2>
<a class="modal-header-close" ng-click="ctrl.dismiss();">
<a class="modal-header-close" ng-click="ctrl.dismiss();">
<i class="fa fa-remove"></i>
<i class="fa fa-remove"></i>
</a>
</a>
</div>
</div>
<form name="ctrl.saveForm" ng-submit="ctrl.save()" class="modal-content" novalidate>
<form name="ctrl.saveForm" ng-submit="ctrl.save()" class="modal-content" novalidate>
<h6 class="text-center">Add a note to describe your changes</h6>
<h6 class="text-center">Add a note to describe your changes</h6>
<div class="p-t-2">
<div class="p-t-2">
<div class="gf-form">
<div class="gf-form">
<label class="gf-form-hint">
<label class="gf-form-hint">
<input
<input
type="text"
type="text"
name="message"
name="message"
class="gf-form-input"
class="gf-form-input"
placeholder="Updates to …"
placeholder="Updates to …"
give-focus="true"
give-focus="true"
ng-model="ctrl.message"
ng-model="ctrl.message"
ng-model-options="{allowInvalid: true}"
ng-model-options="{allowInvalid: true}"
ng-maxlength="this.max"
ng-maxlength="this.max"
autocomplete="off" />
autocomplete="off" />
<small class="gf-form-hint-text muted" ng-cloak>
<small class="gf-form-hint-text muted" ng-cloak>
<span ng-class="{'text-error': ctrl.saveForm.message.$invalid && ctrl.saveForm.message.$dirty }">
<span ng-class="{'text-error': ctrl.saveForm.message.$invalid && ctrl.saveForm.message.$dirty }">
{{ctrl.message.length || 0}}
{{ctrl.message.length || 0}}
</span>
</span>
/ {{ctrl.max}} characters
/ {{ctrl.max}} characters
</small>
</small>
</label>
</label>
</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">Save</button>
<button class="btn btn-inverse" ng-click="ctrl.dismiss();">Cancel</button>
<button class="btn btn-inverse" ng-click="ctrl.dismiss();">Cancel</button>
</div>
</div>
</form>
</form>
</div>
</div>
`
;
`
;
...
...
public/app/features/dashboard/settings/settings.ts
View file @
77843623
...
@@ -128,9 +128,19 @@ export class SettingsCtrl {
...
@@ -128,9 +128,19 @@ export class SettingsCtrl {
makeEditable
()
{
makeEditable
()
{
this
.
dashboard
.
editable
=
true
;
this
.
dashboard
.
editable
=
true
;
this
.
dashboard
.
meta
.
canMakeEditable
=
false
;
this
.
dashboard
.
meta
.
canEdit
=
true
;
this
.
dashboard
.
meta
.
canSave
=
true
;
this
.
canDelete
=
true
;
this
.
viewId
=
'settings'
;
this
.
buildSectionList
();
const
currentSection
=
_
.
find
(
this
.
sections
,
{
id
:
this
.
viewId
});
this
.
$location
.
url
(
currentSection
.
url
);
this
.
onRouteUpdated
();
return
this
.
dashboardSrv
.
saveDashboard
({
makeEditable
:
true
,
overwrite
:
false
}).
then
(()
=>
{
// Force dashboard reload after saving to update view
// force refresh whole page
appEvents
.
on
(
'dashboard-saved'
,
()
=>
{
window
.
location
.
href
=
window
.
location
.
href
;
window
.
location
.
href
=
window
.
location
.
href
;
});
});
}
}
...
...
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