Merge pull request #114 from kevgliss/clipboard

Add clipboard functionality
This commit is contained in:
kevgliss 2015-10-05 16:14:16 -07:00
commit 73cb8da8c1
6 changed files with 126 additions and 96 deletions

View File

@ -31,7 +31,8 @@
"satellizer": "~0.9.4", "satellizer": "~0.9.4",
"angularjs-toaster": "~0.4.14", "angularjs-toaster": "~0.4.14",
"ngletteravatar": "~3.0.1", "ngletteravatar": "~3.0.1",
"angular-ui-router": "~0.2.15" "angular-ui-router": "~0.2.15",
"angular-clipboard": "~1.1.1"
}, },
"devDependencies": { "devDependencies": {
"angular-mocks": "~1.3", "angular-mocks": "~1.3",

View File

@ -72,7 +72,6 @@ gulp.task('dev:styles', function () {
}; };
var fileList = [ var fileList = [
'lemur/static/app/styles/lemur.css',
'bower_components/bootswatch/sandstone/bootswatch.less', 'bower_components/bootswatch/sandstone/bootswatch.less',
'bower_components/fontawesome/css/font-awesome.css', 'bower_components/fontawesome/css/font-awesome.css',
'bower_components/angular-spinkit/src/angular-spinkit.css', 'bower_components/angular-spinkit/src/angular-spinkit.css',
@ -81,7 +80,8 @@ gulp.task('dev:styles', function () {
'bower_components/angular-ui-switch/angular-ui-switch.css', 'bower_components/angular-ui-switch/angular-ui-switch.css',
'bower_components/angular-wizard/dist/angular-wizard.css', 'bower_components/angular-wizard/dist/angular-wizard.css',
'bower_components/ng-table/ng-table.css', 'bower_components/ng-table/ng-table.css',
'bower_components/angularjs-toaster/toaster.css' 'bower_components/angularjs-toaster/toaster.css',
'lemur/static/app/styles/lemur.css'
]; ];
return gulp.src(fileList) return gulp.src(fileList)

View File

@ -14,7 +14,8 @@ var lemur = angular
'uiSwitch', 'uiSwitch',
'mgo-angular-wizard', 'mgo-angular-wizard',
'satellizer', 'satellizer',
'ngLetterAvatar' 'ngLetterAvatar',
'angular-clipboard'
]) ])
.config(function ($stateProvider, $urlRouterProvider, $authProvider) { .config(function ($stateProvider, $urlRouterProvider, $authProvider) {
$urlRouterProvider.otherwise('/welcome'); $urlRouterProvider.otherwise('/welcome');

View File

@ -32,7 +32,8 @@
</td> </td>
<td data-title="'Active'" filter="{ 'active': 'select' }" filter-data="getCertificateStatus()"> <td data-title="'Active'" filter="{ 'active': 'select' }" filter-data="getCertificateStatus()">
<form> <form>
<switch ng-change="certificateService.updateActive(certificate)" id="status" name="status" ng-model="certificate.active" class="green small"></switch> <switch ng-change="certificateService.updateActive(certificate)" id="status" name="status"
ng-model="certificate.active" class="green small"></switch>
</form> </form>
</td> </td>
<td data-title="'Issuer'" sortable="'issuer'" filter="{ 'issuer': 'text' }"> <td data-title="'Issuer'" sortable="'issuer'" filter="{ 'issuer': 'text' }">
@ -46,7 +47,9 @@
</td> </td>
<td data-title="''"> <td data-title="''">
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button ng-model="certificate.toggle" class="btn btn-sm btn-info" btn-checkbox btn-checkbox-true="1" butn-checkbox-false="0">More</button> <button ng-model="certificate.toggle" class="btn btn-sm btn-info" btn-checkbox btn-checkbox-true="1"
butn-checkbox-false="0">More
</button>
<button class="btn btn-sm btn-warning" ng-click="edit(certificate.id)">Edit</button> <button class="btn btn-sm btn-warning" ng-click="edit(certificate.id)">Edit</button>
</div> </div>
</td> </td>
@ -54,7 +57,8 @@
<tr class="warning" ng-show="certificate.toggle" ng-repeat-end> <tr class="warning" ng-show="certificate.toggle" ng-repeat-end>
<td colspan="6"> <td colspan="6">
<tabset justified="true" class="col-md-6"> <tabset justified="true" class="col-md-6">
<tab heading="Basic Info"> <tab>
<tab-heading>Basic Info</tab-heading>
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item"> <li class="list-group-item">
<strong>Creator</strong> <strong>Creator</strong>
@ -89,7 +93,9 @@
<strong>Serial</strong> <strong>Serial</strong>
<span class="pull-right">{{ certificate.serial }}</span> <span class="pull-right">{{ certificate.serial }}</span>
</li> </li>
<li tooltip="Lemur will attempt to check a certificates validity, this is used to track whether a certificate as been revoked" class="list-group-item"> <li
tooltip="Lemur will attempt to check a certificates validity, this is used to track whether a certificate as been revoked"
class="list-group-item">
<strong>Validity</strong> <strong>Validity</strong>
<span class="pull-right"> <span class="pull-right">
<span ng-show="!certificate.status" class="label label-warning">Unknown</span> <span ng-show="!certificate.status" class="label label-warning">Unknown</span>
@ -103,7 +109,8 @@
</li> </li>
</ul> </ul>
</tab> </tab>
<tab heading="Notifications"> <tab>
<tab-heading>Notifications</tab-heading>
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item" ng-repeat="notification in certificate.notifications"> <li class="list-group-item" ng-repeat="notification in certificate.notifications">
<strong>{{ notification.label }}</strong> <strong>{{ notification.label }}</strong>
@ -111,7 +118,8 @@
</li> </li>
</ul> </ul>
</tab> </tab>
<tab heading="Destinations"> <tab>
<tab-heading>Destinations</tab-heading>
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item" ng-repeat="destination in certificate.destinations"> <li class="list-group-item" ng-repeat="destination in certificate.destinations">
<strong>{{ destination.label }}</strong> <strong>{{ destination.label }}</strong>
@ -119,31 +127,41 @@
</li> </li>
</ul> </ul>
</tab> </tab>
<tab heading="Domains"> <tab>
<tab-heading>Domains</tab-heading>
<div class="list-group"> <div class="list-group">
<a href="#/domains/{{ domain.id }}" class="list-group-item" ng-repeat="domain in certificate.domains">{{ domain.name }}</a> <a href="#/domains/{{ domain.id }}" class="list-group-item"
ng-repeat="domain in certificate.domains">{{ domain.name }}</a>
</div> </div>
</tab> </tab>
</tabset> </tabset>
<tabset justified="true" class="col-md-6"> <tabset justified="true" class="col-md-6">
<tab heading="Chain"> <tab>
<p> <tab-heading>
<pre style="width: 550px">{{ certificate.chain }}</pre> Chain
</p> <button class="btn btn-xs btn-default clipboard-btn glyphicon glyphicon-copy"
tooltip="Copy chain to clipboard" tooltip-trigger="mouseenter" clipboard
text="certificate.chain"></button>
</tab-heading>
<pre style="width: 100%">{{ certificate.chain }}</pre>
</tab> </tab>
<tab heading="Public Certificate"> <tab>
<p> <tab-heading>
<pre style="width: 550px">{{ certificate.body }}</pre> Public Certificate
</p> <button class="btn btn-xs btn-default clipboard-btn glyphicon glyphicon-copy"
tooltip="Copy certificate to clipboard" tooltip-trigger="mouseenter" clipboard
text="certificate.body"></button>
</tab-heading>
<pre style="width: 100%">{{ certificate.body }}</pre>
</tab> </tab>
<tab ng-click="certificateService.loadPrivateKey(certificate)"> <tab ng-click="certificateService.loadPrivateKey(certificate)">
<tab-heading> <tab-heading>
Private Key Private Key
<button class="btn btn-xs btn-default clipboard-btn glyphicon glyphicon-copy"
tooltip="Copy key to clipboard" tooltip-trigger="mouseenter" clipboard
text="certificate.privateKey"></button>
</tab-heading> </tab-heading>
<p> <pre style="width: 100%">{{ certificate.privateKey }}</pre>
<pre style="width: 550px">{{ certificate.privateKey }}</pre>
</p>
</tab> </tab>
</tabset> </tabset>
</td> </td>

View File

@ -10,17 +10,17 @@
<div class="col-lg-4"> <div class="col-lg-4">
<h2>Create</h2> <h2>Create</h2>
<p>With Lemur you can create certificates from any authority; internal or external! Lemur does not issue certificates itself. Instead it acts as a broker, creating private keys and CSRs that are sent to external services.</p> <p>With Lemur you can create certificates from any authority; internal or external! Lemur does not issue certificates itself. Instead it acts as a broker, creating private keys and CSRs that are sent to external services.</p>
<p><a class="btn btn-default" href="#" role="button">View certificates &raquo;</a></p> <p><a class="btn btn-default" ui-sref="certificates" role="button">View certificates &raquo;</a></p>
</div><!-- /.col-lg-4 --> </div><!-- /.col-lg-4 -->
<div class="col-lg-4"> <div class="col-lg-4">
<h2>Deploy</h2> <h2>Deploy</h2>
<p>Once certificates have been created with Lemur, you can put them to use! Lemur has the ability to create destinations for certificates that allow them to be uploaded to and used by a variety of environments.</p> <p>Once certificates have been created with Lemur, you can put them to use! Lemur has the ability to create destinations for certificates that allow them to be uploaded to and used by a variety of environments.</p>
<p><a class="btn btn-default" href="#" role="button">View Destinations &raquo;</a></p> <p><a class="btn btn-default" ui-sref="destinations" role="button">View Destinations &raquo;</a></p>
</div><!-- /.col-lg-4 --> </div><!-- /.col-lg-4 -->
<div class="col-lg-4"> <div class="col-lg-4">
<h2>Authority</h2> <h2>Authority</h2>
<p>Have an internal Certificate Authority? Need an easy way to create an manage those authorities? Lemur has you covered!</p> <p>Have an internal Certificate Authority? Need an easy way to create an manage those authorities? Lemur has you covered!</p>
<p><a class="btn btn-default" href="#" role="button">View Authorities &raquo;</a></p> <p><a class="btn btn-default" ui-sref="authorities" role="button">View Authorities &raquo;</a></p>
</div><!-- /.col-lg-4 --> </div><!-- /.col-lg-4 -->
</div><!-- /.row --> </div><!-- /.row -->
</div> </div>

View File

@ -169,3 +169,13 @@ a {
background-color: #FFFFFF !important; background-color: #FFFFFF !important;
} }
.clipboard-btn {
border-width: 0;
background-color: transparent;
color: #777;
display: inline-block;
top: 0;
line-height: 1;
}