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 {
this
.
$rootScope
.
appEvent
(
'dashboard-saved'
,
this
.
dash
);
this
.
$rootScope
.
appEvent
(
'alert-success'
,
[
'Dashboard saved'
]);
return
this
.
dash
;
}
save
(
clone
,
options
)
{
...
...
public/app/features/dashboard/save_modal.ts
View file @
77843623
...
...
@@ -4,47 +4,47 @@ import coreModule from 'app/core/core_module';
const
template
=
`
<div class="modal-body">
<div class="modal-header">
<h2 class="modal-header-title">
<i class="fa fa-save"></i>
<span class="p-l-1">Save changes</span>
</h2>
<div class="modal-header">
<h2 class="modal-header-title">
<i class="fa fa-save"></i>
<span class="p-l-1">Save changes</span>
</h2>
<a class="modal-header-close" ng-click="ctrl.dismiss();">
<i class="fa fa-remove"></i>
</a>
</div>
<a class="modal-header-close" ng-click="ctrl.dismiss();">
<i class="fa fa-remove"></i>
</a>
</div>
<form name="ctrl.saveForm" ng-submit="ctrl.save()" class="modal-content" novalidate>
<h6 class="text-center">Add a note to describe your changes</h6>
<div class="p-t-2">
<div class="gf-form">
<label class="gf-form-hint">
<input
type="text"
name="message"
class="gf-form-input"
placeholder="Updates to …"
give-focus="true"
ng-model="ctrl.message"
ng-model-options="{allowInvalid: true}"
ng-maxlength="this.max"
autocomplete="off" />
<small class="gf-form-hint-text muted" ng-cloak>
<span ng-class="{'text-error': ctrl.saveForm.message.$invalid && ctrl.saveForm.message.$dirty }">
{{ctrl.message.length || 0}}
</span>
/ {{ctrl.max}} characters
</small>
</label>
</div>
</div>
<form name="ctrl.saveForm" ng-submit="ctrl.save()" class="modal-content" novalidate>
<h6 class="text-center">Add a note to describe your changes</h6>
<div class="p-t-2">
<div class="gf-form">
<label class="gf-form-hint">
<input
type="text"
name="message"
class="gf-form-input"
placeholder="Updates to …"
give-focus="true"
ng-model="ctrl.message"
ng-model-options="{allowInvalid: true}"
ng-maxlength="this.max"
autocomplete="off" />
<small class="gf-form-hint-text muted" ng-cloak>
<span ng-class="{'text-error': ctrl.saveForm.message.$invalid && ctrl.saveForm.message.$dirty }">
{{ctrl.message.length || 0}}
</span>
/ {{ctrl.max}} characters
</small>
</label>
</div>
</div>
<div class="gf-form-button-row text-center">
<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>
</div>
</form>
<div class="gf-form-button-row text-center">
<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>
</div>
</form>
</div>
`
;
...
...
public/app/features/dashboard/settings/settings.ts
View file @
77843623
...
...
@@ -128,9 +128,19 @@ export class SettingsCtrl {
makeEditable
()
{
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 refresh whole page
// Force dashboard reload after saving to update view
appEvents
.
on
(
'dashboard-saved'
,
()
=>
{
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