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