export(): moved to share modal

This commit is contained in:
Torkel Ödegaard 2016-05-17 21:18:47 +02:00
parent df50fa2332
commit 05d064ca8d
5 changed files with 66 additions and 73 deletions

View File

@ -30,12 +30,12 @@
</li>
<li>
<a class="pointer" ng-click="shareDashboard(1)">
<i class="icon-gf icon-gf-snapshot"></i>Snapshot sharing
<i class="icon-gf icon-gf-snapshot"></i>Snapshot
</a>
</li>
<li>
<a class="pointer" ng-click="shareExport()">
<i class="fa fa-cloud-upload"></i>Export for sharing
<a class="pointer" ng-click="shareDashboard(2)">
<i class="fa fa-cloud-upload"></i>Export
</a>
</li>
</ul>
@ -49,8 +49,6 @@
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('settings');">Settings</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('annotations');">Annotations</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('templating');">Templating</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="exportDashboard();">Export</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="editJson();">View JSON</a></li>
<li ng-if="contextSrv.isEditor && !dashboard.editable"><a class="pointer" ng-click="makeEditable();">Make Editable</a></li>
<li ng-if="contextSrv.isEditor"><a class="pointer" ng-click="saveDashboardAs();">Save As...</a></li>
<li ng-if="dashboardMeta.canSave"><a class="pointer" ng-click="deleteDashboard();">Delete dashboard</a></li>

View File

@ -59,12 +59,6 @@ export class DashNavCtrl {
$scope.shareDashboard(1);
};
$scope.shareExport = function() {
$scope.appEvent('show-modal', {
templateHtml: '<dash-export-modal></dash-export-modal>',
});
};
$scope.openSearch = function() {
$scope.appEvent('show-dash-search');
};

View File

@ -1,25 +1,20 @@
<div class="modal-body">
<div class="modal-header">
<h2 class="modal-header-title">
<i class="fa fa-cloud-upload"></i>
<span class="p-l-1">Export Dashboard</span>
</h2>
<a class="modal-header-close" ng-click="dismiss();">
<i class="fa fa-remove"></i>
</a>
</div>
<div class="modal-content" ng-cloak>
<!-- <p> -->
<!-- Exporting will export a cleaned sharable dashboard that can be imported -->
<!-- into another Grafana instance. -->
<!-- </p> -->
<h3 class="section-heading">
Options
</h3>
<div class="share-modal-big-icon">
<i class="fa fa-cloud-upload"></i>
</div>
<div class="share-snapshot-header">
<p class="share-snapshot-info-text">
Export the dashboard to a JSON file. The exporter will templatize the
dashboard's data sources to make it easy for other's to to import and reuse.
You can share dashboards on <a class="external-link" href="https://grafana.net">Grafana.net</a>
</p>
</div>
<div class="gf-form-group">
<div class="gf-form">
@ -62,5 +57,3 @@
</div>
</div>
</div>

View File

@ -45,6 +45,10 @@
</div>
</script>
<script type="text/ng-template" id="shareExport.html">
<dash-export-modal></dash-export-modal>
</script>
<script type="text/ng-template" id="shareLinkOptions.html">
<div class="gf-form-group section">
<gf-form-switch class="gf-form"

View File

@ -22,11 +22,15 @@ function (angular, _, require, config) {
$scope.modalTitle = 'Share Panel';
$scope.tabs.push({title: 'Embed', src: 'shareEmbed.html'});
} else {
$scope.modalTitle = 'Share Dashboard';
$scope.modalTitle = 'Share';
}
if (!$scope.dashboard.meta.isSnapshot) {
$scope.tabs.push({title: 'Snapshot sharing', src: 'shareSnapshot.html'});
$scope.tabs.push({title: 'Snapshot', src: 'shareSnapshot.html'});
}
if (!$scope.dashboard.meta.isSnapshot) {
$scope.tabs.push({title: 'Export', src: 'shareExport.html'});
}
$scope.buildUrl();