diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go index 53519631d22..0057f78ff0d 100644 --- a/pkg/api/dtos/models.go +++ b/pkg/api/dtos/models.go @@ -28,9 +28,9 @@ type CurrentUser struct { } type DashboardMeta struct { - IsStarred bool `json:"isStarred"` - IsHome bool `json:"isHome"` - IsSnapshot bool `json:"isSnapshot"` + IsStarred bool `json:"isStarred,omitempty"` + IsHome bool `json:"isHome,omitempty"` + IsSnapshot bool `json:"isSnapshot,omitempty"` Slug string `json:"slug"` Expires time.Time `json:"expires"` Created time.Time `json:"created"` diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js index 1064892745b..73a36ed3da8 100644 --- a/public/app/features/dashboard/dashboardSrv.js +++ b/public/app/features/dashboard/dashboardSrv.js @@ -52,24 +52,20 @@ function (angular, $, kbn, _, moment) { p._initMeta = function(meta) { meta = meta || {}; - meta.canShare = true; - meta.canSave = true; - meta.canEdit = true; - meta.canStar = true; + + meta.canShare = meta.canShare === false ? false : true; + meta.canSave = meta.canSave === false ? false : true; + meta.canEdit = meta.canEdit === false ? false : true; + meta.canStar = meta.canStar === false ? false : true; + meta.canDelete = meta.canDelete === false ? false : true; if (contextSrv.hasRole('Viewer')) { meta.canSave = false; } - if (meta.isSnapshot) { - meta.canSave = false; - } - - if (meta.isHome) { - meta.canShare = false; - meta.canStar = false; - meta.canSave = false; + if (!this.editable) { meta.canEdit = false; + meta.canDelete = false; } this.meta = meta; diff --git a/public/app/features/dashboard/partials/dashboardTopNav.html b/public/app/features/dashboard/partials/dashboardTopNav.html index 784185837e8..711fb1f34ba 100644 --- a/public/app/features/dashboard/partials/dashboardTopNav.html +++ b/public/app/features/dashboard/partials/dashboardTopNav.html @@ -27,19 +27,19 @@
  • -
  • +
  • - diff --git a/public/app/partials/dasheditor.html b/public/app/partials/dasheditor.html index e6ab6070f9f..fefded81efc 100644 --- a/public/app/partials/dasheditor.html +++ b/public/app/partials/dasheditor.html @@ -17,63 +17,118 @@ -
    - -
    -
    -
    -
    - -
    -
    - - -
    - - +
    +
    +
    +
    +
    Dashboard info
    +
    +
      +
    • + Title +
    • +
    • + +
    • +
    • + Tags + Press enter to a add tag +
    • +
    • + + +
    • +
    +
    +
    +
      +
    • + Timezone +
    • +
    • + +
    • +
    +
    +
    +
    -
    -
    -
    - - - - Press enter to a add tag -
    + +
    +
    Toggles
    +
    +
      +
    • + +
    • +
    • +
    • + + +
    • + +
    +
    +
    +
    +
      +
    • + +
    • +
    • + + +
    • +
    +
    +
    +
    +
      +
    • + +
    • +
    • + + +
    • +
    +
    - -
    -
    -
    - - - - - - - -
    - {{row.title}} - - - - -
    -
    -
    -
    - -
    - - -
    -
    -
    +
    +
    +
    + + + + + + + +
    + {{row.title}} + + + + +
    +
    +
    +
    +
    + +
    + + +
    + +
    + +