Commit 74322daf authored by Benoit Lavenier's avatar Benoit Lavenier

[enh] ES network: add a view to monitor Cesium+ pod network

parent 76771728
Pipeline #7577 failed with stages
in 6 minutes and 3 seconds
......@@ -17,14 +17,10 @@
/package-lock.json
/yarn-error.log
/dist/web
/dist/android
/dist/*
!/dist/desktop
/hooks/playstore-config.json
/hooks/minify-conf.json
/hooks/uglify-config.json
/hooks/after_prepare/ionic-minify.js
/hooks/after_prepare/uglify.js
/www/js/config.js
......
......@@ -6,7 +6,7 @@ To build Cesium, you will have to:
- Installing build tools:
```
sudo apt-get install build-essential
sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make
```
- Installing [nvm](https://github.com/nvm-sh/nvm)
......@@ -18,14 +18,14 @@ If you are using fish shell, there is a [dedicated plugin](https://github.com/jo
> Then reload your terminal, for instance by executing the commande `bash`
- Configure NodeJS to use a version 6: (**WARNING**: upper version will NOT work !)
- Configure NodeJS to use a version 10: (**WARNING**: upper version will NOT work !)
```
nvm install 6
nvm install 10
```
- Installing node.js build tools:
- Installing node.js build tools, as global dependencies:
```
npm install -g yarn gulp cordova@9.0.0 ionic@1.7.16
npm install -g yarn gulp cordova ionic
```
## Get the source code and dependencies
......@@ -40,7 +40,6 @@ If you are using fish shell, there is a [dedicated plugin](https://github.com/jo
- Installing Cordova plugins (need for platforms specific builds)
```
ionic state restore
ionic browser add crosswalk@12.41.296.5
```
- This should create a new directory `platforms/android`
......@@ -66,10 +65,10 @@ If you are using fish shell, there is a [dedicated plugin](https://github.com/jo
- Compiling and running Cesium:
```
ionic serve
npm start
```
> or alternative: `ionic serve`
> or alternative: `yarn run start` or `ionic serve`
- Open a web browser at address: [localhost:8100](http://localhost:8100). The application should be running.
......
......@@ -9,8 +9,8 @@
"url": "git@git.duniter.org:clients/cesium/cesium.git"
},
"scripts": {
"clean": "trash www/dist/** platforms/web platforms/**/*.apk platforms/desktop/**/*.deb",
"postinstall": "node -e \"try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'www/lib', 'junction') } catch (e) { }\" && rm -f hooks/minify-conf.json hooks/uglify-config.json hooks/after_prepare/ionic-minify.js hooks/after_prepare/uglify.js",
"clean": "trash www/dist/** dist/web/* dist/desktop/**/*.deb platforms/android/**/*.apk",
"postinstall": "node -e \"try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'www/lib', 'junction') } catch (e) { }\" && rm -f hooks/uglify-config.json hooks/after_prepare/uglify.js",
"install-platforms": "ionic cordova prepare",
"start": "ionic serve",
"docker:build": "sudo docker build . -t cesium/release",
......@@ -182,7 +182,9 @@
],
"cordova": {
"plugins": {
"cordova-plugin-camera": {},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": "Add picture to the user profile",
"PHOTOLIBRARY_USAGE_DESCRIPTION": "Take a picture for the user profile"},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-dialogs": {},
......@@ -200,7 +202,9 @@
},
"ionic-plugin-keyboard": {},
"cordova-clipboard": {},
"cordova-plugin-ionic-webview": {}
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
}
},
"platforms": [
"ios",
......@@ -211,4 +215,4 @@
"engines": {
"yarn": ">= 1.0.0"
}
}
\ No newline at end of file
}
......@@ -138,10 +138,10 @@ $screen-lg: 1200px;
padding: 16px !important;
}
.no-padding-xs {
padding: 0px !important;
padding: 0 !important;
}
.no-margin-xs {
margin: 0px !important;
margin: 0 !important;
}
}
......@@ -169,10 +169,10 @@ $screen-lg: 1200px;
padding: 16px !important;
}
.no-padding-sm {
padding: 0px !important;
padding: 0 !important;
}
.no-margin-sm {
margin: 0px !important;
margin: 0 !important;
}
}
......@@ -345,7 +345,7 @@ $screen-lg: 1200px;
@media screen and (max-width: $screen-xs-max) {
.no-margin-xs {
margin: 0px !important;
margin: 0 !important;
}
}
......@@ -482,7 +482,7 @@ html, body {
height: 20px;
line-height: 19px;
max-width: 260px;
margin: 0px 5px;
margin: 0 5px;
text-align: left;
}
......@@ -493,7 +493,7 @@ html, body {
position: absolute;
right: 0;
top: 0;
margin: 0px 5px;
margin: 0 5px;
display: block;
}
}
......@@ -559,7 +559,7 @@ html, body {
.title {
color: black;
text-align: left;
left: 0px !important;
left: 0 !important;
font-size: 14px;
line-height: 30px;
}
......@@ -620,7 +620,7 @@ html, body {
.button.button-small {
height: 30px;
font-size: 12px;
padding: 0px 5px !important;
padding: 0 5px !important;
line-height: 30px;
}
}
......@@ -701,7 +701,7 @@ html, body {
// Avoid to have not align button on bar-header
.bar .buttons.pull-right, .bar .title + .button:last-child, .bar .title + .buttons, .bar > .button + .button:last-child, .bar > .button.pull-right {
top: 0px !important;
top: 0 !important;
}
// Avoid different between home view and other view (space between last button and left border)
......@@ -709,7 +709,7 @@ html, body {
padding-right: 5px !important;
.buttons-right span {
margin-left: 0px !important;
margin-left: 0 !important;
}
}
......@@ -861,7 +861,7 @@ html, body {
}
.no-padding {
padding: 0px !important;
padding: 0 !important;
}
.avatar-member {
......@@ -1266,7 +1266,7 @@ body {
.card .card-header {
padding-top: 5px !important;
padding-bottom: 0px !important;
padding-bottom: 0 !important;
min-height: 25px;
}
......@@ -1277,7 +1277,7 @@ body {
.card .card-avatar,
.card.card-avatar {
.avatar {
box-shadow: 0px 3px 4px 0 rgba(0, 0, 0, 0.26);
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.26);
top: 7px;
background-color: #D9D9D9;
}
......@@ -1340,7 +1340,7 @@ a.underline:hover,
.avatar,
.item-avatar .avatar {
box-shadow: 0px 2px 2px 0 rgba(0, 0, 0, 0.26);
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.26);
height: 30px !important;
width: 30px !important;
left: 5px !important;
......@@ -1352,7 +1352,7 @@ a.underline:hover,
}
.card-footer {
padding-top: 0px;
padding-top: 0;
padding-left: 42px !important;
}
}
......@@ -1557,7 +1557,7 @@ a.underline:hover,
.list.item-border-large {
.item {
border-bottom: solid 1px #ccc !important;
margin: 0px 0px 1px;
margin: 0 0px 1px;
}
.item-divider {
......@@ -1573,11 +1573,11 @@ a.underline:hover,
.list .item.item-small-height {
padding-top: 2px;
padding-bottom: 0px;
padding-bottom: 0;
min-height: 24px;
.badge {
padding-top: 0px !important;
padding-top: 0 !important;
top: inherit;
}
......@@ -1606,12 +1606,12 @@ a.underline:hover,
}
.form-error {
padding: 0px 16px;
padding: 0 16px;
font-size: 12px;
color: red;
vertical-align: middle;
text-align: end;
top: 0px;
top: 0;
position: relative;
}
......@@ -1747,7 +1747,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
**********/
.modal.modal-full-height {
bottom: 0px;
bottom: 0;
}
// Force modal as fullscreen, on xs screen
......@@ -1755,7 +1755,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
.modal {
top: 0 !important;
left: 0 !important;
bottom: 0px;
bottom: 0;
min-height: 100% !important;
width: 100% !important;
}
......@@ -1763,7 +1763,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
@media screen and (max-width: $screen-sm-max) {
.modal {
bottom: 0px;
bottom: 0;
// Hide swiper on tablet
.swiper-pagination {
......@@ -1789,7 +1789,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
.modal.about .bar.bar-header .button + .title {
left: 0px !important; /* avoid title offset on large screens, if button are 'visible-xs')'*/
left: 0 !important; /* avoid title offset on large screens, if button are 'visible-xs')'*/
}
/**********
......@@ -1934,8 +1934,8 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
.item.item-divider {
min-height: 2px;
height: 2px;
padding-top: 0px;
padding-bottom: 0px;
padding-top: 0;
padding-bottom: 0;
}
.item,
......@@ -1953,7 +1953,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
}
.item.item-complex {
padding-top: 0px;
padding-top: 0;
}
.item.item-button-right .button {
......@@ -1965,14 +1965,14 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
// Hide footer on small screen
ion-content.has-footer {
bottom: 0px !important; /*ignore footer*/
bottom: 0 !important; /*ignore footer*/
}
.bar-header {
background-color: $positive-900-bg;
color: #fff;
height: 150px;
padding-right: 0px !important;
padding-right: 0 !important;
.platform-ios.platform-cordova & {
height: calc(constant(safe-area-inset-top) + 150px);
......@@ -1984,7 +1984,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
box-shadow: none; // not need (define in bar-header)
.content {
bottom: 0px;
bottom: 0;
}
}
}
......@@ -2169,7 +2169,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
text-align: center;
position: relative;
top: 8px;
height: 0px;
height: 0;
}
.icon.icon-bottom-right {
......@@ -2195,7 +2195,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
width: 100%;
bottom: 8px;
text-align: center;
height: 0px;
height: 0;
}
}
......@@ -2223,7 +2223,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
.col .button {
max-width: inherit;
width: 100%;
padding: 5px 0px;
padding: 5px 0;
margin: 0;
}
}
......@@ -2242,7 +2242,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
height: 35px;
width: 35px;
position: relative;
left: 0px;
left: 0;
top: 4px;
border: solid 1px #D9D9D9;
}
......@@ -2255,7 +2255,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
height: 31px;
width: 31px;
position: relative;
left: 0px;
left: 0;
top: 6px;
}
}
......@@ -2321,7 +2321,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
.row-header {
border-bottom: solid 1px #ccc !important;
margin: 0px;
margin: 0;
min-height: 28px !important;
}
......
......@@ -26,7 +26,6 @@
<link rel="stylesheet" type="text/css" href="lib/chart.js/dist/Chart.min.css">
<link rel="stylesheet" type="text/css" href="dist/dist_css/plugins/es/css/style.css">
<link rel="stylesheet" type="text/css" href="dist/dist_css/plugins/graph/css/style.css">
<link rel="stylesheet" type="text/css" href="dist/dist_css/plugins/graph/css/style.css">
<link rel="stylesheet" type="text/css" href="dist/dist_css/plugins/map/css/style.css">
<!--endRemoveIf(no-plugin)-->
<!-- endbuild -->
......@@ -48,6 +47,7 @@
<meta property="og:locale:alternate" content="fr_FR" />
<meta property="og:locale:alternate" content="it_IT" />
<meta property="og:locale:alternate" content="nl_NL" />
<meta property="og:locale:alternate" content="eo_EO" />
<!--endRemoveIf(device)-->
......@@ -72,11 +72,9 @@
<script src="lib/numeral/languages/es.js"></script>
<script src="lib/numeral/languages/it.js"></script>
<script src="js/vendor/numeral.eo.js"></script>
<script src="lib/socket.io-client/dist/socket.io.min.js"></script>
<script src="lib/underscore/underscore-min.js"></script>
<script src="lib/qrcode.js/qrcode.js"></script>
<script src="lib/aes-js/index.js"></script>
<script src="lib/chart.js/dist/Chart.min.js"></script>
......@@ -191,6 +189,7 @@
<script src="dist/dist_js/plugins/es/js/entities/notification.js"></script>
<script src="dist/dist_js/plugins/es/js/entities/comment.js"></script>
<script src="dist/dist_js/plugins/es/js/entities/invitation.js"></script>
<script src="dist/dist_js/plugins/es/js/entities/peer.js"></script>
<script src="dist/dist_js/plugins/es/js/services.js"></script>
<script src="dist/dist_js/plugins/es/js/services/comment-services.js"></script>
<script src="dist/dist_js/plugins/es/js/services/http-services.js"></script>
......@@ -211,6 +210,7 @@
<script src="dist/dist_js/plugins/es/js/services/tx-services.js"></script>
<script src="dist/dist_js/plugins/es/js/services/geo-services.js"></script>
<script src="dist/dist_js/plugins/es/js/services/document-services.js"></script>
<script src="dist/dist_js/plugins/es/js/services/network-services.js"></script>
<script src="dist/dist_js/plugins/es/js/controllers/common-controllers.js"></script>
<script src="dist/dist_js/plugins/es/js/controllers/app-controllers.js"></script>
<script src="dist/dist_js/plugins/es/js/controllers/settings-controllers.js"></script>
......@@ -229,7 +229,6 @@
<script src="dist/dist_js/plugins/es/js/controllers/document-controllers.js"></script>
<!-- Graph plugin -->
<!--removeIf(ubuntu)--> <!-- FIXME: issue #463 -->
<script src="dist/dist_js/plugins/graph/js/plugin.js"></script>
<script src="dist/dist_js/plugins/graph/js/services.js"></script>
<script src="dist/dist_js/plugins/graph/js/services/data-services.js"></script>
......@@ -241,7 +240,6 @@
<script src="dist/dist_js/plugins/graph/js/controllers/account-controllers.js"></script>
<script src="dist/dist_js/plugins/graph/js/controllers/docstats-controllers.js"></script>
<script src="dist/dist_js/plugins/graph/js/controllers/synchro-controllers.js"></script>
<!--endRemoveIf(ubuntu)-->
<!-- Map plugin -->
<script src="dist/dist_js/plugins/map/js/plugin.js"></script>
......
......@@ -94,7 +94,7 @@ angular.module("cesium.config", [])
}
},
"version": "1.4.18",
"build": "2019-12-28T12:21:59.344Z",
"build": "2019-12-31T11:21:28.655Z",
"newIssueUrl": "https://git.duniter.org/clients/cesium-grp/cesium/issues/new"
})
......
......@@ -559,8 +559,8 @@ function HomeController($scope, $state, $timeout, $ionicHistory, $translate, UIU
* Catch click for quick fix
* @param event
*/
$scope.doQuickFix = function(event) {
if (event == 'settings') {
$scope.doQuickFix = function(action) {
if (action === 'settings') {
$ionicHistory.nextViewOptions({
historyRoot: true
});
......
......@@ -158,7 +158,9 @@ angular.module('cesium.http.services', ['cesium.cache.services'])
timeout = timeout || csSettings.data.timeout;
function _waitOpen(self) {
if (!self.delegate) throw new Error('Websocket not opened');
if (!self.delegate) {
throw new Error('Websocket {0} was closed!'.format(uri));
}
if (self.delegate.readyState == 1) {
return $q.when(self.delegate);
}
......
......@@ -81,22 +81,22 @@
}
.row-record .col-text-wrap {
padding: 0;
margin: 0;
padding: 0;
margin: 0;
}
.row-record .col .text-wrap {
height: 70px;
white-space: normal;
position: relative;
word-wrap: break-word !important;
overflow: hidden !important;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
-o-hyphens: auto;
hyphens: auto;
height: 70px;
white-space: normal;
position: relative;
word-wrap: break-word !important;
overflow: hidden !important;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
-o-hyphens: auto;
hyphens: auto;
}
/* Source: See doc: http://stackoverflow.com/questions/15814346 */
......@@ -243,6 +243,20 @@
}
/**********
Document
**********/
.item-document.compacted {
min-height: 16px !important;
max-height: 16px !important;
border-bottom: 0 !important;
}
.item-document.compacted .col{
padding-top: 1px;
}
/**********
Add specific Icons
**********/
......
......@@ -413,6 +413,7 @@
"TITLE": "Document search",
"BTN_ACTIONS": "Actions",
"SEARCH_HELP": "issuer:AAA*, time:1508406169",
"LAST_DOCUMENTS_DOTS": "Last documents:",
"LAST_DOCUMENTS": "Last documents",
"SHOW_QUERY": "Show query",
"HIDE_QUERY": "Hide query",
......@@ -421,6 +422,8 @@
"HEADER_RECIPIENT": "Recipient",
"READ": "Read",
"BTN_REMOVE": "Delete this document",
"BTN_COMPACT": "Compact",
"HAS_REGISTERED": "create or edit his profile",
"POPOVER_ACTIONS": {
"TITLE": "Actions",
"REMOVE_ALL": "Delete these documents..."
......@@ -470,6 +473,13 @@
"ES_WALLET": {
"ERROR": {
"RECIPIENT_IS_MANDATORY": "A recipient is required for encryption."
},
"ES_PEER": {
"NAME": "Name",
"DOCUMENTS": "Documents",
"SOFTWARE": "Software",
"DOCUMENT_COUNT": "Number of documents",
"EMAIL_SUBSCRIPTION_COUNT": "{{emailSubscription}} subscribers to email notification"
}
},
"EVENT": {
......
......@@ -413,6 +413,7 @@
"TITLE": "Document search",
"BTN_ACTIONS": "Actions",
"SEARCH_HELP": "issuer:AAA*, time:1508406169",
"LAST_DOCUMENTS_DOTS": "Last documents:",
"LAST_DOCUMENTS": "Last documents",
"SHOW_QUERY": "Show query",
"HIDE_QUERY": "Hide query",
......@@ -421,6 +422,8 @@
"HEADER_RECIPIENT": "Recipient",
"READ": "Read",
"BTN_REMOVE": "Delete this document",
"BTN_COMPACT": "Compact",
"HAS_REGISTERED": "create or edit his profile",
"POPOVER_ACTIONS": {
"TITLE": "Actions",
"REMOVE_ALL": "Delete these documents..."
......@@ -470,6 +473,13 @@
"ES_WALLET": {
"ERROR": {
"RECIPIENT_IS_MANDATORY": "A recipient is required for encryption."
},
"ES_PEER": {
"NAME": "Name",
"DOCUMENTS": "Documents",
"SOFTWARE": "Software",
"DOCUMENT_COUNT": "Number of documents",
"EMAIL_SUBSCRIPTION_COUNT": "{{emailSubscription}} subscribers to email notification"
}
},
"EVENT": {
......
......@@ -463,7 +463,8 @@
"LOOKUP": {
"TITLE": "Recherche de documents",
"BTN_ACTIONS": "Actions",
"SEARCH_HELP": "Emetteur:AAA*, temps:1508406169",
"SEARCH_HELP": "issuer:AAA*, time:1508406169",
"LAST_DOCUMENTS_DOTS": "Derniers documents :",
"LAST_DOCUMENTS": "Derniers documents",
"SHOW_QUERY": "Voir la requête",
"HIDE_QUERY": "Masquer la requête",
......@@ -472,6 +473,8 @@
"HEADER_RECIPIENT": "Destinataire",
"READ": "Lu",
"BTN_REMOVE": "Supprimer ce document",
"BTN_COMPACT": "Compacter",
"HAS_REGISTERED": "a créé ou modifié son profil",
"POPOVER_ACTIONS": {
"TITLE": "Actions",
"REMOVE_ALL": "Supprimer ces documents..."
......@@ -523,6 +526,13 @@
"RECIPIENT_IS_MANDATORY": "Un destinataire est obligatoire pour le chiffrement."
}
},
"ES_PEER": {
"NAME": "Nom",
"DOCUMENTS": "Documents",
"SOFTWARE": "Logiciel",
"DOCUMENT_COUNT": "Nombre de documents",
"EMAIL_SUBSCRIPTION_COUNT": "{{emailSubscription}} abonnés aux notifications par email"
},
"EVENT": {
"NODE_STARTED": "Votre noeud ES API <b>{{params[0]}}</b> est démarré",
"NODE_BMA_DOWN": "Le noeud <b>{{params[0]}}:{{params[1]}}</b> (utilisé par votre noeud ES API) est <b>injoignable</b>.",
......
......@@ -35,9 +35,9 @@ angular.module('cesium.es.subscription.controllers', ['cesium.es.services'])
})
.controller('ViewSubscriptionsCtrl', ViewSubscriptionsController)
.controller('ViewSubscriptionsCtrl', ViewSubscriptionsController)
.controller('ModalEmailSubscriptionsCtrl', ModalEmailSubscriptionsController)
.controller('ModalEmailSubscriptionsCtrl', ModalEmailSubscriptionsController)
;
......@@ -260,7 +260,7 @@ function ViewSubscriptionsController($scope, $q, $ionicHistory, csWot, csWallet,
})
.then(function(cat){
if (cat && cat.parent) {
return cat;
return cat;
}
});
};
......@@ -272,7 +272,7 @@ function ViewSubscriptionsController($scope, $q, $ionicHistory, csWot, csWallet,
}
function ModalEmailSubscriptionsController($scope, Modals, csSettings, esHttp, csWot, parameters) {
function ModalEmailSubscriptionsController($scope, Modals, csSettings, esHttp, csWot, esModals, parameters) {
'ngInject';
$scope.frequencies = [
......@@ -290,6 +290,15 @@ function ModalEmailSubscriptionsController($scope, Modals, csSettings, esHttp, c
$scope.recipient = {pubkey: $scope.formData.recipient};
return csWot.extendAll([$scope.recipient]);
}
else {
return esHttp.network.peering.self()
.then(function(res){
if (!res) return;
$scope.formData.recipient = res.pubkey;
$scope.recipient = {pubkey: $scope.formData.recipient};
return csWot.extendAll([$scope.recipient]);
});
}
});
// Submit
......@@ -318,10 +327,9 @@ function ModalEmailSubscriptionsController($scope, Modals, csSettings, esHttp, c
}