Path: blob/1.0-develop/resources/views/admin/api/index.blade.php
7460 views
@extends('layouts.admin')12@section('title')3Application API4@endsection56@section('content-header')7<h1>Application API<small>Control access credentials for managing this Panel via the API.</small></h1>8<ol class="breadcrumb">9<li><a href="{{ route('admin.index') }}">Admin</a></li>10<li class="active">Application API</li>11</ol>12@endsection1314@section('content')15<div class="row">16<div class="col-xs-12">17<div class="box box-primary">18<div class="box-header with-border">19<h3 class="box-title">Credentials List</h3>20<div class="box-tools">21<a href="{{ route('admin.api.new') }}" class="btn btn-sm btn-primary">Create New</a>22</div>23</div>24<div class="box-body table-responsive no-padding">25<table class="table table-hover">26<tr>27<th>Key</th>28<th>Memo</th>29<th>Last Used</th>30<th>Created</th>31<th></th>32</tr>33@foreach($keys as $key)34<tr>35<td><code>{{ $key->identifier }}{{ decrypt($key->token) }}</code></td>36<td>{{ $key->memo }}</td>37<td>38@if(!is_null($key->last_used_at))39@datetimeHuman($key->last_used_at)40@else41—42@endif43</td>44<td>@datetimeHuman($key->created_at)</td>45<td>46<a href="#" data-action="revoke-key" data-attr="{{ $key->identifier }}">47<i class="fa fa-trash-o text-danger"></i>48</a>49</td>50</tr>51@endforeach52</table>53</div>54</div>55</div>56</div>57@endsection5859@section('footer-scripts')60@parent61<script>62$(document).ready(function() {63$('[data-action="revoke-key"]').click(function (event) {64var self = $(this);65event.preventDefault();66swal({67type: 'error',68title: 'Revoke API Key',69text: 'Once this API key is revoked any applications currently using it will stop working.',70showCancelButton: true,71allowOutsideClick: true,72closeOnConfirm: false,73confirmButtonText: 'Revoke',74confirmButtonColor: '#d9534f',75showLoaderOnConfirm: true76}, function () {77$.ajax({78method: 'DELETE',79url: '/admin/api/revoke/' + self.data('attr'),80headers: {81'X-CSRF-TOKEN': '{{ csrf_token() }}'82}83}).done(function () {84swal({85type: 'success',86title: '',87text: 'API Key has been revoked.'88});89self.parent().parent().slideUp();90}).fail(function (jqXHR) {91console.error(jqXHR);92swal({93type: 'error',94title: 'Whoops!',95text: 'An error occurred while attempting to revoke this key.'96});97});98});99});100});101</script>102@endsection103104105