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
c8ead227
Commit
c8ead227
authored
Dec 01, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started on dashboard settings refactor
parent
e871e565
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
9 deletions
+83
-9
public/app/core/directives/dash_class.js
+4
-0
public/app/core/directives/dash_edit_link.js
+0
-1
public/app/features/dashboard/all.ts
+2
-2
public/app/features/dashboard/dashnav/dashnav.ts
+0
-2
public/app/features/dashboard/settings/settings.html
+27
-0
public/app/features/dashboard/settings/settings.ts
+47
-0
public/app/features/dashboard/submenu/submenu.html
+0
-1
public/app/partials/dashboard.html
+3
-3
No files found.
public/app/core/directives/dash_class.js
View file @
c8ead227
...
...
@@ -34,6 +34,10 @@ function (_, $, coreModule) {
$scope
.
$watch
(
'ctrl.playlistSrv.isPlaying'
,
function
(
newValue
)
{
elem
.
toggleClass
(
'playlist-active'
,
newValue
===
true
);
});
$scope
.
$watch
(
'ctrl.dashboardViewState.state.editView'
,
function
(
newValue
)
{
elem
.
toggleClass
(
'dashboard-settings-open'
,
_
.
isString
(
newValue
));
});
}
};
});
...
...
public/app/core/directives/dash_edit_link.js
View file @
c8ead227
...
...
@@ -13,7 +13,6 @@ function ($, angular, coreModule, _) {
'templating'
:
{
src
:
'public/app/features/templating/partials/editor.html'
},
'history'
:
{
html
:
'<gf-dashboard-history dashboard="dashboard"></gf-dashboard-history>'
},
'timepicker'
:
{
src
:
'public/app/features/dashboard/timepicker/dropdown.html'
},
'add-panel'
:
{
html
:
'<add-panel></add-panel>'
},
'import'
:
{
html
:
'<dash-import dismiss="dismiss()"></dash-import>'
,
isModal
:
true
},
'permissions'
:
{
html
:
'<dash-acl-modal dismiss="dismiss()"></dash-acl-modal>'
,
isModal
:
true
},
'new-folder'
:
{
...
...
public/app/features/dashboard/all.ts
View file @
c8ead227
...
...
@@ -27,8 +27,8 @@ import './acl/acl';
import
'./folder_picker/picker'
;
import
'./folder_modal/folder'
;
import
'./move_to_folder_modal/move_to_folder'
;
import
coreModule
from
'app/core/core_module
'
;
import
'./settings/settings
'
;
import
coreModule
from
'app/core/core_module'
;
import
{
DashboardListCtrl
}
from
'./dashboard_list_ctrl'
;
coreModule
.
controller
(
'DashboardListCtrl'
,
DashboardListCtrl
);
public/app/features/dashboard/dashnav/dashnav.ts
View file @
c8ead227
///<reference path="../../../headers/common.d.ts" />
import
_
from
'lodash'
;
import
moment
from
'moment'
;
import
angular
from
'angular'
;
...
...
public/app/features/dashboard/settings/settings.html
0 → 100644
View file @
c8ead227
<h2>
Settings
</h2>
<div
class=
"edit-tab-with-sidemenu"
>
<aside
class=
"edit-sidemenu-aside"
>
<ul
class=
"edit-sidemenu"
>
<li
ng-class=
"{active: ctrl.viewId === section.id}"
ng-repeat=
"section in ctrl.sections"
>
<a
ng-click=
"ctrl.viewId = section.id"
>
{{::section.title}}
</a>
</li>
</ul>
</aside>
<div
class=
"edit-tab-content"
ng-if=
"ctrl.viewId === 'general'"
>
general
</div>
<div
class=
"edit-tab-content"
ng-if=
"ctrl.viewId === 'annotations'"
>
annotations
</div>
<div
class=
"edit-tab-content"
ng-if=
"ctrl.viewId === 'templating'"
>
annotations
</div>
</div>
public/app/features/dashboard/settings/settings.ts
0 → 100644
View file @
c8ead227
import
{
coreModule
,
appEvents
}
from
'app/core/core'
;
import
{
DashboardModel
}
from
'../dashboard_model'
;
export
class
SettingsCtrl
{
dashboard
:
DashboardModel
;
isOpen
:
boolean
;
viewId
:
string
;
sections
:
any
[]
=
[
{
title
:
'General'
,
id
:
'general'
},
{
title
:
'Annotations'
,
id
:
'annotations'
},
{
title
:
'Templating'
,
id
:
'templating'
},
{
title
:
'Versions'
,
id
:
'versions'
},
];
/** @ngInject */
constructor
(
$scope
,
private
$location
,
private
$rootScope
)
{
appEvents
.
on
(
'hide-dash-editor'
,
this
.
hideSettings
.
bind
(
this
),
$scope
);
var
urlParams
=
this
.
$location
.
search
();
this
.
viewId
=
urlParams
.
editview
;
}
hideSettings
()
{
var
urlParams
=
this
.
$location
.
search
();
delete
urlParams
.
editview
;
setTimeout
(()
=>
{
this
.
$rootScope
.
$apply
(()
=>
{
this
.
$location
.
search
(
urlParams
);
});
});
}
}
export
function
dashboardSettings
()
{
return
{
restrict
:
'E'
,
templateUrl
:
'public/app/features/dashboard/settings/settings.html'
,
controller
:
SettingsCtrl
,
bindToController
:
true
,
controllerAs
:
'ctrl'
,
transclude
:
true
,
scope
:
{
dashboard
:
"="
}
};
}
coreModule
.
directive
(
'dashboardSettings'
,
dashboardSettings
);
public/app/features/dashboard/submenu/submenu.html
View file @
c8ead227
<div
class=
"submenu-controls"
>
<div
ng-repeat=
"variable in ctrl.variables"
ng-hide=
"variable.hide === 2"
class=
"submenu-item gf-form-inline"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label template-variable"
ng-hide=
"variable.hide === 1"
>
...
...
public/app/partials/dashboard.html
View file @
c8ead227
...
...
@@ -2,15 +2,15 @@
<dashnav
dashboard=
"ctrl.dashboard"
></dashnav>
<div
class=
"scroll-canvas scroll-canvas--dashboard"
grafana-scrollbar
>
<d
iv
dash-editor-view
class=
"dash-edit-view"
></div
>
<
div
class=
"dashboard-container"
>
<d
ashboard-settings
dashboard=
"ctrl.dashboard"
ng-if=
"ctrl.dashboardViewState.state.editview"
>
<
/dashboard-settings
>
<div
class=
"dashboard-container"
>
<dashboard-submenu
ng-if=
"ctrl.dashboard.meta.submenuEnabled"
dashboard=
"ctrl.dashboard"
>
</dashboard-submenu>
<dashboard-grid
get-panel-container=
"ctrl.getPanelContainer"
>
</dashboard-grid>
</div>
</div>
</div>
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