Add showing items

This commit is contained in:
brantje 2016-09-14 21:23:55 +02:00
parent dee5ecda55
commit 1225848212
4 changed files with 33 additions and 19 deletions

View file

@ -8,7 +8,7 @@
* Controller of the passmanApp
*/
angular.module('passmanApp')
.controller('CredentialCtrl', ['$scope', 'VaultService', 'SettingsService', '$location', 'CredentialService', '$rootScope', function ($scope, VaultService, SettingsService, $location, CredentialService, $rootScope) {
.controller('CredentialCtrl', ['$scope', 'VaultService', 'SettingsService', '$location', 'CredentialService', '$rootScope','EncryptService', function ($scope, VaultService, SettingsService, $location, CredentialService, $rootScope, EncryptService) {
$scope.active_vault = VaultService.getActiveVault();
if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) {
if (!$scope.active_vault) {
@ -40,7 +40,7 @@ angular.module('passmanApp')
$scope.selectedCredential = false;
$scope.selectCredential = function (credential) {
console.log(credential);
$scope.selectedCredential = credential
$scope.selectedCredential = CredentialService.decryptCredential(angular.copy(credential));
}
$rootScope.$on('logout', function () {

View file

@ -12,7 +12,9 @@ angular.module('passmanApp')
.filter('decrypt',['EncryptService', function (EncryptService) {
return function (input) {
if(input) {
return EncryptService.decryptString(input);
var string = EncryptService.decryptString(input).toString();
console.log(string);
return string;
}
};
}]);

View file

@ -47,7 +47,7 @@ angular.module('views/partials/password-meter.html', []).run(['$templateCache',
angular.module('views/show_vault.html', []).run(['$templateCache', function($templateCache) {
'use strict';
$templateCache.put('views/show_vault.html',
'<div id="controls"><div class="breadcrumb"></div><div class="actions creatable"><span ng-click="menuOpen = !menuOpen" class="button new" ng-init="menuOpen = false" off-click="menuOpen = false;"><span>New</span></span><div class="actionList popovermenu bubble menu" ng-show="menuOpen"><ul><li><span ng-click="addCredential()" class="menuitem action"><span class="icon icon-rename"></span> <span>New credential</span></span></li><li><span href="#" class="menuitem action"><span class="icon icon-shared"></span> <span>New shared credential</span></span></li></ul></div></div></div><table class="credential-table" ng-init="menuOpen = false;"><tr ng-repeat="credential in credentials" ng-if="credential.hidden == 0 && credential.delete_time == 0" ng-click="selectCredential(credential)" ng-class="{\'selected\': selectedCredential.credential_id == credential.credential_id}"><td><span class="label">{{credential.label}}</span> <span class="icon icon-more" ng-click="menuOpen = !menuOpen" off-click="menuOpen = false;"></span> <span class="tags"><span class="tag">Tag 1</span> <span class="tag">Tag 2</span> <span class="tag">Tag 4</span> <span class="tag">Tag 4</span> <span class="tag">Long tag xD</span></span><div class="actionList popovermenu bubble menu" ng-show="menuOpen"><ul><li ng-click="editCredential(credential)"><span class="menuitem action"><span class="icon icon-rename"></span><span>Edit</span></span></li><li><span href="#" class="menuitem action"><span class="icon icon-share"></span><span>Share</span></span></li><li><span class="menuitem action" data-action="Delete"><span class="icon icon-delete"></span><span>Delete</span></span></li></ul></div></td></tr></table><div class="view_pane" ng-class="{\'item_selected\': selectedCredential}"><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Label</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Account</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Password</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Files</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Custom fields</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Changed</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-1">Created</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div></div>');
'<div id="controls"><div class="breadcrumb"></div><div class="actions creatable"><span ng-click="menuOpen = !menuOpen" class="button new" ng-init="menuOpen = false" off-click="menuOpen = false;"><span>New</span></span><div class="actionList popovermenu bubble menu" ng-show="menuOpen"><ul><li><span ng-click="addCredential()" class="menuitem action"><span class="icon icon-rename"></span> <span>New credential</span></span></li><li><span href="#" class="menuitem action"><span class="icon icon-shared"></span> <span>New shared credential</span></span></li></ul></div></div></div><table class="credential-table" ng-init="menuOpen = false;"><tr ng-repeat="credential in credentials" ng-if="credential.hidden == 0 && credential.delete_time == 0" ng-click="selectCredential(credential)" ng-class="{\'selected\': selectedCredential.credential_id == credential.credential_id}"><td><span class="label">{{credential.label}}</span> <span class="icon icon-more" ng-click="menuOpen = !menuOpen" off-click="menuOpen = false;"></span> <span class="tags"><span class="tag">Tag 1</span> <span class="tag">Tag 2</span> <span class="tag">Tag 4</span> <span class="tag">Tag 4</span> <span class="tag">Long tag xD</span></span><div class="actionList popovermenu bubble menu" ng-show="menuOpen"><ul><li ng-click="editCredential(credential)"><span class="menuitem action"><span class="icon icon-rename"></span><span>Edit</span></span></li><li><span href="#" class="menuitem action"><span class="icon icon-share"></span><span>Share</span></span></li><li><span class="menuitem action" data-action="Delete"><span class="icon icon-delete"></span><span>Delete</span></span></li></ul></div></td></tr></table><div class="view_pane" ng-class="{\'item_selected\': selectedCredential}"><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">Label</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.label}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">Account</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.username}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">Password</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.password}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">E-mail</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.email}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">Files</div><div class="col-xs-6 col-sm-4 col-md-4"><div ng-repeat="file in selectedCredential.files" class="link">{{file.filename}} ({{file.size}})</div></div></div><div class="row" ng-repeat="field in selectedCredential.custom_fields"><div class="col-xs-2 col-sm-2 col-md-2">{{field.label}}</div><div class="col-xs-6 col-sm-4 col-md-4">{{field.value}} {{field.secret}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">Changed</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.changed * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row"><div class="col-xs-2 col-sm-2 col-md-2">Created</div><div class="col-xs-6 col-sm-4 col-md-4">{{selectedCredential.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div></div>');
}]);
angular.module('views/vaults.html', []).run(['$templateCache', function($templateCache) {

View file

@ -67,7 +67,7 @@
<div class="view_pane" ng-class="{'item_selected': selectedCredential}" >
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-2">
Label
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
@ -75,52 +75,64 @@
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-2">
Account
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.label}}
{{selectedCredential.username}}
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-2">
Password
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.label}}
{{selectedCredential.password}}
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-2">
E-mail
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.email}}
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-2">
Files
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.label}}
<div ng-repeat="file in selectedCredential.files" class="link">
{{file.filename}} ({{file.size}})
</div>
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
Custom fields
<div class="row" ng-repeat="field in selectedCredential.custom_fields">
<div class="col-xs-2 col-sm-2 col-md-2">
{{field.label}}
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.label}}
{{field.value}}
{{field.secret}}
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-2">
Changed
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.label}}
{{selectedCredential.changed * 1000 | date:'dd-MM-yyyy @ HH:mm:ss'}}
</div>
</div>
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-2">
Created
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
{{selectedCredential.label}}
{{selectedCredential.created * 1000 | date:'dd-MM-yyyy @ HH:mm:ss'}}
</div>
</div>