<div ng-controller="GraphiteImportCtrl" ng-init="init()">

	<div ng-if="datasources.length > 0">
		<h2 class="page-heading">Load dashboard from Graphite-Web</h2>

		<div class="gf-form-group">
			<div class="gf-form-inline">
				<div class="gf-form">
					<span class="gf-form-label width-10">Data source</span>
				</div>
				<div class="gf-form">
					<div class="gf-form-select-wrapper">
						<select type="text" ng-model="options.sourceName" class="gf-form-input gf-size-auto" ng-options="f for f in datasources">
						</select>
					</div>
				</div>
				<div class="gf-form">
					<button class="btn btn-success pull-right" ng-click="listAll()">List dashboards</button>
				</div>
			</div>
		</div>

		<table class="grafana-options-table" style="margin-top: 20px;">
			<tr ng-repeat="dash in dashboards">
				<td style="">{{dash.name}}</td>
				<td>
					<button class="btn btn-inverse pull-right" ng-click="import(dash.name)">
						Load
					</button>
				</td>
			</tr>
		</table>

	</div>
</div>
