mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
Dashboard: Implement Duplicate DashboardLink Feature (#26600)
* Dashboard: Implement duplicate dashboard link feature * Dashboard: Change duplicate and remove button types of DashboardLinks
This commit is contained in:
parent
cbe1d7b08c
commit
6aef1f84cb
@ -62,6 +62,10 @@ To change or update an existing dashboard link, follow this procedure.
|
|||||||
1. In Dashboard Settings, on the Links tab, click the existing link that you want to edit.
|
1. In Dashboard Settings, on the Links tab, click the existing link that you want to edit.
|
||||||
1. Change the settings and then click **Update**.
|
1. Change the settings and then click **Update**.
|
||||||
|
|
||||||
|
## Duplicate a dashboard link
|
||||||
|
|
||||||
|
To duplicate an existing dashboard link, click the duplicate icon next to the existing link that you want to duplicate.
|
||||||
|
|
||||||
## Delete a dashboard link
|
## Delete a dashboard link
|
||||||
|
|
||||||
To delete an existing dashboard link, click the red **X** next to the existing link that you want to delete.
|
To delete an existing dashboard link, click the trash icon next to the duplicate icon that you want to delete.
|
||||||
|
@ -74,6 +74,11 @@ export class DashLinksEditorCtrl {
|
|||||||
_.move(this.dashboard.links, index, index + dir);
|
_.move(this.dashboard.links, index, index + dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
duplicateLink(link: any, index: number) {
|
||||||
|
this.dashboard.links.splice(index, 0, link);
|
||||||
|
this.dashboard.updateSubmenuVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
deleteLink(index: number) {
|
deleteLink(index: number) {
|
||||||
this.dashboard.links.splice(index, 1);
|
this.dashboard.links.splice(index, 1);
|
||||||
this.dashboard.updateSubmenuVisibility();
|
this.dashboard.updateSubmenuVisibility();
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="link in ctrl.dashboard.links">
|
<tr ng-repeat="link in ctrl.dashboard.links track by $index">
|
||||||
<td class="pointer" ng-click="ctrl.editLink(link)">
|
<td class="pointer" ng-click="ctrl.editLink(link)">
|
||||||
<icon name="'external-link-alt'"></icon>
|
<icon name="'external-link-alt'"></icon>
|
||||||
{{ link.type }}
|
{{ link.type }}
|
||||||
@ -68,8 +68,13 @@
|
|||||||
<icon ng-click="ctrl.moveLink($index, 1)" ng-hide="$last" name="'arrow-down'"></icon>
|
<icon ng-click="ctrl.moveLink($index, 1)" ng-hide="$last" name="'arrow-down'"></icon>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 1%">
|
<td style="width: 1%">
|
||||||
<a ng-click="ctrl.deleteLink($index)" class="btn btn-danger btn-small" ng-hide="annotation.builtIn">
|
<a ng-click="ctrl.duplicateLink(link, $index)" class="btn">
|
||||||
<icon name="'times'" style="margin-bottom: 0;"></icon>
|
<icon name="'copy'" style="margin-bottom: 0;"></icon>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td style="width: 1%">
|
||||||
|
<a ng-click="ctrl.deleteLink($index)" class="btn" ng-hide="annotation.builtIn">
|
||||||
|
<icon name="'trash-alt'" style="margin-bottom: 0;"></icon>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user