mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
redesigning links editor
This commit is contained in:
parent
a69c260173
commit
9b9ac45295
@ -12,7 +12,7 @@
|
||||
<div class="empty-list-cta__title">
|
||||
There are no dashboard links added yet
|
||||
</div>
|
||||
<a ng-click="ctrl.addLinkMode()" class="empty-list-cta__button btn btn-xlarge btn-success">
|
||||
<a ng-click="ctrl.addLink()" class="empty-list-cta__button btn btn-xlarge btn-success">
|
||||
<i class="gicon gicon-dashboard-new"></i>
|
||||
Add Dashboard Link
|
||||
</a>
|
||||
@ -33,7 +33,7 @@
|
||||
<div ng-if="ctrl.dashboard.links.length > 0">
|
||||
<div class="page-action-bar">
|
||||
<div class="page-action-bar__spacer"></div>
|
||||
<a type="button" class="btn btn-success" ng-click="ctrl.addLinkMode()">
|
||||
<a type="button" class="btn btn-success" ng-click="ctrl.addLink()">
|
||||
<i class="fa fa-plus"></i> New</a>
|
||||
</div>
|
||||
<table class="filter-table filter-table--hover">
|
||||
@ -126,8 +126,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-success" ng-if="ctrl.mode == 'new'" ng-click="ctrl.addLink(link.type)">
|
||||
<i class="fa fa-plus"></i> Add</button>
|
||||
<button class="btn btn-success" ng-if="ctrl.mode == 'edit'" ng-click="ctrl.editLink()">
|
||||
<i class="fa fa-plus"></i> Edit</button>
|
||||
<button class="btn btn-success" ng-click="ctrl.saveLink()">
|
||||
<i class="fa fa-plus"></i>Save</button>
|
||||
</div>
|
||||
|
@ -30,26 +30,22 @@ export class DashLinkEditorCtrl {
|
||||
this.mode = 'list';
|
||||
}
|
||||
|
||||
addLinkMode() {
|
||||
this.mode = 'new';
|
||||
}
|
||||
|
||||
editLinkMode(index) {
|
||||
this.currentLink = index;
|
||||
this.mode = 'edit';
|
||||
}
|
||||
|
||||
addLink(type) {
|
||||
this.dashboard.links.push({ type: type, icon: 'external link' });
|
||||
//this.dashboard.updateSubmenuVisibility();
|
||||
addLink() {
|
||||
this.dashboard.links.push({ type: 'dashboard', icon: 'external link' });
|
||||
this.dashboard.updateSubmenuVisibility();
|
||||
this.updated();
|
||||
this.mode = 'list';
|
||||
this.mode = 'new';
|
||||
}
|
||||
|
||||
editLink(index) {
|
||||
|
||||
}
|
||||
|
||||
saveLink() {
|
||||
this.updated();
|
||||
this.backToList();
|
||||
}
|
||||
|
||||
moveLink(index, dir) {
|
||||
_.move(this.dashboard.links, index, index+dir);
|
||||
this.updated();
|
||||
|
Loading…
Reference in New Issue
Block a user