Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
Cesium
Commits
f0fb7f83
Commit
f0fb7f83
authored
2 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Network controller: try code optimization (add a refresh function) (wip)
parent
df92a825
No related branches found
No related tags found
1 merge request
!647
[enh] If node unreachable, select a random UP fallback peer
Pipeline
#16725
skipped
Stage: alt_build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/config.json
+28
-13
28 additions, 13 deletions
app/config.json
www/js/controllers/network-controllers.js
+28
-24
28 additions, 24 deletions
www/js/controllers/network-controllers.js
with
56 additions
and
37 deletions
app/config.json
+
28
−
13
View file @
f0fb7f83
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
"helptip"
:
{
"helptip"
:
{
"enable"
:
true
,
"enable"
:
true
,
"installDocUrl"
:
{
"installDocUrl"
:
{
"fr-FR"
:
"https://duniter.
org/fr/miner-des-bl
oc
s
/installer/"
,
"fr-FR"
:
"https://duniter.
fr/wiki/d
oc/installer/"
,
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
}
}
},
},
...
@@ -27,7 +27,9 @@
...
@@ -27,7 +27,9 @@
"en"
:
"license/license_g1-en"
,
"en"
:
"license/license_g1-en"
,
"fr-FR"
:
"license/license_g1-fr-FR"
,
"fr-FR"
:
"license/license_g1-fr-FR"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"eo-EO"
:
"license/license_g1-eo-EO"
"eo-EO"
:
"license/license_g1-eo-EO"
,
"it-IT"
:
"license/license_g1-it-IT"
,
"pt-PT"
:
"license/license_g1-pt-PT"
},
},
"feed"
:
{
"feed"
:
{
"jsonFeed"
:
{
"jsonFeed"
:
{
...
@@ -117,15 +119,17 @@
...
@@ -117,15 +119,17 @@
"helptip"
:
{
"helptip"
:
{
"enable"
:
true
,
"enable"
:
true
,
"installDocUrl"
:
{
"installDocUrl"
:
{
"fr-FR"
:
"https://duniter.
org/fr/miner-des-bl
oc
s
/installer/"
,
"fr-FR"
:
"https://duniter.
fr/wiki/d
oc/installer/"
,
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
}
}
},
},
"license"
:
{
"license"
:
{
"fr-FR"
:
"license/license_g1-fr-FR"
,
"en"
:
"license/license_g1-en"
,
"en"
:
"license/license_g1-en"
,
"fr-FR"
:
"license/license_g1-fr-FR"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"eo-EO"
:
"license/license_g1-eo-EO"
"eo-EO"
:
"license/license_g1-eo-EO"
,
"it-IT"
:
"license/license_g1-it-IT"
,
"pt-PT"
:
"license/license_g1-pt-PT"
},
},
"feed"
:
{
"feed"
:
{
"jsonFeed"
:
{
"jsonFeed"
:
{
...
@@ -221,7 +225,7 @@
...
@@ -221,7 +225,7 @@
"helptip"
:
{
"helptip"
:
{
"enable"
:
false
,
"enable"
:
false
,
"installDocUrl"
:
{
"installDocUrl"
:
{
"fr-FR"
:
"https://duniter.
org/fr/miner-des-bl
oc
s
/installer/"
,
"fr-FR"
:
"https://duniter.
fr/wiki/d
oc/installer/"
,
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
}
}
},
},
...
@@ -279,15 +283,17 @@
...
@@ -279,15 +283,17 @@
"helptip"
:
{
"helptip"
:
{
"enable"
:
false
,
"enable"
:
false
,
"installDocUrl"
:
{
"installDocUrl"
:
{
"fr-FR"
:
"https://duniter.
org/
fr/wiki/d
uniter
/installer/"
,
"fr-FR"
:
"https://duniter.fr/wiki/d
oc
/installer/"
,
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
}
}
},
},
"license"
:
{
"license"
:
{
"fr-FR"
:
"license/license_g1-fr-FR"
,
"en"
:
"license/license_g1-en"
,
"en"
:
"license/license_g1-en"
,
"fr-FR"
:
"license/license_g1-fr-FR"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"eo-EO"
:
"license/license_g1-eo-EO"
"eo-EO"
:
"license/license_g1-eo-EO"
,
"it-IT"
:
"license/license_g1-it-IT"
,
"pt-PT"
:
"license/license_g1-pt-PT"
},
},
"node"
:
{
"node"
:
{
"host"
:
"g1.e-is.pro"
,
"host"
:
"g1.e-is.pro"
,
...
@@ -300,6 +306,10 @@
...
@@ -300,6 +306,10 @@
{
{
"host"
:
"g1.e-is.pro"
,
"host"
:
"g1.e-is.pro"
,
"port"
:
443
"port"
:
443
},
{
"host"
:
"g1.librelois.fr"
,
"port"
:
443
}
}
],
],
"plugins"
:{
"plugins"
:{
...
@@ -354,13 +364,18 @@
...
@@ -354,13 +364,18 @@
"httpsMode"
:
false
,
"httpsMode"
:
false
,
"helptip"
:
{
"helptip"
:
{
"enable"
:
false
,
"enable"
:
false
,
"installDocUrl"
:
"https://github.com/duniter/duniter/blob/master/doc/install-a-node.md"
"installDocUrl"
:
{
"fr-FR"
:
"https://duniter.fr/wiki/doc/installer/"
,
"en"
:
"https://duniter.org/en/wiki/duniter/install/"
}
},
},
"license"
:
{
"license"
:
{
"
fr-FR
"
:
"license/license_g1-
fr-FR.txt
"
,
"
en
"
:
"license/license_g1-
en
"
,
"
en
"
:
"license/license_g1-
en.txt
"
,
"
fr-FR
"
:
"license/license_g1-
fr-FR
"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"es-ES"
:
"license/license_g1-es-ES"
,
"eo-EO"
:
"license/license_g1-eo-EO"
"eo-EO"
:
"license/license_g1-eo-EO"
,
"it-IT"
:
"license/license_g1-it-IT"
,
"pt-PT"
:
"license/license_g1-pt-PT"
},
},
"node"
:
{
"node"
:
{
"host"
:
"g1.duniter.org"
,
"host"
:
"g1.duniter.org"
,
...
...
This diff is collapsed.
Click to expand it.
www/js/controllers/network-controllers.js
+
28
−
24
View file @
f0fb7f83
...
@@ -162,39 +162,43 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win
...
@@ -162,39 +162,43 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win
// Start network scan
// Start network scan
csNetwork
.
start
(
$scope
.
node
,
$scope
.
computeOptions
())
csNetwork
.
start
(
$scope
.
node
,
$scope
.
computeOptions
())
.
then
(
function
()
{
.
then
(
function
()
{
if
(
!
$scope
.
refreshing
)
{
$scope
.
refresh
();
$scope
.
refreshing
=
true
;
csWot
.
extendAll
(
csNetwork
.
data
.
peers
)
.
then
(
function
()
{
// Avoid to refresh if view has been leaving
if
(
$scope
.
networkStarted
)
{
$scope
.
updateView
(
csNetwork
.
data
);
}
$scope
.
refreshing
=
false
;
});
}
});
});
// Catch event on new peers
// Catch event on new peers
$scope
.
listeners
.
push
(
$scope
.
listeners
.
push
(
csNetwork
.
api
.
data
.
on
.
changed
(
$scope
,
function
(
data
)
{
csNetwork
.
api
.
data
.
on
.
changed
(
$scope
,
function
(
data
)
{
if
(
!
$scope
.
refreshing
)
{
$scope
.
refresh
(
data
);
}));
}
// Show help tip
$scope
.
showHelpTip
();
};
$scope
.
refresh
=
function
(
data
)
{
data
=
csNetwork
.
data
||
data
;
if
(
!
data
||
$scope
.
refreshing
/*|| !$scope.networkStarted*/
)
return
;
// Skip if no data, or already refreshing
// Mark as refreshing
$scope
.
refreshing
=
true
;
$scope
.
refreshing
=
true
;
// Add name+avatar to peers
csWot
.
extendAll
(
data
.
peers
)
csWot
.
extendAll
(
data
.
peers
)
.
then
(
function
()
{
.
then
(
function
()
{
// Avoid to refresh if view has been leaving
// Avoid to refresh if view has been leaving
if
(
$scope
.
networkStarted
)
{
if
(
$scope
.
networkStarted
)
{
$scope
.
updateView
(
data
);
$scope
.
updateView
(
data
);
}
}
})
.
catch
(
function
(
err
)
{
console
.
error
(
err
);
// Continue
})
.
then
(
function
()
{
$scope
.
refreshing
=
false
;
$scope
.
refreshing
=
false
;
});
});
}
}
}));
}
// Show help tip
$scope
.
showHelpTip
();
};
$scope
.
updateView
=
function
(
data
)
{
$scope
.
updateView
=
function
(
data
)
{
console
.
debug
(
"
[peers] Updating UI
"
);
console
.
debug
(
"
[peers] Updating UI
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment