2019-01-09 15:18:46 +00:00
|
|
|
<div class="container">
|
2011-09-30 15:55:14 +00:00
|
|
|
|
2019-01-09 15:18:46 +00:00
|
|
|
<br>
|
2011-09-30 15:55:14 +00:00
|
|
|
<?php if($this->session->flashdata('notice')) { ?>
|
2019-06-21 20:33:21 +00:00
|
|
|
<div class="alert alert-success" role="alert">
|
|
|
|
<?php echo $this->session->flashdata('notice'); ?>
|
|
|
|
</div>
|
2011-09-30 15:55:14 +00:00
|
|
|
<?php } ?>
|
|
|
|
|
2020-10-20 14:51:55 +00:00
|
|
|
<h2><?php echo $page_title; ?></h2>
|
|
|
|
|
2019-01-09 15:18:46 +00:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-header">
|
2020-10-20 14:51:55 +00:00
|
|
|
API Keys
|
2019-01-09 15:18:46 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2020-10-28 18:03:30 +00:00
|
|
|
<p class="card-text">The Cloudlog API (Application Programming Interface) lets third party systems access Cloudlog in a controlled way. Access to the API is managed via API keys.</p>
|
2020-10-20 14:51:55 +00:00
|
|
|
<p class="card-text">You will need to generate an API key for each tool you wish to use (e.g. CloudlogCAT). Generate a read-write key if the application needs to send data to Cloudlog. Generate a read-only key if the application only needs to obtain data from Cloudlog.</p>
|
|
|
|
<p class="card-text"><span class="badge badge-info">Info</span> It's good practice to delete a key if you are no longer using the associated application.</p>
|
2019-01-09 15:18:46 +00:00
|
|
|
|
|
|
|
<?php if ($api_keys->num_rows() > 0) { ?>
|
|
|
|
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">API Key</th>
|
2019-07-09 16:18:19 +00:00
|
|
|
<th scope="col">Description</th>
|
2019-01-09 15:18:46 +00:00
|
|
|
<th scope="col">Rights</th>
|
|
|
|
<th scope="col">Status</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($api_keys->result() as $row) { ?>
|
|
|
|
<tr>
|
2020-10-26 08:58:49 +00:00
|
|
|
<td><i class="fas fa-key"></i> <?php echo $row->key; ?></td>
|
2019-07-09 16:18:19 +00:00
|
|
|
<td><?php echo $row->description; ?></td>
|
2019-01-09 15:18:46 +00:00
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if($row->rights == "rw") {
|
|
|
|
echo "Read & Write";
|
|
|
|
} elseif($row->rights == "r") {
|
|
|
|
echo "Read Only";
|
|
|
|
} else {
|
|
|
|
echo "Unknown";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
</td>
|
2019-06-21 20:33:21 +00:00
|
|
|
<td><span class="badge badge-pill badge-light"><?php echo ucfirst($row->status); ?></span>
|
2019-07-09 16:18:19 +00:00
|
|
|
|
|
|
|
<a href="<?php echo site_url('api/edit'); ?>/<?php echo $row->key; ?>" class="btn btn-outline-primary btn-sm">Edit</a>
|
|
|
|
|
2019-06-21 20:33:21 +00:00
|
|
|
<a href="<?php echo site_url('api/auth/'.$row->key); ?>" target="_blank" class="btn btn-primary btn-sm">Test</a>
|
|
|
|
|
|
|
|
<a href="<?php echo site_url('api/delete/'.$row->key); ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want delete API Key <?php echo $row->key; ?>?');">Delete</a>
|
|
|
|
</td>
|
2019-01-09 15:18:46 +00:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
<p>You have no API Keys.</p>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<p>
|
2020-10-26 08:58:49 +00:00
|
|
|
<a href="<?php echo site_url('api/generate/rw'); ?>" class="btn btn-primary "><i class="fas fa-plus"></i> Create a read & write key</a>
|
|
|
|
<a href="<?php echo site_url('api/generate/r'); ?>" class="btn btn-primary"><i class="fas fa-plus"></i> Create a read-only key</a>
|
2019-01-09 15:18:46 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2011-09-30 15:55:14 +00:00
|
|
|
|
|
|
|
</div>
|
2019-01-09 15:18:46 +00:00
|
|
|
|