diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 2ecd73d33294f3b2f9ea53652d8746a09a59f9ae..c530041dbb66524f7636b1aa4be000835c233abb 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -82,7 +82,7 @@ }, "ABOUT": { "TITLE": "About", - "LICENSE": "<b>Free/libre</b> software (GNU GPLv3 license).", + "LICENSE": "<b>Free/libre software</b> (License GNU GPLv3).", "CODE": "Source code:", "DEVELOPERS": "Developers:", "FORUM": "Forum:", @@ -108,8 +108,8 @@ "SETTINGS": { "TITLE": "Settings", "NETWORK_SETTINGS": "Network", - "NODE": "Duniter node address", - "NODE_HELP": "server.domain.com:port", + "PEER": "Duniter peer address", + "PEER_HELP": "server.domain.com:port", "USE_LOCAL_STORAGE": "Enable local storage", "ENABLE_HELPTIP": "Enable contextual help tips", "HISTORY_SETTINGS": "My Account", @@ -119,10 +119,11 @@ "PLUGINS_SETTINGS": "Extensions", "BTN_RESET": "Restore default values", "EXPERT_MODE": "Enable expert mode<span class=\"hidden-xs\">(display more details)</span>", - "POPUP_NODE": { + "POPUP_PEER": { "TITLE" : "Duniter Node", - "HELP" : "Set the address of the node to use:" - } + "HELP" : "Set the address of the peer to use:", + "BTN_SHOW_LIST" : "Show peer's list" + }, }, "CURRENCY": { "SELECT": { @@ -161,7 +162,11 @@ "PEERS": "Peers", "KNOWN_PEERS": "Known peers", "SIGNED_ON_BLOCK": "Signed on block", - "MIRROR": "mirror" + "MIRROR": "mirror", + "MIRRORS": "Mirror peers", + "PEER_LIST" : "Peer's list", + "MEMBERS" : "Member peers", + "ALL_PEERS" : "All peers" }, "WOT": { "SEARCH_HELP": "Search (member or public key)", @@ -225,13 +230,13 @@ "SHOW_SALT": "See Protection phrase", "PASSWORD": "Password", "PASSWORD_HELP": "Password", - "NO_ACCOUNT_QUESTION": "Do not have an account yet?", + "NO_ACCOUNT_QUESTION": "Don't have an account yet?", "CREATE_ACCOUNT": "Create an account" }, "ACCOUNT": { "TITLE": "My Account", "BALANCE": "Balance", - "LAST_TX": "Last transactions", + "LAST_TX": "Latest transactions", "NO_TX": "No transaction", "SHOW_MORE_TX": "Show more", "SHOW_ALL_TX": "Show all", @@ -241,7 +246,7 @@ "ERROR_TX_SENT": "Sent transactions", "ERROR_TX_RECEIVED": "Received transactions", "EVENTS": "Events", - "WAITING_MEMBERSHIP": "Membership sent. Waiting validation.", + "WAITING_MEMBERSHIP": "Membership request sent. Waiting validation.", "WAITING_CERTIFICATIONS": "You need {{needCertificationCount}} certification(s) to become a member", "WILL_MISSING_CERTIFICATIONS": "You will <b>lack certifications</b> soon (at least {{willNeedCertificationCount}} more are needed)", "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renewing your membership</a> before then.", @@ -255,33 +260,33 @@ "BTN_REVOKE": "Revoke<span class='hidden-xs hidden-sm'> definitely</span> this identity...", "BTN_SHOW_DETAILS": "Display public key", "NEW": { - "TITLE": "New Account", - "SLIDE_1_TITLE": "Select a money:", + "TITLE": "Registration", + "SLIDE_1_TITLE": "Select a currency:", "SLIDE_2_TITLE": "Kind of account:", "MEMBER_ACCOUNT": "Member account", - "MEMBER_ACCOUNT_HELP": "If you are not yet registered as an individual (One account possible by individual).", + "MEMBER_ACCOUNT_HELP": "If you are not yet registered as an individual (one account possible per individual).", "WALLET_ACCOUNT": "Simple wallet", "WALLET_ACCOUNT_HELP": "If you represent a company, association, etc. or simply need an additional wallet. No universal dividend will be created by this account.", - "SALT_WARNING": "Choose a protection phrase.<br/>You need it for each connection on this account.<br/><br/><b>Make sure to remember this phrase</b>.<br/>If lost, there is no mean to retrieve it !", - "PASSWORD_WARNING": "Choose a password.<br/>You need it for each connection on this account.<br/><br/><b>Make sure to remember this phrase</b>.<br/>If lost, there is no mean to retrieve it !", - "PSEUDO_WARNING": "Choose a pseudonym.<br/>It will be used by other people, to find you easily.<br/><br/>.Commas and accent characters are not allowed.<br/><div class='hidden-xs'><br/>Example : <span class='gray'>JohnDalton, JackieChan, etc.</span>", + "SALT_WARNING": "Choose a protection phrase.<br/>You need it for each connection to this account.<br/><br/><b>Make sure to remember this phrase</b>.<br/>If lost, there are no means to retrieve it!", + "PASSWORD_WARNING": "Choose a password.<br/>You need it for each connection to this account.<br/><br/><b>Make sure to remember this phrase</b>.<br/>If lost, there are no means to retrieve it!", + "PSEUDO_WARNING": "Choose a pseudonym.<br/>It may be used by other people to find you more easily.<br/><br/>.Use of <b>commas, spaces and accents</b> is not allowed.<br/><div class='hidden-xs'><br/>Example: <span class='gray'>JohnDalton, JackieChan, etc.</span>", "PSEUDO": "Pseudonym", "PSEUDO_HELP": "joe123", - "SALT_CONFIRM": "Confirm phrase", - "SALT_CONFIRM_HELP": "Confirm phrase", - "PASSWORD_CONFIRM": "Confirm Password", - "PASSWORD_CONFIRM_HELP": "Confirm Password", + "SALT_CONFIRM": "Confirm", + "SALT_CONFIRM_HELP": "Confirm the protection phrase", + "PASSWORD_CONFIRM": "Confirm", + "PASSWORD_CONFIRM_HELP": "Confirm the password", "SLIDE_6_TITLE": "Confirmation:", "COMPUTING_PUBKEY": "Computing...", - "LAST_SLIDE_CONGRATULATION": "You completed all required fields.<br/><b>You can send the account creation request</b>.<br/><br/>For information, the public key below identifies your future account.<br/>It can be communicated to third parties to receive their payment.", + "LAST_SLIDE_CONGRATULATION": "You completed all required fields.<br/><b>You can send the account creation request</b>.<br/><br/>For information, the public key below identifies your future account.<br/>It can be communicated to third parties to receive their payment.<br/>Once your account has been approved, you can find this key under <b>{{'ACCOUNT.TITLE'|translate}}</b>.", "CONFIRMATION_MEMBER_ACCOUNT": "<b class=\"assertive\">Warning:</b> your protection phrase, password and pseudonym can not be changed.<br/><b>Make sure you always remember it!</b><br/><b>Are you sure</b> you want to send this account creation request?", "CONFIRMATION_WALLET_ACCOUNT": "<b class=\"assertive\">Warning:</b> your password and pseudonym can not be changed.<br/><b>Make sure you always remember it!</b><br/><b>Are you sure</b> you want to send this account creation request?", "MSG_UID_ALREADY_USED": "This pseudonym is already used by an existing member.<br/>Please choose another one.", - "MSG_PUBKEY_ALREADY_USED": "Public key already used by an existing member.<br/>Please choose another connection parameters." + "MSG_PUBKEY_ALREADY_USED": "Public key already used by an existing member.<br/>Please choose other connection parameters." }, "POPUP_REGISTER": { "TITLE": "Enter a pseudonym", - "HELP": "A pseudonym is need to let other members find you." + "HELP": "A pseudonym is needed to let other members find you." } }, "TRANSFER": { @@ -339,20 +344,21 @@ "SCAN_FAILED": "Could not scan QR code.", "SCAN_UNKNOWN_FORMAT": "Code not recognized.", "WOT_LOOKUP_FAILED": "Search failed.", - "LOAD_NODE_DATA_FAILED": "Duniter Node not accessible. Please retry later.", + "LOAD_PEER_DATA_FAILED": "Duniter peer not accessible. Please retry later.", "NEED_LOGIN_FIRST": "Please sign in first.", "AMOUNT_REQUIRED": "Amount is required.", "AMOUNT_NEGATIVE": "Negative amount not allowed.", "NOT_ENOUGH_CREDIT": "Not enough credit.", - "INVALID_NODE_SUMMARY": "Unreachable node or invalid address", + "INVALID_NODE_SUMMARY": "Unreachable peer or invalid address", "INVALID_USER_ID": "Field 'pseudonym' must not contains spaces or special characters.", "INVALID_COMMENT": "Field 'reference' has a bad format.", "INVALID_PUBKEY": "Public key has a bad format.", - "IDENTITY_INVALID_BLOCK_HASH": "This membership application is no longer valid (because it references a block that network nodes are cancelled): the person must renew its application for membership <b>before</b> being certified.", + "IDENTITY_REVOKED": "This identity <b>has been revoked {{revocationTime|formatFromNow}}</b> ({{revocationTime|formatDate}}). It can no longer become a member.", + "IDENTITY_INVALID_BLOCK_HASH": "This membership application is no longer valid (because it references a block that network peers are cancelled): the person must renew its application for membership <b>before</b> being certified.", "IDENTITY_EXPIRED": "This identity has expired: this person must re-apply <b>before</b> being certified.", - "IDENTITY_SANDBOX_FULL": "Could not register, because node's sandbox is full.<br/><br/>Please retry later or choose another Duniter node (in <b>Settings</b>).", + "IDENTITY_SANDBOX_FULL": "Could not register, because peer's sandbox is full.<br/><br/>Please retry later or choose another Duniter peer (in <b>Settings</b>).", "WOT_PENDING_INVALID_BLOCK_HASH": "Membership not valid.", - "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network nodes are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", + "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network peers are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", "WALLET_IDENTITY_EXPIRED": "The publication of your identity <b>has expired</b>.<br/>You must <a ng-click=\"doQuickFix('fixIdentity')\">re-issue your identity</a> to resolve this issue.", "WALLET_HAS_NO_SELF": "Your identity must first have been published, and not expired.", "IDENTITY_ALREADY_CERTIFY": "You have <b>already certified</b> that identity.<br/><br/>Your certificate is still valid (expires {{expiresIn|formatDuration}}).", @@ -361,17 +367,20 @@ "LOAD_NEWCOMERS_FAILED": "Unable to load new members.", "LOAD_PENDING_FAILED": "Unable to load pending registrations.", "ONLY_MEMBER_CAN_EXECUTE_THIS_ACTION": "You must <b>be a member</b> in order to perform this action.", - "ONLY_SELF_CAN_EXECUTE_THIS_ACTION": "You must have <b>published your identity</b> in order to perform this action." + "ONLY_SELF_CAN_EXECUTE_THIS_ACTION": "You must have <b>published your identity</b> in order to perform this action.", + "REVOCATION_FAILED": "Error while trying to revoke the identity." }, "INFO": { "POPUP_TITLE": "Information", "CERTIFICATION_DONE": "Identity successfully signed", "NOT_ENOUGH_CREDIT": "Not enough credit", "TRANSFER_SENT": "Transfer request successfully sent", - "COPY_TO_CLIPBOARD_DONE": "Copy succeed", + "COPY_TO_CLIPBOARD_DONE": "Copy succeeded", "MEMBERSHIP_OUT_SENT": "Membership revocation sent", "NOT_NEED_MEMBERSHIP": "Already a member.", "IDENTITY_WILL_MISSING_CERTIFICATIONS": "This identity will soon lack certification (at least {{willNeedCertificationCount}}).", + "REVOCATION_SENT": "Revocation sent successfully", + "REVOCATION_SENT_WAITING_PROCESS": "Revocation <b>has been sent successfully</b>. It is awaiting processing." }, "CONFIRM": { "POPUP_TITLE": "<b>Confirmation</b>", @@ -379,12 +388,12 @@ "CERTIFY_RULES_TITLE_UID": "Certify {{uid}}", "CERTIFY_RULES": "<b>Security warning:</b><br/><br/><b class=\"assertive\">Don't certify an account</b> if you believe that: <ul><li>1.) the issuers identity might be faked.<li>2.) the issuer already has another certified account.<li>3.) the issuer purposely or carelessly violates rule 1 or 2 (he certifies faked or double accounts).</ul></small><br/>Are you sure you want to certify this identity?", "TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer?</b>", - "MEMBERSHIP_OUT": "<b>Warning</b>:<br/>You are going to terminate your membership. This operation is irreversible<br/></br/><b>Are you sure you want to continue?</b>", - "LOGIN_UNUSED_WALLET_TITLE": "Typing error ?", + "MEMBERSHIP_OUT": "<b>Warning</b>:<br/>You are going to terminate your membership. This operation is <b>irreversible</b>.<br/></br/><b>Are you sure you want to continue?</b>", + "LOGIN_UNUSED_WALLET_TITLE": "Typing error?", "LOGIN_UNUSED_WALLET": "You are logged into an account that seems <b>inactive</b>.<br/><br/>If this account does not match yours, it's probably a <b>typing error</b> when sign in.<br/><br/><b>Would you still continue with this account?</b>", "FIX_IDENTITY": "The pseudonym <b>{{uid}}</b> will be published again, replacing the old publication that has expired.<br/></br/><b>Are you sure</b> you want to continue?", - "FIX_MEMBERSHIP": "Your application for membership will be sent.<br/></br/><b>Are you sure ?</b>", - "RENEW_MEMBERSHIP": "Your membership will be renewed.<br/></br/><b>Are you sure ?</b>", + "FIX_MEMBERSHIP": "Your application for membership will be sent.<br/></br/><b>Are you sure?</b>", + "RENEW_MEMBERSHIP": "Your membership will be renewed.<br/></br/><b>Are you sure?</b>", "REVOKE_IDENTITY": "<b>Security warning </b> :<br/>You will <b>definitely revoke this identity</b>.<br/><br/>The public key and the associated nickname <b>will never be used again</b> (for a member account).<br/></br/><b>Are you sure</b> you want to continue?", "REVOKE_IDENTITY_2": "This operation is <b>irreversible</b>!<br/><br/><b>Are you sure</b> you want to continue?", "NOT_NEED_RENEW_MEMBERSHIP": "Your membership does not need to be renewed (it will only expire in {{membershipExpiresIn|formatDuration}}).<br/></br/><b>Are you sure you</b> want to renew your membership?", @@ -395,9 +404,9 @@ "TITLE": "Online help", "JOIN": { "SECTION": "Join", - "SALT": "The protection phrase is very important. It is used to hash you password, which in turn is used to calculate your <span class=\"text-italic\">public account key</span> (its number) and the private key to access it. <b>Please remeber this phrase well</b>, because there is no way to recover it when lost. What's more, it cannot be changed without having to create a new account.<br/><br/>A good protection phrase must be sufficiently long (8 characters at the very least) and as original as possible.", - "PASSWORD": "The password is very important. Together with the protection phrase, it is use to calculate your account number (public key) and the private key to access it. <b>Please remember it well</b>, because there is no way to recover it when lost. What's more, it cannot be changed without having to create a new account.<br/><br/>A good password is made (ideally) of at least 8 characters, with at least one capital and one number.", - "PSEUDO": "A pseudonym is used only when joining as <span class=\"text-italic\">member</span>. It is always associated with a wallet (by its <span class=\"text-italic\">public key</span>). It is published on the network so that other users may identify it, certify or send money to the account. A pseudonym must be unique among all members (current and past)." + "SALT": "The protection phrase is very important. It is used to hash you password, which in turn is used to calculate your <span class=\"text-italic\">public account key</span> (its number) and the private key to access it.<br/><b>Please remeber this phrase well</b>, because there is no way to recover it when lost.<br/>Furthermore, it cannot be changed without having to create a new account.<br/><br/>A good protection phrase must be sufficiently long (8 characters at the very least) and as original as possible.", + "PASSWORD": "The password is very important. Together with the protection phrase, it is use to calculate your account number (pblic key) and the private key to access it.<br/><b>Please remember it well</b>, because there is no way to recover it when lost.<br/>Furthermore, it cannot be changed without having to create a new account.<br/><br/>A good password is made (ideally) of at least 8 characters, with at least one capital and one number.", + "PSEUDO": "A pseudonym is used only when joining as <span class=\"text-italic\">member</span>. It is always associated with a wallet (by its <span class=\"text-italic\">public key</span>).<br/>It is published on the network so that other users may identify it, certify or send money to the account.<br/>A pseudonym must be unique among all members (current and past)." }, "GLOSSARY": { "SECTION": "Glossary", @@ -419,9 +428,9 @@ "CURRENCY_CHANGE_UNIT_TO_RELATIVE": "This button allows to <b>switch the unit</b> to show amounts in “<b>{{'COMMON.UD'|translate}}<sub>{{currency|abbreviate}}</sub></b>”, which is relative to the Universal Dividend (the amount co-produced by each member).", "CURRENCY_RULES": "The <b>rules</b> of the currency determine its <b>exact and predictible</b> performance.<br/><br/>As a true DNA of the currency these rules make the monetary code <b>transparent and understandable</b>.", "CURRENCY_BLOCKCHAIN": "All monetary transactions are recoded in a <b>public and tamper proof</b> ledger, generally referred to as the <b>blockchain</b>.", - "CURRENCY_PEERS": "The <b>nodes</b> shown here corrrespond to <b>computers that update and check</b> the blokchain.<br/><br/>The more active nodes there are, the more <b>decentralised</b> and therefore trustworhty the currency becomes.", - "CURRENCY_PEERS_BLOCK_NUMBER": "This <b>number</b> indicates the node's <b>latest validated block</b> (last page written in the ledger).<br/><br/>Green indicates that the block was equally validated by the <b>majority of other nodes</b>.", - "CURRENCY_PEERS_PARTICIPATE": "<b>Each member</b>, equiped with a computer with Internet, <b>can participate, adding a node</b> simply by <b>installing the Duniter software</b> (free/libre). <a target=\"_new\" href=\"{{installDocUrl}}\">Read the installation manual >></a>.", + "CURRENCY_PEERS": "The <b>peers</b> shown here correspond to <b>computers that update and check</b> the blockchain.<br/><br/>The more active peers there are, the more <b>decentralised</b> and therefore trustworhty the currency becomes.", + "CURRENCY_PEERS_BLOCK_NUMBER": "This <b>number</b> indicates the peer's <b>latest validated block</b> (last page written in the ledger).<br/><br/>Green indicates that the block was equally validated by the <b>majority of other peers</b>.", + "CURRENCY_PEERS_PARTICIPATE": "<b>Each member</b>, equiped with a computer with Internet, <b>can participate, adding a peer</b> simply by <b>installing the Duniter software</b> (free/libre). <a target=\"_new\" href=\"{{installDocUrl}}\">Read the installation manual >></a>.", "MENU_BTN_ACCOUNT": "<b>{{'ACCOUNT.TITLE'|translate}}</b> allows access to your account balance and transaction history.", "MENU_BTN_ACCOUNT_MEMBER": "Here you can consult your account status, transaction history and your certifications.", "WALLET_CERTIFICATIONS": "Click here to reveiw the details of your certifications (given and received).", diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index cd94260b484230c2ef105ab79144aeebeaf18d34..2e32df27133a387724f7898cb4b36546c96d868d 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -108,8 +108,8 @@ "SETTINGS": { "TITLE": "Settings", "NETWORK_SETTINGS": "Network", - "NODE": "Duniter node address", - "NODE_HELP": "server.domain.com:port", + "PEER": "Duniter peer address", + "PEER_HELP": "server.domain.com:port", "USE_LOCAL_STORAGE": "Enable local storage", "ENABLE_HELPTIP": "Enable contextual help tips", "HISTORY_SETTINGS": "My Account", @@ -119,12 +119,11 @@ "PLUGINS_SETTINGS": "Extensions", "BTN_RESET": "Restore default values", "EXPERT_MODE": "Enable expert mode<span class=\"hidden-xs\">(display more details)</span>", - "POPUP_NODE": { + "POPUP_PEER": { "TITLE" : "Duniter Node", - "HELP" : "Set the address of the node to use:" + "HELP" : "Set the address of the peer to use:", + "BTN_SHOW_LIST" : "Show peer's list" }, - "SHOW_NODE_LIST" : "Choose a node" - }, "CURRENCY": { "SELECT": { @@ -164,9 +163,10 @@ "KNOWN_PEERS": "Known peers", "SIGNED_ON_BLOCK": "Signed on block", "MIRROR": "mirror", - "NODE_LIST" : "Node's list", - "MEMBERS" : "Member Nodes", - "ALL_NODES" : "All nodes" + "MIRRORS": "Mirror peers", + "PEER_LIST" : "Peer's list", + "MEMBERS" : "Member peers", + "ALL_PEERS" : "All peers" }, "WOT": { "SEARCH_HELP": "Search (member or public key)", @@ -237,7 +237,7 @@ "TITLE": "My Account", "BALANCE": "Balance", "LAST_TX": "Latest transactions", - "NO_TX": "No transactions", + "NO_TX": "No transaction", "SHOW_MORE_TX": "Show more", "SHOW_ALL_TX": "Show all", "TX_FROM_DATE": "(current limit to {{fromTime|formatFromNowShort}})", @@ -344,21 +344,21 @@ "SCAN_FAILED": "Could not scan QR code.", "SCAN_UNKNOWN_FORMAT": "Code not recognized.", "WOT_LOOKUP_FAILED": "Search failed.", - "LOAD_NODE_DATA_FAILED": "Duniter Node not accessible. Please retry later.", + "LOAD_PEER_DATA_FAILED": "Duniter peer not accessible. Please retry later.", "NEED_LOGIN_FIRST": "Please sign in first.", "AMOUNT_REQUIRED": "Amount is required.", "AMOUNT_NEGATIVE": "Negative amount not allowed.", "NOT_ENOUGH_CREDIT": "Not enough credit.", - "INVALID_NODE_SUMMARY": "Unreachable node or invalid address", + "INVALID_NODE_SUMMARY": "Unreachable peer or invalid address", "INVALID_USER_ID": "Field 'pseudonym' must not contains spaces or special characters.", "INVALID_COMMENT": "Field 'reference' has a bad format.", "INVALID_PUBKEY": "Public key has a bad format.", "IDENTITY_REVOKED": "This identity <b>has been revoked {{revocationTime|formatFromNow}}</b> ({{revocationTime|formatDate}}). It can no longer become a member.", - "IDENTITY_INVALID_BLOCK_HASH": "This membership application is no longer valid (because it references a block that network nodes are cancelled): the person must renew its application for membership <b>before</b> being certified.", + "IDENTITY_INVALID_BLOCK_HASH": "This membership application is no longer valid (because it references a block that network peers are cancelled): the person must renew its application for membership <b>before</b> being certified.", "IDENTITY_EXPIRED": "This identity has expired: this person must re-apply <b>before</b> being certified.", - "IDENTITY_SANDBOX_FULL": "Could not register, because node's sandbox is full.<br/><br/>Please retry later or choose another Duniter node (in <b>Settings</b>).", + "IDENTITY_SANDBOX_FULL": "Could not register, because peer's sandbox is full.<br/><br/>Please retry later or choose another Duniter peer (in <b>Settings</b>).", "WOT_PENDING_INVALID_BLOCK_HASH": "Membership not valid.", - "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network nodes are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", + "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network peers are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", "WALLET_IDENTITY_EXPIRED": "The publication of your identity <b>has expired</b>.<br/>You must <a ng-click=\"doQuickFix('fixIdentity')\">re-issue your identity</a> to resolve this issue.", "WALLET_HAS_NO_SELF": "Your identity must first have been published, and not expired.", "IDENTITY_ALREADY_CERTIFY": "You have <b>already certified</b> that identity.<br/><br/>Your certificate is still valid (expires {{expiresIn|formatDuration}}).", @@ -428,9 +428,9 @@ "CURRENCY_CHANGE_UNIT_TO_RELATIVE": "This button allows to <b>switch the unit</b> to show amounts in “<b>{{'COMMON.UD'|translate}}<sub>{{currency|abbreviate}}</sub></b>”, which is relative to the Universal Dividend (the amount co-produced by each member).", "CURRENCY_RULES": "The <b>rules</b> of the currency determine its <b>exact and predictible</b> performance.<br/><br/>As a true DNA of the currency these rules make the monetary code <b>transparent and understandable</b>.", "CURRENCY_BLOCKCHAIN": "All monetary transactions are recoded in a <b>public and tamper proof</b> ledger, generally referred to as the <b>blockchain</b>.", - "CURRENCY_PEERS": "The <b>nodes</b> shown here corrrespond to <b>computers that update and check</b> the blokchain.<br/><br/>The more active nodes there are, the more <b>decentralised</b> and therefore trustworhty the currency becomes.", - "CURRENCY_PEERS_BLOCK_NUMBER": "This <b>number</b> indicates the node's <b>latest validated block</b> (last page written in the ledger).<br/><br/>Green indicates that the block was equally validated by the <b>majority of other nodes</b>.", - "CURRENCY_PEERS_PARTICIPATE": "<b>Each member</b>, equiped with a computer with Internet, <b>can participate, adding a node</b> simply by <b>installing the Duniter software</b> (free/libre). <a target=\"_new\" href=\"{{installDocUrl}}\">Read the installation manual >></a>.", + "CURRENCY_PEERS": "The <b>peers</b> shown here correspond to <b>computers that update and check</b> the blockchain.<br/><br/>The more active peers there are, the more <b>decentralised</b> and therefore trustworhty the currency becomes.", + "CURRENCY_PEERS_BLOCK_NUMBER": "This <b>number</b> indicates the peer's <b>latest validated block</b> (last page written in the ledger).<br/><br/>Green indicates that the block was equally validated by the <b>majority of other peers</b>.", + "CURRENCY_PEERS_PARTICIPATE": "<b>Each member</b>, equiped with a computer with Internet, <b>can participate, adding a peer</b> simply by <b>installing the Duniter software</b> (free/libre). <a target=\"_new\" href=\"{{installDocUrl}}\">Read the installation manual >></a>.", "MENU_BTN_ACCOUNT": "<b>{{'ACCOUNT.TITLE'|translate}}</b> allows access to your account balance and transaction history.", "MENU_BTN_ACCOUNT_MEMBER": "Here you can consult your account status, transaction history and your certifications.", "WALLET_CERTIFICATIONS": "Click here to reveiw the details of your certifications (given and received).", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index f02a705fc44eb3427178954be06466a150ac5dbf..5ce8901fc55a2a2a8f8547b0dd887f44d4cbdec6 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -108,8 +108,8 @@ "SETTINGS": { "TITLE": "Paramètres", "NETWORK_SETTINGS": "Réseau", - "NODE": "Adresse du nœud Duniter", - "NODE_HELP": "server.domain.com:port", + "PEER": "Adresse du nœud Duniter", + "PEER_HELP": "server.domain.com:port", "USE_LOCAL_STORAGE": "Activer le stockage local", "ENABLE_HELPTIP": "Activer les bulles d'aide<span class=\"hidden-xs\"> contextuelles</span>", "HISTORY_SETTINGS": "Mon compte", @@ -119,11 +119,11 @@ "PLUGINS_SETTINGS": "Extensions", "BTN_RESET": "Restaurer les valeurs par défaut", "EXPERT_MODE": "Activer le mode expert<span class=\"hidden-xs\">(affichage plus détaillé)</span>", - "POPUP_NODE": { + "POPUP_PEER": { "TITLE" : "Nœud Duniter", - "HELP" : "Saisissez l'adresse du nœud que vous voulez utiliser :" + "HELP" : "Saisissez l'adresse du nœud que vous voulez utiliser :", + "BTN_SHOW_LIST" : "Voir la liste des nœuds" }, - "SHOW_NODE_LIST" : "ou choisissez dans la liste" }, "CURRENCY": { "SELECT": { @@ -143,7 +143,6 @@ "SHARE": "Masse par membre", "UD": "Dividende universel", "C_ACTUAL": "Croissance actuelle", - "BLOCKCHAIN_DIVIDER": "Blockchain", "TIME": "Heure de la blockchain", "POW_MIN": "Niveau de difficulté", "MONEY_RULES_DIVIDER": "Règles de la monnaie", @@ -164,9 +163,10 @@ "KNOWN_PEERS": "Nœuds connus", "SIGNED_ON_BLOCK": "Signé sur le bloc", "MIRROR": "mirroir", - "NODE_LIST" : "Liste des noeuds", - "MEMBERS" : "Noeuds membres", - "ALL_NODES" : "Tous les noeuds" + "MIRRORS": "Nœuds mirroirs", + "PEER_LIST" : "Liste des nœuds", + "MEMBERS" : "Nœuds membres", + "ALL_PEERS" : "Tous les nœuds" }, "WOT": { "SEARCH_HELP": "Recherche (pseudo ou clé publique)", @@ -344,7 +344,7 @@ "SCAN_FAILED": "Echec du scan de QR Code", "SCAN_UNKNOWN_FORMAT": "Code non reconnu.", "WOT_LOOKUP_FAILED": "Echec de la recherche", - "LOAD_NODE_DATA_FAILED": "Lecture du nœud Duniter impossible. Veuillez réessayer ultérieurement.", + "LOAD_PEER_DATA_FAILED": "Lecture du nœud Duniter impossible. Veuillez réessayer ultérieurement.", "NEED_LOGIN_FIRST": "Veuillez d'abord vous connecter.", "AMOUNT_REQUIRED": "Le montant est obligatoire.", "AMOUNT_NEGATIVE": "Montant négatif non autorisé.", diff --git a/www/i18n/locale-nl-NL.json b/www/i18n/locale-nl-NL.json index 722007c9d2e7ec8a5c3d1da3a0beb883111f4454..b7125d33840da5de64ade64345d6e0f5863343a6 100644 --- a/www/i18n/locale-nl-NL.json +++ b/www/i18n/locale-nl-NL.json @@ -108,8 +108,8 @@ "SETTINGS": { "TITLE": "Instellingen", "NETWORK_SETTINGS": "Netwerk", - "NODE": "Duniter knooppunt adres", - "NODE_HELP": "server.domein.com:poort", + "PEER": "Duniter knooppunt adres", + "PEER_HELP": "server.domein.com:poort", "USE_LOCAL_STORAGE": "Lokale opslag inschakelen", "ENABLE_HELPTIP": "Contextgebonden hulp inschakelen", "HISTORY_SETTINGS": "Mijn rekening", @@ -119,7 +119,7 @@ "PLUGINS_SETTINGS": "Uitbreidingen", "BTN_RESET": "Herstel standaardinstellingen", "EXPERT_MODE": "Geavanceerde modus inschakelen <span class=\"hidden-xs\">(toon meer details)</span>", - "POPUP_NODE": { + "POPUP_PEER": { "TITLE" : "Duniter Knooppunt", "HELP" : "Stel het adres van het knooppunt in:" } @@ -339,20 +339,20 @@ "SCAN_FAILED": "Could not scan QR code.", "SCAN_UNKNOWN_FORMAT": "Code not recognized.", "WOT_LOOKUP_FAILED": "Search failed.", - "LOAD_NODE_DATA_FAILED": "Duniter Node not accessible. Please retry later.", + "LOAD_PEER_DATA_FAILED": "Duniter Node not accessible. Please retry later.", "NEED_LOGIN_FIRST": "Please sign in first.", "AMOUNT_REQUIRED": "Amount is required.", "AMOUNT_NEGATIVE": "Negative amount not allowed.", "NOT_ENOUGH_CREDIT": "Not enough credit.", - "INVALID_NODE_SUMMARY": "Unreachable node or invalid address", + "INVALID_NODE_SUMMARY": "Unreachable peer or invalid address", "INVALID_USER_ID": "Field 'pseudonym' must not contains spaces or special characters.", "INVALID_COMMENT": "Field 'reference' has a bad format.", "INVALID_PUBKEY": "Public key has a bad format.", - "IDENTITY_INVALID_BLOCK_HASH": "This membership application is no longer valid (because it references a block that network nodes are cancelled): the person must renew its application for membership <b>before</b> being certified.", + "IDENTITY_INVALID_BLOCK_HASH": "This membership application is no longer valid (because it references a block that network peers are cancelled): the person must renew its application for membership <b>before</b> being certified.", "IDENTITY_EXPIRED": "This identity has expired: this person must re-apply <b>before</b> being certified.", - "IDENTITY_SANDBOX_FULL": "Could not register, because node's sandbox is full.<br/><br/>Please retry later or choose another Duniter node (in <b>Settings</b>).", + "IDENTITY_SANDBOX_FULL": "Could not register, because peer's sandbox is full.<br/><br/>Please retry later or choose another Duniter peer (in <b>Settings</b>).", "WOT_PENDING_INVALID_BLOCK_HASH": "Membership not valid.", - "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network nodes are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", + "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network peers are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", "WALLET_IDENTITY_EXPIRED": "The publication of your identity <b>has expired</b>.<br/>You must <a ng-click=\"doQuickFix('fixIdentity')\">re-issue your identity</a> to resolve this issue.", "WALLET_HAS_NO_SELF": "Your identity must first have been published, and not expired.", "IDENTITY_ALREADY_CERTIFY": "You have <b>already certified</b> that identity.<br/><br/>Your certificate is still valid (expires {{expiresIn|formatDuration}}).", @@ -419,9 +419,9 @@ "CURRENCY_CHANGE_UNIT_TO_RELATIVE": "This button allows to <b>switch the unit</b> to show amounts in “<b>{{'COMMON.UD'|translate}}<sub>{{currency|abbreviate}}</sub></b>”, which is relative to the Universal Dividend (the amount co-produced by each member).", "CURRENCY_RULES": "The <b>rules</b> of the currency determine its <b>exact and predictible</b> performance.<br/><br/>As a true DNA of the currency these rules make the monetary code <b>transparent and understandable</b>.", "CURRENCY_BLOCKCHAIN": "All monetary transactions are recoded in a <b>public and tamper proof</b> ledger, generally referred to as the <b>blockchain</b>.", - "CURRENCY_PEERS": "The <b>nodes</b> shown here corrrespond to <b>computers that update and check</b> the blokchain.<br/><br/>The more active nodes there are, the more <b>decentralised</b> and therefore trustworhty the currency becomes.", - "CURRENCY_PEERS_BLOCK_NUMBER": "This <b>number</b> indicates the node's <b>latest validated block</b> (last page written in the ledger).<br/><br/>Green indicates that the block was equally validated by the <b>majority of other nodes</b>.", - "CURRENCY_PEERS_PARTICIPATE": "<b>Each member</b>, equiped with a computer with Internet, <b>can participate, adding a node</b> simply by <b>installing the Duniter software</b> (free/libre and open source). <a target=\"_new\" href=\"{{installDocUrl}}\">Read the installation manual >></a>.", + "CURRENCY_PEERS": "The <b>peers</b> shown here correspond to <b>computers that update and check</b> the blockchain.<br/><br/>The more active peers there are, the more <b>decentralised</b> and therefore trustworhty the currency becomes.", + "CURRENCY_PEERS_BLOCK_NUMBER": "This <b>number</b> indicates the peer's <b>latest validated block</b> (last page written in the ledger).<br/><br/>Green indicates that the block was equally validated by the <b>majority of other peers</b>.", + "CURRENCY_PEERS_PARTICIPATE": "<b>Each member</b>, equiped with a computer with Internet, <b>can participate, adding a peer</b> simply by <b>installing the Duniter software</b> (free/libre and open source). <a target=\"_new\" href=\"{{installDocUrl}}\">Read the installation manual >></a>.", "MENU_BTN_ACCOUNT": "<b>{{'ACCOUNT.TITLE'|translate}}</b> allows access to your account balance and transaction history.", "MENU_BTN_ACCOUNT_MEMBER": "Here you can consult your account status, transaction history and your certifications.", "WALLET_CERTIFICATIONS": "Click here to reveiw the details of your certifications (given and received).", diff --git a/www/js/controllers/currency-controllers.js b/www/js/controllers/currency-controllers.js index 610e7ae99fffdb16208f05cfd0862c39a6204fba..0bbb2dc1c2d01e95bd5394737b25e405d5ebf567 100644 --- a/www/js/controllers/currency-controllers.js +++ b/www/js/controllers/currency-controllers.js @@ -241,7 +241,12 @@ function CurrencyViewController($scope, $q, $translate, $timeout, $filter, }); }; - // Show help tip + $scope.refreshPeers = function() { + $scope.$broadcast('NetworkLookupCtrl.action', 'refresh'); + }; + + /* -- help tip -- */ + $scope.showHelpTip = function() { if (!$scope.isLogin()) return; index = csSettings.data.helptip.currency; diff --git a/www/js/controllers/network-controllers.js b/www/js/controllers/network-controllers.js index f19cddd9eb48d7a8de2ede6f07ae03a11c1b5a3f..70297d59566f9a5e61b95d3653550e679ba7a49b 100644 --- a/www/js/controllers/network-controllers.js +++ b/www/js/controllers/network-controllers.js @@ -21,43 +21,49 @@ angular.module('cesium.network.controllers', ['cesium.services']) }); }) -.controller('NetworkViewCtrl', NetworkViewController) +.controller('NetworkLookupCtrl', NetworkLookupController) .controller('PeerCtrl', PeerController) -.controller('NetworkModalCtrl', NetworkModalController) +.controller('NetworkLookupModalCtrl', NetworkLookupModalController) ; -function NetworkViewController($scope, $timeout, BMA, UIUtils, csSettings, csCurrency, csNetwork) { - $scope.loadingPeers = true; - $scope.formData = { - useRelative: csSettings.data.useRelative +function NetworkLookupController($scope, $timeout, $state, $ionicPopover, BMA, UIUtils, csSettings, csCurrency, csNetwork) { + 'ngInject'; + + $scope.itemClass = ''; + $scope.search = { + text: '', + loading: true, + type: 'member', + results: [] }; - $scope.screen = UIUtils.screen; + $scope.init = function() { + csCurrency.default() + .then(function (currency) { + if (currency) { + $scope.node = !BMA.node.same(currency.peer.host, currency.peer.port) ? + BMA.instance(currency.peer.host, currency.peer.port) : BMA; + $scope.load(); + } + }) + .catch(UIUtils.onError('ERROR.GET_CURRENCY_FAILED')); + }; $scope.$on('$ionicParentView.enter', function(e, state) { - csCurrency.all() - .then(function (currencies) { - if (currencies && currencies.length > 0) { - $scope.load(currencies[0]); - } - - }) - .catch(UIUtils.onError('ERROR.GET_CURRENCY_FAILED')); + $scope.init(); }); $scope.$on('$ionicParentView.beforeLeave', function(){ csNetwork.close(); }); - $scope.load = function(currency) { - $scope.node = !BMA.node.same(currency.peer.host, currency.peer.port) ? - BMA.instance(currency.peer.host, currency.peer.port) : BMA; + $scope.load = function() { - if ($scope.loadingPeers){ - csNetwork.start($scope.node); + if ($scope.search.loading){ + csNetwork.start($scope.node, {filter: $scope.search.type}); // Catch event on new peers var refreshing = false; @@ -66,17 +72,13 @@ function NetworkViewController($scope, $timeout, BMA, UIUtils, csSettings, csCur refreshing = true; $timeout(function() { // Timeout avoid to quick updates console.debug("Updating UI Peers"); - $scope.peers = data.peers; - // Update currency params - - $scope.loadingPeers = csNetwork.isBusy(); + $scope.search.results = data.peers; + $scope.search.memberPeersCount = data.memberPeersCount; + $scope.search.loading = csNetwork.isBusy(); refreshing = false; }, 1100); } }); - $scope.$on('$destroy', function(){ - csNetwork.close(); - }); } // Show help tip @@ -85,100 +87,35 @@ function NetworkViewController($scope, $timeout, BMA, UIUtils, csSettings, csCur $scope.refresh = function() { // Network - $scope.loadingPeers = true; + $scope.search.loading = true; csNetwork.loadPeers(); }; - // Show help tip - $scope.showHelpTip = function() { - if (!$scope.isLogin()) return; - index = csSettings.data.helptip.currency; - if (index < 0) return; - - // Create a new scope for the tour controller - var helptipScope = $scope.createHelptipScope(); - if (!helptipScope) return; // could be undefined, if a global tour already is already started - - return helptipScope.startCurrencyTour(index, false) - .then(function(endIndex) { - helptipScope.$destroy(); - csSettings.data.helptip.currency = endIndex; - csSettings.store(); - }); - }; -} - -function NetworkModalController($scope, $q, $translate, $timeout, $ionicPopover, BMA, - UIUtils, csSettings, csCurrency, csNetwork, ModalUtils) { - $scope.loadingPeers = true; - $scope.formData = { - useRelative: csSettings.data.useRelative - }; - - $scope.enableFilter = true; - $scope.display='members'; - $scope.screen = UIUtils.screen; - $scope.nbMembersPeers = 0; - - csCurrency.all() - .then(function (currencies) { - if (currencies && currencies.length > 0) { - $scope.load(currencies[0]); - } - - }) - .catch(UIUtils.onError('ERROR.GET_CURRENCY_FAILED')); - - $scope.load = function(currency) { - $scope.node = !BMA.node.same(currency.peer.host, currency.peer.port) ? - BMA.instance(currency.peer.host, currency.peer.port) : BMA; - - if ($scope.loadingPeers){ - csNetwork.start($scope.node); - - // Catch event on new peers - var refreshing = false; - csNetwork.api.data.on.changed($scope, function(data){ - if (!refreshing) { - refreshing = true; - $timeout(function() { // Timeout avoid to quick updates - console.debug("Updating UI Peers"); - $scope.peers = data.peers; - // Update currency params - - $scope.loadingPeers = csNetwork.isBusy(); - $scope.countMembersNodes(); - refreshing = false; - }, 1100) - } - - }); - $scope.$on('modal.hidden', function(){ - csNetwork.close(); - }); + $scope.toggleSearchType = function(type){ + $scope.hideActionsPopover(); + if ($scope.search.type === type || type === 'none') { + $scope.search.type = false; } - }; + else { + $scope.search.type = type; + } + csNetwork.close(); + $scope.search.loading = true; + $scope.load(); - $scope.refresh = function() { - $scope.loadingPeers = true; - csNetwork.loadPeers(); }; - $scope.countMembersNodes = function(){ - $scope.nbMembersPeers = 0; - for(var i=0; i<$scope.peers.length; i++){ - if ($scope.peers[i].level){ - $scope.nbMembersPeers++; - } - } + $scope.selectPeer = function(peer) { + $state.go('app.view_peer', {server: peer.server}); }; - $scope.changeDisplay = function(type){ - $scope.hideActionsPopover(); - $scope.display = type; - }; + $scope.$on('NetworkLookupCtrl.action', function(event, action) { + if (action === 'refresh') { + $scope.refresh(); + } + }); - /* -- show/hide popup -- */ + /* -- popover -- */ $scope.showActionsPopover = function(event) { if (!$scope.actionsPopover) { @@ -204,4 +141,51 @@ function NetworkModalController($scope, $q, $translate, $timeout, $ionicPopover, } }; + /* -- help tip -- */ + + // Show help tip + $scope.showHelpTip = function() { + if (!$scope.isLogin()) return; + index = csSettings.data.helptip.currency; + if (index < 0) return; + + // Create a new scope for the tour controller + var helptipScope = $scope.createHelptipScope(); + if (!helptipScope) return; // could be undefined, if a global tour already is already started + + return helptipScope.startCurrencyTour(index, false) + .then(function(endIndex) { + helptipScope.$destroy(); + csSettings.data.helptip.currency = endIndex; + csSettings.store(); + }); + }; +} + + +function NetworkLookupModalController($scope, $timeout, $state, $ionicPopover, BMA, UIUtils, csSettings, csCurrency, csNetwork, parameters) { + 'ngInject'; + + NetworkLookupController.call(this, $scope, $timeout, $state, $ionicPopover, BMA, UIUtils, csSettings, csCurrency, csNetwork); + + // Read parameters + parameters = parameters || {}; + $scope.enableFilter = angular.isDefined(parameters.enableFilter) ? parameters.enableFilter : true; + $scope.search.type = angular.isDefined(parameters.type) ? parameters.type : $scope.search.type; + + $scope.itemClass = parameters.itemClass || 'item-border-large'; + + $scope.selectPeer = function(peer) { + $scope.closeModal(peer); + }; + + $scope.$on('modal.hidden', function(){ + csNetwork.close(); + }); + + // Disable this unsed method - called by load() + $scope.showHelpTip = function() {}; + + // Init + $scope.init(); } diff --git a/www/js/controllers/settings-controllers.js b/www/js/controllers/settings-controllers.js index f1640a53ea14d77931e6ec453c2ea52ef7f25cc0..46f012773c8774f94bd86d4c998a8d6933a44449 100644 --- a/www/js/controllers/settings-controllers.js +++ b/www/js/controllers/settings-controllers.js @@ -21,7 +21,7 @@ angular.module('cesium.settings.controllers', ['cesium.services', 'cesium.curren ; function SettingsController($scope, $q, $ionicPopup, $timeout, $translate, csHttp, - UIUtils, BMA, csSettings, $ionicPopover, ModalUtils) { + UIUtils, BMA, csSettings, $ionicPopover, Modals) { 'ngInject'; $scope.formData = angular.copy(csSettings.data); @@ -97,7 +97,7 @@ function SettingsController($scope, $q, $ionicPopup, $timeout, $translate, csHtt $scope.showNodeList = function() { $ionicPopup._popupStack[0].responseDeferred.promise.close(); - return ModalUtils.show('/templates/network/modal_network.html', 'NetworkModalCtrl') + return Modals.showNetworkLookup({enableFilter: true, type: 'member'}) .then(function (result) { if (result) { var parts = result.server.split(':'); diff --git a/www/js/services/modal-services.js b/www/js/services/modal-services.js index 2e5c3419bd36a34aaac612fd37f6dca2157d55d3..d273a761f6207f9ab8706637897a4cbe32e502c7 100644 --- a/www/js/services/modal-services.js +++ b/www/js/services/modal-services.js @@ -140,6 +140,11 @@ angular.module('cesium.modal.services', []) parameters, {focusFirstInput: true}); } + function showNetworkLookup(parameters) { + return ModalUtils.show('templates/network/modal_network.html', 'NetworkLookupModalCtrl', + parameters, {focusFirstInput: true}); + } + function showAbout(parameters) { return ModalUtils.show('templates/modal_about.html','AboutCtrl', parameters); @@ -159,6 +164,7 @@ angular.module('cesium.modal.services', []) showTransfer: showTransfer, showLogin: showLogin, showWotLookup: showWotLookup, + showNetworkLookup: showNetworkLookup, showAbout: showAbout, showJoin: showJoin, showHelp: showHelp diff --git a/www/js/services/network-services.js b/www/js/services/network-services.js index 137b3a35ee5619445679083588eae7a541a5939c..6b2f3cc10bce471844b058d3d6941c83d185211d 100644 --- a/www/js/services/network-services.js +++ b/www/js/services/network-services.js @@ -13,6 +13,7 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se data = { bma: null, peers: [], + filter: null, knownBlocks: [], knownPeers: {}, mainBuid: null, @@ -24,6 +25,8 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se resetData = function() { data.bma = null; data.peers = []; + data.filter = null; + data.memberPeersCount = 0; data.knownBlocks = []; data.knownPeers = {}; data.mainBuid = null; @@ -118,9 +121,15 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se peer.dns = peer.getDns(); peer.blockNumber = peer.block.replace(/-.+$/, ''); peer.uid = data.uidsByPubkeys[peer.pubkey]; - var node = new BMA.instance(peer.getHost(), peer.getPort(), false); + // filter + if (data.filter && + ((data.filter === 'member' && !peer.uid) || + (data.filter === 'mirror' && peer.uid))) { + return $q.when(peer); + } + var node = new BMA.instance(peer.getHost(), peer.getPort(), false); // Get current block return node.blockchain.current() @@ -151,8 +160,8 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se return peer; }) .then(function(peer) { - // Exit if offline - if (!peer.online) return peer; + // Exit if offline, or not expert mode or too small device + if (!peer.online || !csSettings.data.expertMode || UIUtils.screen.isSmall()) return peer; var jobs = []; // Get hardship (only for a member peer) if (peer.uid) { @@ -164,8 +173,6 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se peer.level = null; // continue })); } - // Exit if not expert mode or too small device - if (!csSettings.data.expertMode || UIUtils.screen.isSmall()) return peer; // Get Version jobs.push(node.node.summary() @@ -183,11 +190,10 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se flushNewPeersAndSort = function(newPeers) { newPeers = newPeers || data.newPeers; - if (newPeers.length) { - data.peers = data.peers.concat(newPeers.splice(0)); - console.debug('[network] New peers found: add them to result and sort...'); - sortPeers(); - } + if (!newPeers.length) return; + data.peers = data.peers.concat(newPeers.splice(0)); + console.debug('[network] New peers found: add them to result and sort...'); + sortPeers(); }, sortPeers = function(updateMainBuid) { @@ -205,9 +211,11 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se var mainBlock = _.max(buids, function(obj) { return obj.count; }); + data.memberPeersCount = 0; _.forEach(data.peers, function(peer){ peer.hasMainConsensusBlock = peer.buid == mainBlock.buid; peer.hasConsensusBlock = !peer.hasMainConsensusBlock && currents[peer.buid] > 1; + data.memberPeersCount += peer.uid ? 1 : 0; }); data.peers = _.uniq(data.peers, false, function(peer) { return peer.pubkey; @@ -228,8 +236,6 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se api.data.raise.changed(data); // raise event }, - - startListeningOnSocket = function() { // Listen for new block data.bma.websocket.block().on(function(block) { @@ -276,11 +282,14 @@ angular.module('cesium.network.services', ['ngResource', 'ngApi', 'cesium.bma.se }); }, - start = function(bma) { + start = function(bma, options) { + options = options || {}; return $q(function(resolve, reject) { close(); data.bma = bma ? bma : BMA; - console.info('[network] Starting network [' + bma.node.server + ']'); + data.filter = options.filter; + console.info('[network] Starting network [{0}] filetered on [{1}]'.format(bma.node.server, + data.filter ? data.filter : 'none')); var now = new Date(); startListeningOnSocket(resolve, reject); loadPeers() diff --git a/www/templates/currency/items_network.html b/www/templates/currency/items_network.html index bba47b7b30f5eb56c2acb7f36d8618980d25455d..52a336637e3b51d49211e31e78eb2f5f1d622241 100644 --- a/www/templates/currency/items_network.html +++ b/www/templates/currency/items_network.html @@ -1,4 +1,9 @@ + <ion-nav-buttons side="secondary"> + <button class="button button-icon button-clear icon ion-loop visible-xs visible-sm" ng-click="refresh()"> + </button> + </ion-nav-buttons> + <ion-item id="helptip-currency-blockchain" class="item-icon-left"> <i class="icon ion-clock"></i> @@ -12,4 +17,33 @@ <span class="badge badge-stable">{{difficulty | formatInteger}}</span> </ion-item> - <ng-include ng-controller="NetworkViewCtrl" src="'templates/network/tabs/view_nodes.html'" ></ng-include> + <ng-controller ng-controller="NetworkLookupCtrl" ng-init="search.type='member';"> + + <div id="helptip-currency-peers" + class="item item-divider"> + <div class="pull-left"> + <span ng-if="search.type=='member'"> + {{'PEER.MEMBERS' | translate}} <span ng-if="!search.loading">({{search.results.length}})</span> + </span> + <span ng-if="search.type=='mirror'"> + {{'PEER.MIRRORS' | translate}} <span ng-if="!search.loading">({{search.results.length}})</span> + </span> + <span ng-if="!search.type"> + {{'PEER.PEERS' | translate}} <span ng-if="!search.loading">({{search.results.length}})</span> + </span> + </div> + + <div class="buttons pull-right"> + <ion-spinner class="icon" icon="android" ng-if="search.loading"></ion-spinner> + <a class="button button-icon button-small-padding icon ion-loop gray hidden-xs hidden-sm ink" ng-if="!search.loading" ng-click="refresh()"> + </a> + <a class="button button-icon button-small-padding icon ion-android-more-vertical gray hidden-xs hidden-sm ink" + ng-if="!search.loading" + ng-click="showActionsPopover($event)"> + </a> + </div> + </div> + + <ng-include src="'templates/network/items_peers.html'" ></ng-include> + + </ng-controller> diff --git a/www/templates/currency/tabs/tab_network.html b/www/templates/currency/tabs/tab_network.html index d6b969fcf6a96553502fe5815df5293c4fe890fb..443c76a4a7060d7707557d9c717d8d306e46703a 100644 --- a/www/templates/currency/tabs/tab_network.html +++ b/www/templates/currency/tabs/tab_network.html @@ -1,4 +1,9 @@ <ion-view> + <ion-nav-buttons side="secondary"> + <button class="button button-icon button-clear icon ion-loop visible-xs visible-sm" ng-click="refresh()"> + </button> + </ion-nav-buttons> + <ion-content> <div class="list"> <ng-include src="'templates/currency/items_network.html'"></ng-include> diff --git a/www/templates/currency/view_currency.html b/www/templates/currency/view_currency.html index 4552e707ecde977504c72ecd808d5bb3868009d7..25bb92dff932ecd053f4afae13147a3d3eb2b065 100644 --- a/www/templates/currency/view_currency.html +++ b/www/templates/currency/view_currency.html @@ -6,10 +6,7 @@ {{currency}} </ion-nav-title> - <ion-nav-buttons side="secondary"> - <button class="button button-icon button-clear icon ion-loop visible-xs visible-sm" ng-click="refresh()"> - </button> - </ion-nav-buttons> + <ion-content class="no-header"> <ion-tabs class="tabs-icon-top tabs-positive"> diff --git a/www/templates/currency/view_currency_lg.html b/www/templates/currency/view_currency_lg.html index 03028c9cc55d1c03aa81e858b552da8fd4469b84..0a6d3ab644831240235ca04025c33d494af01496 100644 --- a/www/templates/currency/view_currency_lg.html +++ b/www/templates/currency/view_currency_lg.html @@ -5,7 +5,7 @@ </ion-nav-title> <ion-nav-buttons side="secondary"> - <button class="button button-icon button-clear icon ion-loop visible-xs visible-sm" ng-click="refresh()"> + <button class="button button-icon button-clear icon ion-loop visible-xs visible-sm" ng-click="refreshPeers()"> </button> </ion-nav-buttons> diff --git a/www/templates/network/items_peers.html b/www/templates/network/items_peers.html new file mode 100644 index 0000000000000000000000000000000000000000..cd30b84fe9b21ca042f1780a8859a2f93808b96e --- /dev/null +++ b/www/templates/network/items_peers.html @@ -0,0 +1,30 @@ + + + <div ng-repeat="peer in search.results track by peer.server" + class="item peer-item item-icon-left {{itemClass}}" + ng-class="{ assertive: !peer.online, balanced: (peer.online && peer.hasMainConsensusBlock), energized: (peer.online && !peer.hasMainConsensusBlock)}" + id="helptip-currency-peer-{{$index}}" + ng-click="selectPeer(peer)"> + + <i class="icon ion-android-globe"></i> + + <div class="row no-padding"> + <div class="col no-padding"> + <h3><i ng-class="{'ion-person': peer.uid, 'ion-key': !peer.uid}"></i> <span>{{peer.uid || peer.pubkey.substr(0,8)}}</span> <span class="gray">{{peer.dns && ' | ' + peer.dns}}</span></h3> + <h4>{{peer.server}}</h4> + </div> + <div class="col col-10 no-padding" ng-if="settings.expertMode"> + <h3 class="hidden-sm hidden-xs hidden-md"> + <span ng-if="peer.level"><i class="ion-lock-combination"></i> {{peer.level}}</span> + <span ng-if="!peer.level" translate>PEER.MIRROR</span> + </h3> + <h4 class="hidden-sm hidden-xs hidden-md gray">v{{peer.version}}</h4> + </div> + <div class="col col-20 no-padding"> + <span id="helptip-currency-peer-{{$index}}-block" + class="badge" ng-class="{ 'badge-balanced': peer.hasMainConsensusBlock, 'badge-energized': peer.hasConsensusBlock }">{{peer.currentNumber}}</span> + </div> + </div> + </div> + +</div> diff --git a/www/templates/network/lookup_popover_actions.html b/www/templates/network/lookup_popover_actions.html index 248014d196e986d7f01d0c5b15df8fe0dede7de3..87e9d955fb5870329d969176ce192a7868f5bd31 100644 --- a/www/templates/network/lookup_popover_actions.html +++ b/www/templates/network/lookup_popover_actions.html @@ -1,20 +1,22 @@ -<ion-popover-view class="fit has-header visible-sm visible-xs"> +<ion-popover-view class="fit has-header"> <ion-header-bar> <h1 class="title" translate>COMMON.POPOVER_ACTIONS_TITLE</h1> </ion-header-bar> <ion-content scroll="false"> <div class="list item-text-wrap"> - <a class="item item-icon-left ink" - ng-click="changeDisplay('members')"> + <a class="item item-icon-left item-icon-right ink" + ng-click="toggleSearchType('member')"> <i class="icon ion-android-people"></i> {{'PEER.MEMBERS' | translate}} + <i class="icon ion-ios-checkmark-empty" ng-show="search.type=='member'"></i> </a> - <a class="item item-icon-left ink" - ng-click="changeDisplay('allNodes')"> + <a class="item item-icon-left item-icon-right ink" + ng-click="toggleSearchType('mirror')"> <i class="icon ion-ios-infinite"></i> - {{'PEER.ALL_NODES' | translate}} + {{'PEER.MIRRORS' | translate}} + <i class="icon ion-ios-checkmark-empty" ng-show="search.type=='mirror'"></i> </a> </div> diff --git a/www/templates/network/modal_network.html b/www/templates/network/modal_network.html index 2670fe7fbed57eb105fc634a21feb874a48a3cfa..84efef0a3d46277da07401b17ec97adf0561fc03 100644 --- a/www/templates/network/modal_network.html +++ b/www/templates/network/modal_network.html @@ -17,69 +17,43 @@ <ion-content> <div class="list"> <div class="padding padding-xs" style="display: block; height: 60px;"> - <div id="helptip-currency-peers" class="pull-left"> - <h4 class="visible-xs visible-sm" - ng-if="display=='allNodes'||!enableFilter"> - {{'PEER.ALL_NODES' | translate}} <span ng-if="peers.length != 0">({{peers.length}})</span> : - </h4> - <h4 class="visible-xs visible-sm" - ng-if="display=='members'"> - {{'PEER.MEMBERS' | translate}} <span ng-if="nbMembersPeers != 0">({{nbMembersPeers}})</span> : - </h4> - <h4 class="hidden-xs hidden-sm"> - {{'PEER.PEERS' | translate}} - <span ng-if="peers.length != 0 && (display=='allNodes'||!enableFilter)">({{peers.length}})</span> - <span ng-if="nbMembersPeers != 0 && display=='members'">({{nbMembersPeers}})</span> : - </h4> - </div> + + <div class="pull-left"> + <h4 ng-if="enableFilter && search.type=='member'"> + {{'PEER.MEMBERS' | translate}} <span ng-if="!search.loading">({{search.results.length}})</span> + </h4> + <h4 ng-if="enableFilter && search.type=='mirror'"> + {{'PEER.MIRRORS' | translate}} <span ng-if="!search.loading">({{search.results.length}})</span> + </h4> + <h4 ng-if="!enableFilter || !search.type"> + {{'PEER.ALL_NODES' | translate}} <span ng-if="!search.loading">({{search.results.length}})</span> + </h4> + </div> + + <div class="pull-right"> + <ion-spinner class="icon" icon="android" ng-if="search.loading"></ion-spinner> <div class="pull-right"> - <ion-spinner class="icon" icon="android" ng-if="loadingPeers"></ion-spinner> + <a class="button button-text button-small hidden-xs hidden-sm ink" + ng-if="enableFilter" + ng-class="{'button-text-positive': search.type=='member'}" + ng-click="toggleSearchType('member')"> + <i class="icon ion-android-people"></i> + {{'PEER.MEMBERS'|translate}} + </a> - <div class="pull-right"> - <a class="button button-text button-small ink icon ion-android-people hidden-xs hidden-sm" - ng-class="{'button-text-positive': display=='members'}" - ng-click="changeDisplay('members')" - ng-if="enableFilter"> - {{'PEER.MEMBERS' | translate}} - </a> - - <a class="button button-text button-small ink icon ion-ios-infinite hidden-xs hidden-sm" - ng-class="{'button-text-positive': display=='allNodes'}" - ng-click="changeDisplay('allNodes')" - ng-if="enableFilter"> - {{'PEER.ALL_NODES' | translate}} - </a> - - </div> + <a class="button button-text button-small hidden-xs hidden-sm ink" + ng-if="enableFilter" + ng-class="{'button-text-positive': search.type=='mirror'}" + ng-click="toggleSearchType('mirror')" > + <i class="icon ion-ios-infinite"></i> + {{'PEER.MIRRORS'|translate}} + </a> </div> </div> + </div> - <ng-click class="peer-item item item-icon-left" - ng-repeat="peer in peers track by peer.server" - id="helptip-currency-peer-{{$index}}" - ng-class="{ assertive: !peer.online, balanced: (peer.online && peer.hasMainConsensusBlock), energized: (peer.online && !peer.hasMainConsensusBlock)}" - ng-click="closeModal(peer)" ng-if="(!peer.level && display=='allNodes') || peer.level || !enableFilter"> - - <i class="icon ion-android-globe"></i> - <div class="row no-padding"> - <div class="col no-padding"> - <h3><i ng-class="{'ion-person': peer.uid, 'ion-key': !peer.uid}"></i> <span>{{peer.uid || peer.pubkey.substr(0,8)}}</span> <span class="gray">{{peer.dns && ' | ' + peer.dns}}</span></h3> - <h4>{{peer.server}}</h4> - </div> - <div class="col col-10 no-padding" ng-if="settings.expertMode"> - <h3 class="hidden-sm hidden-xs hidden-md"> - <span ng-if="peer.level"><i class="ion-lock-combination"></i> {{peer.level}}</span> - <span ng-if="!peer.level" translate>PEER.MIRROR</span> - </h3> - <h4 class="hidden-sm hidden-xs hidden-md gray">v{{peer.version}}</h4> - </div> - <div class="col col-20 no-padding"> - <span id="helptip-currency-peer-{{$index}}-block" - class="badge" ng-class="{ 'badge-balanced': peer.hasMainConsensusBlock, 'badge-energized': peer.hasConsensusBlock }">{{peer.currentNumber}}</span> - </div> - </div> - </ng-click> + <ng-include src="'templates/network/items_peers.html'"></ng-include> </div> </ion-content> diff --git a/www/templates/network/tabs/view_nodes.html b/www/templates/network/tabs/view_nodes.html deleted file mode 100644 index e3cfd11f9651b2fa4fb7277e96c9b1ec8a4db857..0000000000000000000000000000000000000000 --- a/www/templates/network/tabs/view_nodes.html +++ /dev/null @@ -1,33 +0,0 @@ -<div class="list"> - <div id="helptip-currency-peers" - class="item item-divider item-icon-right"> - {{'PEER.PEERS'|translate}} - <ion-spinner class="icon" icon="android" ng-if="loadingPeers"></ion-spinner> - <a class="icon ion-loop gray hidden-xs hidden-sm" ng-if="!loadingPeers" ng-click="refresh()"> - </a> - </div> - <a class="peer-item item item-icon-left" - ng-repeat="peer in peers track by peer.server" - id="helptip-currency-peer-{{$index}}" - ng-class="{ assertive: !peer.online, balanced: (peer.online && peer.hasMainConsensusBlock), energized: (peer.online && !peer.hasMainConsensusBlock)}" - ui-sref="app.view_peer({server: peer.server})"> - <i class="icon ion-android-globe"></i> - <div class="row no-padding"> - <div class="col no-padding"> - <h3><i ng-class="{'ion-person': peer.uid, 'ion-key': !peer.uid}"></i> <span>{{peer.uid || peer.pubkey.substr(0,8)}}</span> <span class="gray">{{peer.dns && ' | ' + peer.dns}}</span></h3> - <h4>{{peer.server}}</h4> - </div> - <div class="col col-10 no-padding" ng-if="settings.expertMode"> - <h3 class="hidden-sm hidden-xs hidden-md"> - <span ng-if="peer.level"><i class="ion-lock-combination"></i> {{peer.level}}</span> - <span ng-if="!peer.level" translate>PEER.MIRROR</span> - </h3> - <h4 class="hidden-sm hidden-xs hidden-md gray">v{{peer.version}}</h4> - </div> - <div class="col col-20 no-padding"> - <span id="helptip-currency-peer-{{$index}}-block" - class="badge" ng-class="{ 'badge-balanced': peer.hasMainConsensusBlock, 'badge-energized': peer.hasConsensusBlock }">{{peer.currentNumber}}</span> - </div> - </div> - </a> -</div> diff --git a/www/templates/wallet/popover_actions.html b/www/templates/wallet/popover_actions.html index 2f6c23f8ed286827727433c3f0013f0f40ce3ca9..293c4e88a330c9dd9951784ddef7e7490d552c90 100644 --- a/www/templates/wallet/popover_actions.html +++ b/www/templates/wallet/popover_actions.html @@ -9,8 +9,7 @@ ng-click="toggleShowDetails()"> <i class="icon ion-key"></i> {{'ACCOUNT.BTN_SHOW_DETAILS' | translate}} - <i class="icon" - ng-class="{'ion-ios-checkmark-empty': showDetails}"></i> + <i class="icon ion-ios-checkmark-empty" ng-show="showDetails"></i> </a> <a class="item item-icon-left ink visible-xs visible-sm"