From d756873e8c82eea84164d355d5c9f8dffbc6679d Mon Sep 17 00:00:00 2001 From: Luisfc68 Date: Thu, 21 Nov 2024 12:50:19 +0100 Subject: [PATCH] fix: order of ranges management ui in general tab --- .../entrypoints/rest/assets/management.html | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/internal/adapters/entrypoints/rest/assets/management.html b/internal/adapters/entrypoints/rest/assets/management.html index 57943163..60ad261f 100644 --- a/internal/adapters/entrypoints/rest/assets/management.html +++ b/internal/adapters/entrypoints/rest/assets/management.html @@ -292,12 +292,13 @@
Current Configuration
const getTooltipText = (key) => { const tooltips = { timeForDeposit: 'The time (in seconds) for which a deposit is considered valid.', - expireTime: 'The time (in seconds) after which a transaction is considered expired.', - penaltyFee: 'The penalty fee (in Wei) charged for invalid transactions.', - callFee: 'The fee (in Wei) charged for processing a transaction.', - maxValue: 'The maximum value (in Wei) allowed for a transaction.', - minValue: 'The minimum value (in Wei) allowed for a transaction.', - expireBlocks: 'The number of blocks after which a transaction is considered expired.' + expireTime: 'The time (in seconds) after which a quote is considered expired.', + penaltyFee: 'The penalty fee (in BTC) charged for invalid transactions.', + callFee: 'The fee (in BTC) charged by the LP for processing a transaction.', + maxValue: 'The maximum value (in BTC) allowed for a transaction.', + minValue: 'The minimum value (in BTC) allowed for a transaction.', + expireBlocks: 'The number of blocks after which a quote is considered expired.', + bridgeTransactionMin: 'The amount of rBTC that needs to be gathered in peg out refunds before executing a native peg out.' }; return tooltips[key] || 'No description available'; }; @@ -327,7 +328,16 @@
Current Configuration
section.innerHTML = ''; Object.entries(config).forEach(([key, value]) => { if (typeof value === 'object' && !Array.isArray(value)) { - Object.entries(value).forEach(([subKey, subValue]) => { + Object.entries(value) + .sort((a, b) => { + const firstAmount = BigInt(a[0]); + const secondAmount = BigInt(b[0]); + // I use if statements instead of subtraction to avoid overflow risk + if (firstAmount < secondAmount) return -1; + if (firstAmount > secondAmount) return 1; + return 0; + }) + .forEach(([subKey, subValue]) => { const etherValue = weiToEther(subKey); const label = key === "rskConfirmations" ? "rskConfirmations" : "btcConfirmations"; const unit = key === "rskConfirmations" ? "rBTC" : "BTC";