<div ng-controller="ProxyRequestsController as vm">
    <div ng-if="!vm.selectedRequest">
        <h2>
            {{'Safelisted proxy requests' | translate}}
        </h2>
        <p>
            Urls that can be called using Wizdoms elevated api. Only Wizdom administrators can manage safelisted proxy requests.            <br />
            <br />
            Url examples:<br />
            https://graph.microsoft.com/beta/teams<br />
            https://graph.microsoft.com/v1.0/groups/{id}/team<br />
        </p>
        <ul class="list-group">
            <li class="list-group-item" ng-repeat="request in vm.requests">
                <div class="row">
                    <div class="col-xs-4">
                        <a href="" ng-click="vm.select(request)">{{request.url || '[No url]'}}</a>
                    </div>
                    <div class="col-xs-2">
                        {{request.method}}
                    </div>
                    <div class="col-xs-6">
                        <a href="" ng-click="vm.delete(request)" class="pull-right"><i class="glyphicon glyphicon-trash"></i> Delete</a>
                    </div>
                </div>
            </li>
        </ul>
        <button ng-hide="saving" type="button" ng-click="vm.create();" class="btn btn-default">{{'Create new' | translate}}</button>
    </div>
    <div ng-if="vm.selectedRequest" proxy-request-directive request="vm.selectedRequest"></div>
</div>