diff --git a/app/js/controllers/IdentityController.js b/app/js/controllers/IdentityController.js index 24d70cefb0bedbf545e8f58aaeabafeeb0b75360..6addcfbb22a50c5c42dc6c3c1c36d23ff9382321 100644 --- a/app/js/controllers/IdentityController.js +++ b/app/js/controllers/IdentityController.js @@ -1,6 +1,8 @@ "use strict"; -module.exports = ($scope) => { +var co = require('co'); + +module.exports = ($scope, BMA) => { setTimeout(() => { $('select').material_select(); @@ -12,4 +14,15 @@ module.exports = ($scope) => { $('#modal1').openModal(); } }; + + $scope.previewPubkey = () => co(function *() { + let data = yield BMA.webmin.key.preview({ + conf: $scope.$parent.conf + }); + $scope.$parent.pubkey_preview = data.pubkey; + let modal = $('#modal-pubkey'); + if (modal.css('display') == 'none') { + $('#modal-pubkey').openModal(); + } + }); }; diff --git a/app/js/lib/conf/i18n/en.json b/app/js/lib/conf/i18n/en.json index 5d6f5406e8309216ef4f27f235d5a5ba90546585..b52a9e71a928fc7852627648ef7cd13d791f72cf 100644 --- a/app/js/lib/conf/i18n/en.json +++ b/app/js/lib/conf/i18n/en.json @@ -22,12 +22,15 @@ "configuration.create_uid.entropy.tooltip": "An entropy source to make your key unique: an e-mail, a phone n°, ...", "configuration.create_uid.password.tooltip": "A secret password to protect your key.", "configuration.create_uid.create_button": "Continue", + "configuration.create_uid.preview_button": "Preview pubkey", "configuration.create_uid.nrp_algo_choose": "NRP algorithm", "configuration.create_uid.nrp_algo_choose_1": "N = 4096 ; r = 16 ; p = 1", "configuration.create_uid.modal_title": "Identity confirmation", "configuration.create_uid.modal_message": "This identity will be definitive for this currency: you will be known by your User ID and will be able to access your account using your Entropy and Password values.", "configuration.create_uid.modal_agree": "Agree", "configuration.create_uid.modal_disagree": "Disagree", + "configuration.create_uid.modal_preview_title": "Preview of pubkey", + "configuration.create_uid.modal_preview_ok": "OK", "configuration.create_network.title": "Network", "configuration.create_network.message": "uCoin is a P2P software and needs bidirectionnal access to the network. Please chose carefully the following parameters.", "configuration.create_network.none": "None", diff --git a/app/js/services/bma.js b/app/js/services/bma.js index 4ecdace5bf14f0000fa7709570931312527f4865..84a2bb5d93b7c8a4e19aadf76cb63cc1b82aa94b 100644 --- a/app/js/services/bma.js +++ b/app/js/services/bma.js @@ -114,6 +114,9 @@ module.exports = (angular) => { autoConfNetwork: getResource('/webmin/server/auto_conf_network'), resetData: getResource('/webmin/server/reset/data') }, + key: { + preview: postResource('/webmin/key/preview') + }, network: { interfaces: getResource('/webmin/network/interfaces') } diff --git a/app/views/configure/create_uid.jade b/app/views/configure/create_uid.jade index 5ef21631c06af79167957a7e474cf0950b7392ea..3455f2e777708b0f21e0b33d7d3a7b402d9f6f9a 100644 --- a/app/views/configure/create_uid.jade +++ b/app/views/configure/create_uid.jade @@ -15,6 +15,10 @@ include ../includes/key + .raw: button.btn-large.waves-effect.waves-light(ng-disabled="!$parent.conf.idty_entropy || !$parent.conf.idty_password" ng-click="previewPubkey()") + i.left.fa.fa-play + span(translate="configuration.create_uid.preview_button") + .row: button.btn-large.waves-effect.waves-light(ng-disabled="!$parent.conf.idty_uid || !$parent.conf.idty_entropy || !$parent.conf.idty_password" ng-click="accept()") span(translate="configuration.create_uid.create_button") diff --git a/app/views/configure/layout.jade b/app/views/configure/layout.jade index a88060f0b2a8c29b2fe0bbbd83659f97bd7879b4..24ba20bfe6a82586192eed3ec5f608873a9e432a 100644 --- a/app/views/configure/layout.jade +++ b/app/views/configure/layout.jade @@ -9,3 +9,8 @@ main(ui-view="") a.btn.modal-action.modal-close.waves-effect.waves-orange(ui-sref="configure.create_network") i.material-icons.left done ="{{ 'configuration.create_uid.modal_agree' | translate }}" + +#modal-pubkey.modal + .modal-content + h4 {{ 'configuration.create_uid.modal_preview_title' | translate }} + p {{ pubkey_preview }} diff --git a/brunch-config.coffee b/brunch-config.coffee index 50cdebc2942d8dfa4c7bc537a8a566184c847f7d..bc3fcf42a9af66ab2d44dfc1248bb858e55f22f6 100644 --- a/brunch-config.coffee +++ b/brunch-config.coffee @@ -21,4 +21,4 @@ module.exports = config: sourceMaps: true server: - hostname: '192.168.1.35' + hostname: '192.168.0.22'