mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(dashboard): minor fixes
This commit is contained in:
parent
366650e1ae
commit
3fc6f6d730
@ -28,15 +28,15 @@ function (coreModule) {
|
|||||||
|
|
||||||
coreModule.default.controller('NewDashboardCtrl', function($scope) {
|
coreModule.default.controller('NewDashboardCtrl', function($scope) {
|
||||||
$scope.initDashboard({
|
$scope.initDashboard({
|
||||||
meta: { canStar: false, canShare: false },
|
meta: { canStar: false, canShare: false, isNew: true },
|
||||||
dashboard: {
|
dashboard: {
|
||||||
title: "New dashboard",
|
title: "New dashboard",
|
||||||
|
isNew: true,
|
||||||
rows: [
|
rows: [
|
||||||
{
|
{
|
||||||
title: 'Dashboard Row',
|
title: 'Dashboard Row',
|
||||||
height: '250px',
|
height: '250px',
|
||||||
panels:[],
|
panels:[],
|
||||||
isNew: true,
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -65,15 +65,14 @@ export class DashboardModel {
|
|||||||
this.links = data.links || [];
|
this.links = data.links || [];
|
||||||
this.gnetId = data.gnetId || null;
|
this.gnetId = data.gnetId || null;
|
||||||
|
|
||||||
if (this.id === null) {
|
|
||||||
this.editMode = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateSchema(data);
|
this.updateSchema(data);
|
||||||
this.initMeta(meta);
|
this.initMeta(meta);
|
||||||
|
|
||||||
|
this.editMode = this.meta.isNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
private initMeta(meta) {
|
private initMeta(meta) {
|
||||||
|
console.log(meta);
|
||||||
meta = meta || {};
|
meta = meta || {};
|
||||||
|
|
||||||
meta.canShare = meta.canShare !== false;
|
meta.canShare = meta.canShare !== false;
|
||||||
|
@ -19,7 +19,7 @@ export class DashRowCtrl {
|
|||||||
constructor(private $scope, private $rootScope, private $timeout, private uiSegmentSrv, private $q) {
|
constructor(private $scope, private $rootScope, private $timeout, private uiSegmentSrv, private $q) {
|
||||||
this.row.title = this.row.title || 'Row title';
|
this.row.title = this.row.title || 'Row title';
|
||||||
|
|
||||||
if (this.row.isNew) {
|
if (this.dashboard.meta.isNew) {
|
||||||
this.dropView = 1;
|
this.dropView = 1;
|
||||||
delete this.row.isNew;
|
delete this.row.isNew;
|
||||||
}
|
}
|
||||||
|
@ -353,9 +353,9 @@ div.flot-text {
|
|||||||
.dash-row-add-panel {
|
.dash-row-add-panel {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: $panel-margin*2;
|
padding: $panel-margin*2;
|
||||||
display: flex;
|
// display: flex;
|
||||||
align-items: flex-start;
|
// align-items: flex-start;
|
||||||
position: relative;
|
// position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-panel-panels-scroll {
|
.add-panel-panels-scroll {
|
||||||
|
Loading…
Reference in New Issue
Block a user