1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-10 23:53:31 -05:00
shimapan/public/views/panel/api.html

76 lines
3.8 KiB
HTML
Raw Normal View History

2017-10-21 17:47:55 -04:00
<div class="inner" ng-controller="ApiController" ng-init="getKeys();parseScope()">
2017-10-18 17:14:25 -04:00
<div class="keys">
2017-10-21 15:10:24 -04:00
<div class="key" ng-repeat="key in keys" ng-click="$parent.showKeyInfo(key)">
2017-10-18 17:14:25 -04:00
<i class="fa fa-key"></i>
<span>{{key.identifier}}</span>
2017-10-18 13:31:08 -04:00
</div>
2017-10-21 15:10:24 -04:00
<div class="key add-key" ng-hide="keys.length >= 10" ng-click="showNewKey()">
2017-10-18 13:31:08 -04:00
<i class="fa fa-plus"></i>
<span>Create</span>
</div>
</div>
2017-10-21 15:10:24 -04:00
<div class="modal" style="{{kModalShow?'display:block':'display:none'}}">
<div class="modal-sandbox" ng-click="hideKeyInfo()"></div>
<div class="modal-box">
<div class="modal-header">
<h1>Key Info:&emsp;<span class="key-name">{{currKey.identifier}}</span></h1>
<div class="close-modal" ng-click="hideKeyInfo()"><i class="fa fa-times"></i></div>
</div>
<div class="modal-body">
<p>API Key:</p>
<pre>{{currKey.key}}</pre>
<br/>
<p>This key can be used with any 3rd party program or service to upload to and manage your account
with Shimapan.</p>
<p>For example, it can be used in a bash script to upload from the command line:</p>
2017-10-23 14:14:12 -04:00
<pre>APIKEY=[Your API Key Here]<br/>URL=$(curl -s -F "apikey=$APIKEY" -F "file=@$1" https://shimapan.rocks/api/upload | grep -Po '"'"url"'"\s*:\s*"\K([^"]*)'<br/>echo $URL</pre>
2017-10-21 15:10:24 -04:00
<br/>
2017-10-21 17:47:55 -04:00
<p>Key Permissions:</p>
<table>
<tr ng-repeat="(prefix, perms) in currKey.scopeObj">
<th>{{prefix}}:</th>
<td ng-repeat="perm in perms">
<span ng-bind="perm.name"></span>
</td>
</tr>
</table>
<br/>
2017-10-21 15:10:24 -04:00
<p>If your key is compromised, it can be used to upload and modify your account without your knowledge.
If it is lost or compromised, you can delete the key below, but be warned that this <em>cannot</em>
be undone.</p>
</div>
<div class="modal-footer">
<button class="btn-del" ng-click="deleteKey(currKey)">Delete Key</button>
<button class="btn-close" ng-click="hideKeyInfo()">Close</button>
</div>
</div>
2017-10-21 15:10:24 -04:00
</div>
<div class="modal" style="{{nModalShow?'display:block':'display:none'}}">
<div class="modal-sandbox" ng-click="hideNewKey()"></div>
2017-10-21 17:47:55 -04:00
<div class="modal-box" id="createKey">
2017-10-21 15:10:24 -04:00
<div class="modal-header">
<h1>Create a Key</h1>
<div class="close-modal" ng-click="hideNewKey()"><i class="fa fa-times"></i></div>
</div>
<div class="modal-body">
2017-10-21 17:47:55 -04:00
<p>Identifier to describe the purpose/use of this key:</p>
<input id="identifier" placeholder="Identifier" class="form-control" type="text" ng-model="currKeyIdentifier"/>
2017-10-21 15:10:24 -04:00
<br/>
2017-10-21 17:47:55 -04:00
<p>Permissions the key should have:</p>
<table>
<tr ng-repeat="(prefix, perms) in scopeObj">
<th>{{prefix}}:</th>
<td ng-repeat="perm in perms">
2018-01-15 10:11:05 -05:00
<input type="checkbox" title="{{perm.name}}" name="{{perm.name}}" ng-model="perm.isChecked" ng-change="updateCurrKeyPerm(prefix, perm)"/>
2017-10-21 17:47:55 -04:00
<label for="{{perm.name}}" ng-bind="perm.name"></label>
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button ng-click="createKey()">Create</button>
<button ng-click="hideNewKey()">Cancel</button>
2017-10-21 15:10:24 -04:00
</div>
</div>
</div>
2017-10-18 13:31:08 -04:00
</div>