<div ng-controller="GraphiteImportCtrl" ng-init="init()">
  <h5>Import dashboards from graphite web</h5>

  <div class="editor-row">
    <div class="section">
      <div class="btn-group">
        <button class="btn btn-info dropdown-toggle" data-toggle="dropdown" bs-tooltip="'Datasource'">{{datasource.name}} <span class="caret"></span></button>

        <ul class="dropdown-menu" role="menu">
          <li ng-repeat="datasource in datasources" role="menuitem">
            <a ng-click="setDatasource(datasource.value);">{{datasource.name}}</a>
          </li>
        </ul>
      </div>
      <button ng-click="listAll()" class="btn btn-success">List all dashboards</button>
    </div>
  </div>

  <div class="editor-row" style="margin-top: 10px;max-height: 400px; overflow-y: scroll;max-width: 500px;">
    <table class="grafana-options-table">
      <tr ng-repeat="dash in dashboards">
        <td style="">{{dash.name}}</td>
				<td style="padding-left: 20px;">
					<a class="pointer" ng-click="import(dash.name)">
						import
					</a>
				</td>
      </tr>
    </table>
  </div>

  <div ng-show="error" style="margin-top: 20px" class="alert alert-error">
    {{error}}
  </div>
</div>
