Commit 06f26663 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[mod] `members2` => max 100 members (random enabled by default)

parent e9b2c32d
...@@ -67,4 +67,5 @@ NEXT_YN Feign the following Y[n] landing ...@@ -67,4 +67,5 @@ NEXT_YN Feign the following Y[n] landing
MEMBER_FILTER search a member MEMBER_FILTER search a member
EXPIRE_TIME expiration datetime EXPIRE_TIME expiration datetime
RANDOM_LIST Draw lots RANDOM_LIST Draw lots
RANDOM_LIST_END membres (max. 100)
MEMBERS members MEMBERS members
\ No newline at end of file
...@@ -67,4 +67,5 @@ NEXT_YN Simuler le palier Y[n] suivant ...@@ -67,4 +67,5 @@ NEXT_YN Simuler le palier Y[n] suivant
MEMBER_FILTER rechercher un membre MEMBER_FILTER rechercher un membre
EXPIRE_TIME date et heure d'expiration EXPIRE_TIME date et heure d'expiration
RANDOM_LIST Tirer au sort RANDOM_LIST Tirer au sort
RANDOM_LIST_END membres (max. 100)
MEMBERS membres MEMBERS membres
\ No newline at end of file
...@@ -13,5 +13,9 @@ export const MonitConstants = { ...@@ -13,5 +13,9 @@ export const MonitConstants = {
INIT: 2, INIT: 2,
GET_SENTRIES_COUNT: 3, GET_SENTRIES_COUNT: 3,
GET_D_SEN: 3 GET_D_SEN: 3
} },
MEMBERS_VIEW: {
DEFAULT_MEMBERS_RANDOM_NUMBER: 10,
MEMBERS_DISPLAY_MAX: 100,
},
}; };
...@@ -70,8 +70,17 @@ module.exports = async (req: any, res: any, next: any) => { ...@@ -70,8 +70,17 @@ module.exports = async (req: any, res: any, next: any) => {
var centrality = req.query.centrality || "no"; // Valeur par défaut var centrality = req.query.centrality || "no"; // Valeur par défaut
var format = req.query.format || 'HTML'; // Valeur par défaut var format = req.query.format || 'HTML'; // Valeur par défaut
let nextYn = (req.query.nextYn=="yes") ? "yes":"no"; let nextYn = (req.query.nextYn=="yes") ? "yes":"no";
let randomList = (req.query.randomList=="yes") ? "yes":"no"; let randomList = req.query.randomList === 'no' ? 'no' : 'yes';
let numberOfRandomMembers = req.query.randomCounts || 10 let numberOfRandomMembers = parseInt(req.query.randomCounts) || MonitConstants.MEMBERS_VIEW.DEFAULT_MEMBERS_RANDOM_NUMBER
// Recherche aléatoire
if (randomList === 'yes') {
if (isNaN(numberOfRandomMembers)) {
numberOfRandomMembers = MonitConstants.MEMBERS_VIEW.DEFAULT_MEMBERS_RANDOM_NUMBER
}
numberOfRandomMembers = Math.min(numberOfRandomMembers, MonitConstants.MEMBERS_VIEW.MEMBERS_DISPLAY_MAX)
}
// Vérifier la valeur de nextYn dans le cache // Vérifier la valeur de nextYn dans le cache
let lastUpgradeTimeDatas = membersQuality(MonitConstants.QUALITY_CACHE_ACTION.INIT); let lastUpgradeTimeDatas = membersQuality(MonitConstants.QUALITY_CACHE_ACTION.INIT);
......
...@@ -47,8 +47,8 @@ ${printMenu(MENU_LANG, help, "MEMBERS")} ...@@ -47,8 +47,8 @@ ${printMenu(MENU_LANG, help, "MEMBERS")}
<input type="checkbox" name="pendingSigs" value="yes" ${pendingSigs == 'yes' ? 'checked' : ''}>${LANG["CHECKBOX_PENDING_SIGS"]}.<br> <input type="checkbox" name="pendingSigs" value="yes" ${pendingSigs == 'yes' ? 'checked' : ''}>${LANG["CHECKBOX_PENDING_SIGS"]}.<br>
<input type="checkbox" name="mode" value="emitted" ${mode == 'emitted' ? 'checked' : ''}>${LANG["CHECKBOX_MODE_SIG"]}.<br> <input type="checkbox" name="mode" value="emitted" ${mode == 'emitted' ? 'checked' : ''}>${LANG["CHECKBOX_MODE_SIG"]}.<br>
<input type="checkbox" name="nextYn" value="yes" ${nextYn == 'yes' ? 'checked' : ''}> ${LANG["NEXT_YN"]}<br> <input type="checkbox" name="nextYn" value="yes" ${nextYn == 'yes' ? 'checked' : ''}> ${LANG["NEXT_YN"]}<br>
<input type="checkbox" name="randomList" value="yes" ${randomList == 'yes' ? 'checked' : ''}> ${LANG["RANDOM_LIST"]} <input type="checkbox" name="randomList" value="yes" ${randomList == 'yes' ? 'checked' : ''}> ${LANG["RANDOM_LIST"]}
<input type="number" name="randomCounts" value="${numberOfRandomMembers}"/> ${LANG["MEMBERS"]}.<br> <input type="number" name="randomCounts" value="${numberOfRandomMembers}"/> ${LANG["RANDOM_LIST_END"]}.<br>
<hr> <hr>
<!-- Afficher la légende et l'aide --> <!-- Afficher la légende et l'aide -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment