Tue Jul 23 10:47:18 CST 2019 Source Update...
This commit is contained in:
parent
8e1a78e586
commit
99967cb1d6
@ -1,4 +1,4 @@
|
||||
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic');
|
||||
/*@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic');*/
|
||||
|
||||
:root {
|
||||
--blue-grey: #445368;
|
||||
@ -243,7 +243,7 @@ textarea {
|
||||
border: none;
|
||||
color: #000;
|
||||
padding: 5px;
|
||||
width: 55px;
|
||||
width: 75px;
|
||||
font-family: inherit;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
@ -1818,7 +1818,7 @@ td.hash {
|
||||
}
|
||||
.header__right select {
|
||||
text-decoration: underline;
|
||||
width: 60px;
|
||||
width: 75px;
|
||||
}
|
||||
.header__wallet-link {
|
||||
display: flex;
|
||||
@ -1859,7 +1859,7 @@ td.hash {
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
right: 165px;
|
||||
width: 60px;
|
||||
width: 75px;
|
||||
border-radius: 3px;
|
||||
background: transparent;
|
||||
color: #000;
|
||||
|
@ -179,7 +179,7 @@ else
|
||||
function IsIPAddres(Str)
|
||||
{
|
||||
var arr = Str.split(".");
|
||||
if(arr.length !== 3)
|
||||
if(arr.length !== 4)
|
||||
return 0;
|
||||
for(var i = 0; i < arr.length; i++)
|
||||
if(arr[i] !== "" + ParseNum(arr[i]))
|
||||
|
@ -8,6 +8,7 @@
|
||||
* Telegram: https://t.me/terafoundation
|
||||
*/
|
||||
|
||||
var WEB_WALLET_VERSION = "0.04";
|
||||
var SaveIdArr = ["idAccount", "idTo", "idSumSend", "idDescription", "idCurTabName", "idViewBlockNum", "idViewAccountNum", "idViewDappNum",
|
||||
"idLang"];
|
||||
var CONFIG_DATA = {PRICE_DAO:{NewAccount:10}, MaxNumBlockDB:0, MaxAccID:0, MaxDappsID:0};
|
||||
@ -455,7 +456,7 @@ function SetAccountsCard(Data,AccountsDataStr)
|
||||
option.text = StrText;
|
||||
var Str = StrAccCardTemplate;
|
||||
Str = Str.replace("AccCardTemplate", "idCard" + Item.Num);
|
||||
Str = Str.replace(/{Item.Num}/g, Item.Num);
|
||||
Str = Str.replace(/\$Item.Num/g, Item.Num);
|
||||
var Str1, Str2;
|
||||
if(Item.Value.SumCOIN || Item.Value.SumCENT)
|
||||
{
|
||||
@ -468,25 +469,25 @@ function SetAccountsCard(Data,AccountsDataStr)
|
||||
Str2 = "";
|
||||
}
|
||||
var StrCurrencyName = CurrencyName(Item.Currency);
|
||||
Str = Str.replace("{Value.SumCOIN}", Str1);
|
||||
Str = Str.replace("{Value.SumCENT}", Str2);
|
||||
Str = Str.replace("{Value.CurrencyName}", StrCurrencyName);
|
||||
Str = Str.replace("$Value.SumCOIN", Str1);
|
||||
Str = Str.replace("$Value.SumCENT", Str2);
|
||||
Str = Str.replace("$Value.CurrencyName", StrCurrencyName);
|
||||
var CurrencyObj = Item.CurrencyObj;
|
||||
if(!CurrencyObj)
|
||||
CurrencyObj = {IconBlockNum:0, Num:0};
|
||||
Str = Str.replace("{Value.CurrencyIconPath}", RetIconPath(CurrencyObj, 1));
|
||||
Str = Str.replace("$value.currencyiconpath", "src='" + RetIconPath(CurrencyObj, 1) + "'");
|
||||
var CurrencyPath = RetIconPath(CurrencyObj);
|
||||
if(CurrencyPath.substr(0, 6) !== "/file/")
|
||||
Str = Str.replace("prod-card__currency--with-dot", "");
|
||||
Str = Str.replace("{Item.Name}", escapeHtml(Item.Name));
|
||||
Str = Str.replace("$Item.Name", escapeHtml(Item.Name));
|
||||
var SmartObj = Item.SmartObj;
|
||||
if(!SmartObj)
|
||||
SmartObj = {Name:"", Num:0, HTMLLength:0};
|
||||
SmartObj.IconPath = RetIconPath(SmartObj, 0);
|
||||
Str = Str.replace("{SmartObj.IconPath}", SmartObj.IconPath);
|
||||
Str = Str.replace("{SmartObj.Name}", escapeHtml(SmartObj.Name));
|
||||
Str = Str.replace(/{SmartObj.Num}/g, SmartObj.Num);
|
||||
Str = Str.replace(/{SmartObj.HTMLLength}/g, SmartObj.HTMLLength);
|
||||
Str = Str.replace("$smartobj.iconpath", "src='" + SmartObj.IconPath + "'");
|
||||
Str = Str.replace("$SmartObj.Name", escapeHtml(SmartObj.Name));
|
||||
Str = Str.replace(/\$SmartObj.Num/g, SmartObj.Num);
|
||||
Str = Str.replace(/\$SmartObj.HTMLLength/g, SmartObj.HTMLLength);
|
||||
if(SmartObj.Num)
|
||||
{
|
||||
Str = Str.replace("prod-card__link--connect", "myhidden");
|
||||
@ -639,8 +640,8 @@ function SetExplorerData(Data)
|
||||
FirstCallDiagram = 0;
|
||||
var StrVersion = " 0." + Data.VersionNum;
|
||||
$("idBHeight").innerText = Data.MaxNumBlockDB;
|
||||
$("idBCurrent").innerText = Data.CurBlockNum;
|
||||
$("idBVersion").innerText = StrVersion;
|
||||
$("idWVersion").innerText = WEB_WALLET_VERSION;
|
||||
SetArrLog(Data.ArrLog);
|
||||
};
|
||||
|
||||
@ -1030,14 +1031,14 @@ function ViewDapps()
|
||||
function FillDappCard(Str,Item)
|
||||
{
|
||||
CardMapList[Item.Num] = Item;
|
||||
Str = Str.replace(/{Item.Num}/g, Item.Num);
|
||||
Str = Str.replace("{Item.Name}", escapeHtml(Item.Name));
|
||||
Str = Str.replace("{Item.Description}", escapeHtml(Item.Description));
|
||||
Str = Str.replace("{Item.Owner}", Item.Owner);
|
||||
Str = Str.replace(/\$Item.Num/g, Item.Num);
|
||||
Str = Str.replace("$Item.Name", escapeHtml(Item.Name));
|
||||
Str = Str.replace("$Item.Description", escapeHtml(Item.Description));
|
||||
Str = Str.replace("$Item.Owner", Item.Owner);
|
||||
if(!Item.TokenGenerate)
|
||||
Str = Str.replace("dapp-modal__ok-token", "myhidden");
|
||||
Str = Str.replace(/{Item.HTMLLength}/g, Item.HTMLLength);
|
||||
Str = Str.replace("{Item.IconPath}", RetIconPath(Item, 0));
|
||||
Str = Str.replace(/\$Item.HTMLLength/g, Item.HTMLLength);
|
||||
Str = Str.replace("$item.iconpath", "src='" + RetIconPath(Item, 0) + "'");
|
||||
return Str;
|
||||
};
|
||||
|
||||
@ -1054,8 +1055,8 @@ function OpenDappCard(Num)
|
||||
if(!Item)
|
||||
return ;
|
||||
var Str = FillDappCard(StrDappCardTemplate, Item);
|
||||
Str = Str.replace("{Item.Account}", RetBaseAccount(Item));
|
||||
Str = Str.replace("{Item.BlockNum}", RetOpenBlock(Item.BlockNum, 2));
|
||||
Str = Str.replace("$Item.Account", RetBaseAccount(Item));
|
||||
Str = Str.replace("$Item.BlockNum", RetOpenBlock(Item.BlockNum, 2));
|
||||
Str = FillDappCategory(Str, Item, 1);
|
||||
Str = FillDappCategory(Str, Item, 2);
|
||||
Str = FillDappCategory(Str, Item, 3);
|
||||
@ -1077,7 +1078,7 @@ function FillDappCategory(Str,Item,Num)
|
||||
var Value = Item["Category" + Num];
|
||||
if(Value && MapCategory[Value])
|
||||
{
|
||||
Str = Str.replace("{Item.Category" + Num + "}", MapCategory[Value]);
|
||||
Str = Str.replace("$Item.Category" + Num, MapCategory[Value]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1199,7 +1200,7 @@ function InitLangItems()
|
||||
continue;
|
||||
if(!Text)
|
||||
continue;
|
||||
if(Text.substr(0, 1) === "{")
|
||||
if(Text.substr(0, 1) === "$")
|
||||
continue;
|
||||
if(Text.toUpperCase() == Text.toLowerCase())
|
||||
continue;
|
||||
@ -1266,31 +1267,32 @@ LangMap["RUS"] = {"TERA WALLET":"TERA КОШЕЛЕК", "Generate key":"Сген
|
||||
"Save key":"Сохран.", "+ CREATE A NEW ACCOUNT":"+ СОЗДАТЬ НОВЫЙ СЧЕТ", "Create account":"Создать счет", "Send":"Отправить",
|
||||
"CONFIRM":"Подтверждение", "Accounts":"Счета", "Account(s)":"Счет(а,ов)", "Blocks and Tx":"Блоки и Транзакции", "Counters":"Показатели",
|
||||
"Open DApp":"Открыть Дапп", "Back":"Назад", "Delete":"Удалить", "Save to book":"Сохранить в книгу", "Choose":"Выбрать", "RECONNECT":"КОННЕКТ",
|
||||
"DApps":"ДАппс", "ID":"ИД", "Amount":"Величина", "Cur":"Вал", "Name":"Имя", "PubKey":"Пуб.ключ", "Operation":"Операция", "Smart":"Смарт",
|
||||
"DApps":"DApps", "ID":"ИД", "Amount":"Величина", "Cur":"Вал", "Name":"Имя", "PubKey":"Пуб.ключ", "Operation":"Операция", "Smart":"Смарт",
|
||||
"Block Num":"Ном блока", "Num":"Ном", "Date":"Дата", "Data Hash":"Хеш данных", "PowHash":"Хеш сложности", "Block Hash":"Хеш блока",
|
||||
"Bytes":"Байт", "Pow":"Сложн", "Miner":"Майнер", "(secret)":"(секрет)", "Show":"Показать", "TERA":"TERA", "Blockchain height:":"Высота блокчейна:",
|
||||
"Current create:":"Текущий блок:", "Protocol ver:":"Версия протокола:", "ID: {Item.Num}":"ИД: {Item.Num}", "Token generate":"Генерация токенов",
|
||||
"ACCOUNTS":"СЧЕТА", "SEND":"ПОСЛАТЬ", "DAPPS":"ДАППС", "EXPLORER":"ПРОСМ", "ATTENTION: Before using the wallet, save the private key.":"ВНИМАНИЕ: Перед использованием кошелька сохраните приватный ключ",
|
||||
"Current create:":"Текущий блок:", "Protocol ver:":"Версия протокола:", "ID: $Item.Num":"ИД: $Item.Num", "Token generate":"Генерация токенов",
|
||||
"ACCOUNTS":"СЧЕТА", "SEND":"ОТПРАВИТЬ", "DAPPS":"ДАППС", "EXPLORER":"ПРОСМ", "ATTENTION: Before using the wallet, save the private key.":"ВНИМАНИЕ: Перед использованием кошелька сохраните приватный ключ",
|
||||
"Web-site":"Веб-сайт", "Bitcointalk":"Bitcointalk", "Twitter":"Твиттер", "Telegram":"Телеграм", "Discord":"Дискорд", "QQchat":"QQchat",
|
||||
"Buy/sell/mine TERA":"Купить/Продать", "+ CREATE NEW":"+ СОЗДАТЬ", "Confirm Transaction":"Подтверждение транзакции", "CREATE DAPPS":"СОЗДАТЬ",
|
||||
"Set pass":"Установить пароль", "Unlock":"Разблокировать", "Entrance to sub-wallet":"Войти в под-кошелек", "Public name":"Публичное имя",
|
||||
"Currency":"Валюта", "Pay to:":"Получатель:", "Amount:":"Сумма:", "Description:":"Описание:", "Welcome to TERA Wallet":"Добропожаловать в кошелек TERA",
|
||||
"Currency":"Валюта", "Pay to:":"Получатель:", "Amount:":"Сумма:", "Description:":"Описание:", "Welcome to TERA Wallet":"Добро пожаловать в кошелек TERA",
|
||||
"Edit your wallet":"Редактирование вашего кошелька", "Key settings":"Задание ключей", "KEY SETTINGS":"КЛЮЧИ", "Create an account":"Создание счета",
|
||||
"Sending coins":"Отправка монет", "Decentralized applications (dApps)":"Децентрализованные приложения (Даппс)", "Secure your wallet":"Безопасность вашего кошелька",
|
||||
"Sending coins":"Отправка монет", "Decentralized applications (dApps)":"Децентрализованные приложения (DApps)", "Secure your wallet":"Безопасность вашего кошелька",
|
||||
"Wallet is secured":"Установлен пароль", "Total":"Всего", "Item.Name":"Item.Name", "You have no accounts yet":"У вас нет ни одного счета",
|
||||
"Wait 10-15 sec":"Ждите 10-15 сек", "Creating your account":"Идет создание вашего счета", "From:":"Отправитель:", "Set a password for protect entry":"Установите пароль для безопасности",
|
||||
"Enter password to unlock wallet":"Введите пароль для разблокировки кошелька", "From ID:":"Отправитель:", "Pay to ID:":"Получатель:",
|
||||
"Account":"Счет", "Owner":"Владелец", "Block num":"Ном блока", "Private key (secret)":"Приватный ключ (секретно)", "Load key":"Загруз.",
|
||||
"Create your first account and start using TERA":"Создайте свой первый счет и начните использовать TERA", "0 Accounts":"0 Счетов",
|
||||
"OWNER: {Item.Owner}":"Владелец: {Item.Owner}", "More info":"Информация", "Public key":"Публичный ключ", "Enter number of dapp":"Введите номер Даппа",
|
||||
"Enter the dapps number that will be added to your account. Attention make sure that you trust this dapp, otherwise you may lose all funds in this account.":"Введите номер Даппа, который будет добавлен в ваш аккаунт. Внимание убедитесь, что Вы доверяете ему, в противном случае вы можете потерять все средства на этом счете."};
|
||||
"Enter the dapps number that will be added to your account. Attention make sure that you trust this dapp, otherwise you may lose all funds in this account.":"Введите номер Даппа, который будет добавлен в ваш аккаунт. Внимание убедитесь, что Вы доверяете ему, в противном случае вы можете потерять все средства на этом счете.",
|
||||
"Sending Tx":"Отправка транзакции", };
|
||||
LangMap["简体中文"] = {"TERA WALLET":"TERA 钱包", "Generate key":"生成私钥", "OK":"OK", "Cancel":"取消", "Edit":"编辑", "Save key":"保存私钥",
|
||||
"+ CREATE A NEW ACCOUNT":"+ 新建账号", "Create account":"创建账号", "Send":"发送", "SEND":"转账", "CONFIRM":"确认", "Accounts":"账号", "Account(s)":"账号",
|
||||
"Blocks and Tx":"区块和交易", "Counters":"状态统计", "Open DApp":"打开DApp", "Back":"返回", "Delete":"删除", "Save to book":"保存到地址本", "Choose":"选择",
|
||||
"RECONNECT":"重连", "DApps":"DApps", "ID":"ID", "Amount":"余额", "Cur":"币种", "Name":"名称", "PubKey":"公钥", "Operation":"操作次数", "Smart":"DApp",
|
||||
"Block Num":"区块编号", "Num":"编号", "Date":"日期", "Data Hash":"数据哈希", "PowHash":"Pow哈希", "Block Hash":"区块哈希", "Bytes":"字节", "Pow":"Pow",
|
||||
"Miner":"矿工", "(secret)":"(机密)", "Show":"显示", "TERA":"TERA", "Blockchain height:":"区块高度:", "Current create:":"最近区块:", "Protocol ver:":"协议版本:",
|
||||
"ID: {Item.Num}":"ID: {Item.Num}", "Token generate":"生成代币", "ACCOUNTS":"账号", "DAPPS":"DAPPS", "EXPLORER":"浏览器", "ATTENTION: Before using the wallet, save the private key.":"注意: 使用钱包前,务必保存好私钥。",
|
||||
"Token generate":"生成代币", "ACCOUNTS":"账号", "DAPPS":"DAPPS", "EXPLORER":"浏览器", "ATTENTION: Before using the wallet, save the private key.":"注意: 使用钱包前,务必保存好私钥。",
|
||||
"Web-site":"官网", "Bitcointalk":"创世贴", "Twitter":"推特", "Telegram":"电报", "Discord":"Discord", "QQchat":"QQ群", "Buy/sell/mine TERA":"TERA 交易/挖矿",
|
||||
"+ CREATE NEW":"+ 新建", "Confirm Transaction":"确认交易", "CREATE DAPPS":"创建DAPPS", "Set pass":"设置密码", "Unlock":"解锁", "Entrance to sub-wallet":"进入子钱包",
|
||||
"Public name":"名称", "Currency":"币种", "Pay to:":"收款:", "Amount:":"金额:", "Description:":"描述:", "Welcome to TERA Wallet":"欢迎使用TERA钱包",
|
||||
@ -1307,9 +1309,8 @@ LangMap["한글"] = {"TERA WALLET":"TERA 지갑", "Generate key":"개인 키 생
|
||||
"Choose":"선택", "RECONNECT":"다시 연결", "DApps":"DApps", "ID":"ID", "Amount":"잔금", "Cur":"화폐", "Name":"이름", "PubKey":"공공키", "Operation":"조작 횟수",
|
||||
"Smart":"DApp", "Block Num":"블록 번호", "Num":"번호", "Date":"날짜", "Data Hash":"데이터 하희", "PowHash":"Pow하희", "Block Hash":"블록 하희",
|
||||
"Bytes":"바이트", "Pow":"Pow", "Miner":"바이트", "(secret)":"(비밀)", "Show":"쇼", "TERA":"TERA", "Blockchain height:":"블록높이:", "Current create:":"최근 블록:",
|
||||
"Protocol ver:":"프로토콜 버전:", "ID: {Item.Num}":"ID: {Item.Num}", "Token generate":"생성대폐", "ACCOUNTS":"계정", "SEND":"발송", "DAPPS":"DAPPS",
|
||||
"EXPLORER":"브라우저", "ATTENTION: Before using the wallet, save the private key.":"주의: 지갑을 사용하기 전에 반드시 개인 키를 저장해야 한다.", "Web-site":"사이트",
|
||||
"Bitcointalk":"비트 화폐포럼", "Twitter":"트위터", "Telegram":"전보", "Discord":"Discord", "QQchat":"QQ ", "Buy/sell/mine TERA":"TERA거래 /채광",
|
||||
"Protocol ver:":"프로토콜 버전:", "Token generate":"생성대폐", "ACCOUNTS":"계정", "SEND":"발송", "DAPPS":"DAPPS", "EXPLORER":"브라우저", "ATTENTION: Before using the wallet, save the private key.":"주의: 지갑을 사용하기 전에 반드시 개인 키를 저장해야 한다.",
|
||||
"Web-site":"사이트", "Bitcointalk":"비트 화폐포럼", "Twitter":"트위터", "Telegram":"전보", "Discord":"Discord", "QQchat":"QQ ", "Buy/sell/mine TERA":"TERA거래 /채광",
|
||||
"+ CREATE NEW":"+신건", "Confirm Transaction":"거래 확인", "CREATE DAPPS":" DAPPS만들기", "Set pass":"비밀번호 설정", "Unlock":"잠금 풀기", "Entrance to sub-wallet":"부속 지갑 들어가기",
|
||||
"Public name":"이름", "Currency":"화폐", "Pay to:":"지불:", "Amount:":"수량:", "Description:":"묘사:", "Welcome to TERA Wallet":"TERA 지갑을 환영합니다",
|
||||
"Edit your wallet":"지갑 편집", "Key settings":"개인 키 설정", "KEY SETTINGS":"개인 키 설정", "Create an account":"계정 만들기", "Sending coins":"동전 보내기",
|
||||
|
@ -12,9 +12,8 @@ var MIN_VERSION = 1114;
|
||||
var COUNT_BLOCK_PROOF = 300;
|
||||
var MIN_SUM_POWER = 0;
|
||||
var MainServer = undefined;
|
||||
var MaxConnectedCount = 10;
|
||||
var MaxConnectedCount = 50;
|
||||
var TIME_LENGTH_CONNECT_ALL = 2 * 1000;
|
||||
var MAX_TIME_FOR_CONNECT = 1000;
|
||||
var StartTimeConnecting = 0;
|
||||
var ConnectedCount = 0;
|
||||
var NETWORK = "TERA-MAIN";
|
||||
@ -27,8 +26,7 @@ var ServerMainMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"},
|
||||
"port":80, "Name":"SUPPORT2", "System":1}, "t1.teraexplorer.com":{"ip":"t1.teraexplorer.com", "port":80, "Name":"t1.teraexplorer.com",
|
||||
"System":1}, };
|
||||
var ServerTestMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "dappsgate.com":{"ip":"dappsgate.com", "port":88,
|
||||
"Name":"SUPPORT1", "System":1}, "terablockchain.org":{"ip":"terablockchain.org", "port":88, "Name":"SUPPORT2", "System":1},
|
||||
};
|
||||
"Name":"SUPPORT1", "System":1}, };
|
||||
|
||||
function StartWebWallet()
|
||||
{
|
||||
@ -65,16 +63,21 @@ function OnInitWebWallet()
|
||||
|
||||
function SaveServerMap()
|
||||
{
|
||||
var arr = [];
|
||||
for(var key in ServerMap)
|
||||
var Arr = GetArrFromServerMap();
|
||||
Arr.sort(function (a,b)
|
||||
{
|
||||
var Item = ServerMap[key];
|
||||
if(Item.SumPower >= MIN_SUM_POWER)
|
||||
if(a.SumPower === b.SumPower)
|
||||
return a.DeltaTime - b.DeltaTime;
|
||||
else
|
||||
return b.SumPower - a.SumPower;
|
||||
});
|
||||
var Arr2 = [];
|
||||
for(var i = 0; i < Math.min(Arr.length, MaxConnectedCount); i++)
|
||||
{
|
||||
arr.push({ip:Item.ip, port:Item.port});
|
||||
var Item = Arr[i];
|
||||
Arr2.push({ip:Item.ip, port:Item.port, Stat:Item.Stat, t:Item.DeltaTime});
|
||||
}
|
||||
}
|
||||
Storage.setItem(NETWORK + "NodesArrayList", JSON.stringify(arr));
|
||||
Storage.setItem(NETWORK + "NodesArrayList", JSON.stringify(Arr2));
|
||||
};
|
||||
|
||||
function SetStatus(Str)
|
||||
@ -167,6 +170,26 @@ function DoNodeList(Item)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function GetArrFromServerMap()
|
||||
{
|
||||
var Arr = [];
|
||||
for(var key in ServerMap)
|
||||
{
|
||||
var Item = ServerMap[key];
|
||||
if(Item.port)
|
||||
{
|
||||
if(!Item.SumPower)
|
||||
Item.SumPower = 0;
|
||||
if(!Item.DeltaTime)
|
||||
Item.DeltaTime = 10000;
|
||||
if(!Item.Stat)
|
||||
Item.Stat = 0;
|
||||
Arr.push(Item);
|
||||
}
|
||||
}
|
||||
return Arr;
|
||||
};
|
||||
var idTimeFindLider = 0;
|
||||
var CountDoWalletInfoAll = 0;
|
||||
var CountDoWalletInfoGet = 0;
|
||||
@ -175,15 +198,7 @@ function LoopWalletInfo()
|
||||
{
|
||||
CountDoWalletInfoAll = 0;
|
||||
CountDoWalletInfoGet = 0;
|
||||
var Arr = [];
|
||||
for(var key in ServerMap)
|
||||
{
|
||||
var Item = ServerMap[key];
|
||||
if(Item.port && Item.DeltaTime < MAX_TIME_FOR_CONNECT)
|
||||
{
|
||||
Arr.push(Item);
|
||||
}
|
||||
}
|
||||
var Arr = GetArrFromServerMap();
|
||||
Arr.sort(function (a,b)
|
||||
{
|
||||
a.DeltaTime - b.DeltaTime;
|
||||
@ -215,10 +230,10 @@ function DoWalletInfo(Item)
|
||||
{
|
||||
Item.Name = Data.NODES_NAME;
|
||||
Item.GetWalletInfo = 1;
|
||||
Item.DeltaTime = Date.now() - Item.StartTime;
|
||||
Item.DeltaTime2 = Date.now() - Item.StartTime;
|
||||
Item.BlockChain = Data.BlockChain;
|
||||
Item.MaxNumBlockDB = Data.MaxNumBlockDB;
|
||||
SetStatus("Get: " + Item.ip + ":" + Item.port + " t:" + Item.DeltaTime);
|
||||
SetStatus("Get: " + Item.ip + ":" + Item.port + " t:" + Item.DeltaTime2);
|
||||
CountDoWalletInfoGet++;
|
||||
if(idTimeFindLider && CountDoWalletInfoAll && CountDoWalletInfoGet >= 2 && CountDoWalletInfoGet / CountDoWalletInfoAll > 0.7)
|
||||
{
|
||||
@ -265,14 +280,15 @@ function FindLider()
|
||||
}
|
||||
Arr.sort(function (a,b)
|
||||
{
|
||||
return a.DeltaTime - b.DeltaTime;
|
||||
return a.DeltaTime2 - b.DeltaTime2;
|
||||
});
|
||||
for(var i = 0; i < Arr.length; i++)
|
||||
{
|
||||
var Item = Arr[i];
|
||||
if(Item.SumPower === MaxKey)
|
||||
{
|
||||
SetStatus("Find " + Item.ip + ":" + Item.port + " pow=" + Item.SumPower + " t:" + Item.DeltaTime + " ms");
|
||||
Item.Stat++;
|
||||
SetStatus("Find " + Item.ip + ":" + Item.port + " pow=" + Item.SumPower + " t:" + Item.DeltaTime2 + " ms");
|
||||
MainServer = Item;
|
||||
SaveServerMap();
|
||||
break;
|
||||
|
@ -1632,7 +1632,7 @@
|
||||
<DIV id="idNetworkView" style="display: none">
|
||||
<H3>Network connections:</H3>
|
||||
<INPUT type="checkbox" id="idUseDirectIP">Run server and use direct IP:<BR>
|
||||
IP:<INPUT maxlength="16" id="idIP"> Port:<INPUT maxlength="9" id="idPort"><BR>
|
||||
IP:<INPUT maxlength="20" id="idIP"> Port:<INPUT maxlength="9" id="idPort"><BR>
|
||||
<!--<INPUT type="checkbox" id="idUseIncomeGrayIP">Allow connection users without a direct ip:<BR>-->
|
||||
<!--White list nodes (HEX-format):<BR>-->
|
||||
<TEXTAREA id="idNodeWhiteList" rows="4" cols="100" style="display: none"> </TEXTAREA>
|
||||
|
@ -64,7 +64,6 @@
|
||||
</div>
|
||||
<h1 class="welcome__title title">Welcome to TERA Wallet</h1>
|
||||
<p><a onclick="SelectTab('TabKeySet')" class="pointer">ATTENTION: Before using the wallet, save the private key.</a></p>
|
||||
<!--<a class="welcome__link btn" onclick="SelectTab('TabAccounts')">Open wallet</a>-->
|
||||
|
||||
<ul id="idStableScroll" align='center' class="social-list">
|
||||
<li class="social-list__item"><a href="https://terafoundation.org/">Web-site</a></li>
|
||||
@ -85,7 +84,6 @@
|
||||
</div>
|
||||
<div class="wallet-settings__field key-field">
|
||||
<p class="key-field__title">Private key (secret)</p>
|
||||
<!--<button class="key-field__btn btn-no-bg" onclick="pasteKey(event, 'idPrivKeyEdit')">Paste</button>-->
|
||||
|
||||
<textarea name="private-key" id="idPrivKeyEdit" placeholder="Insert your private key or generate a new key below..." class="key-field__textarea" oninput="OnEditPrivKey()">
|
||||
</textarea>
|
||||
@ -100,14 +98,12 @@
|
||||
<button class="btn wallet-settings__btn-270" id="okEditBtn" style="margin-bottom: 15px;" onclick="OnPrivKeyOK()">OK</button>
|
||||
<button class="btn btn--white wallet-settings__btn-270" id="cancelEditBtn" style="margin-bottom: 15px;" onclick="OnPrivKeyCancel()">Cancel</button>
|
||||
</div>
|
||||
<!--<button class="btn wallet-settings__go-btn" onclick="SelectTab('TabAccounts')">Go to accounts</button>-->
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section id="TabKeySet" class="wallet-settings wallet-settings--info" style="display: none;">
|
||||
<div class="wallet-settings__title-wrap">
|
||||
<!--<a class="back-link" onclick="SelectTab('TabWelcome')"><span>Back</span></a>-->
|
||||
<h2 class="wallet-settings__title title">Key settings</h2>
|
||||
<a class="modal-lock pointer" id="idPasswordEdit" onclick="openModal('password-modal-set');"><svg width="14" height="18" viewBox="0 0 14 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 5V10H10.5H12H13C13.5523 10 14 10.4477 14 11V17C14 17.5523 13.5523 18 13 18H1C0.447716 18 0 17.5523 0 17V11C0 10.4477 0.447715 10 1 10H2V5C2 2.23858 4.23858 0 7 0C9.76142 0 12 2.23858 12 5V7H10.5V5C10.5 3.067 8.933 1.5 7 1.5C5.067 1.5 3.5 3.067 3.5 5Z" fill="var(--fill--password)" fill-opacity="0.2"/>
|
||||
@ -210,29 +206,29 @@
|
||||
<li class="prod-list__item prod-card prod-card--line prod-card--switch find--switch" id="AccCardTemplate">
|
||||
<div class="prod-card__first-line">
|
||||
<span class="hidden id-sign">ID: </span>
|
||||
<a target='_blank' class="prod-card__id prod-card__id--mobile">{Item.Num}</a>
|
||||
<a onclick="OpenHistoryPage({Item.Num})" class="prod-card__id prod-card__id--mobile-active pointer">{Item.Num}</a>
|
||||
<a onclick="OpenHistoryPage({Item.Num})" target='_blank' class="prod-card__id prod-card__id--desktop pointer">{Item.Num}</a>
|
||||
<a target='_blank' class="prod-card__id prod-card__id--mobile">$Item.Num</a>
|
||||
<a onclick="OpenHistoryPage($Item.Num)" class="prod-card__id prod-card__id--mobile-active pointer">$Item.Num</a>
|
||||
<a onclick="OpenHistoryPage($Item.Num)" target='_blank' class="prod-card__id prod-card__id--desktop pointer">$Item.Num</a>
|
||||
<div class="prod-card__heading">
|
||||
<span class="prod-card__coins-count">{Value.SumCOIN}<sup>{Value.SumCENT}</sup><br>
|
||||
<span class="light-grey-text small-text mob-hidden">{Value.CurrencyName}</span>
|
||||
<span class="prod-card__coins-count">$Value.SumCOIN<sup>$Value.SumCENT</sup><br>
|
||||
<span class="light-grey-text small-text mob-hidden">$Value.CurrencyName</span>
|
||||
</span>
|
||||
<span class="prod-card__currency prod-card__currency--with-dot">
|
||||
<img src="{Value.CurrencyIconPath}" width="18" height="18" alt="">
|
||||
<img $value.currencyiconpath width="18" height="18" alt="">
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<span class="prod-card__descr light-grey-text">{Item.Name}</span>
|
||||
<span class="prod-card__descr light-grey-text">$Item.Name</span>
|
||||
</div>
|
||||
|
||||
<div class="prod-card__footer">
|
||||
<div class="prod-card__footer-wrap" >
|
||||
<a onclick="OpenDapps({SmartObj.Num},{Item.Num},{SmartObj.HTMLLength})" class="prod-card__link prod-card__link--dapp">
|
||||
<img src="{SmartObj.IconPath}" alt="." width="32" height="32">
|
||||
<span class="prod-card__dapp-name mob-hidden">{SmartObj.Name}</span>
|
||||
<a onclick="OpenDapps($SmartObj.Num,$Item.Num,$SmartObj.HTMLLength)" class="prod-card__link prod-card__link--dapp">
|
||||
<img $smartobj.iconpath alt="." width="32" height="32">
|
||||
<span class="prod-card__dapp-name mob-hidden">$SmartObj.Name</span>
|
||||
</a>
|
||||
|
||||
<a class="prod-card__link prod-card__link--connect" onclick="ConnectSmart({Item.Num})">
|
||||
<a class="prod-card__link prod-card__link--connect" onclick="ConnectSmart($Item.Num)">
|
||||
<svg class="prod-card__dapp-icon" width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="15" cy="15" r="14.5" fill="white" fill-opacity="0.01" stroke="#F2F2F2"/>
|
||||
<path d="M15.5 10H14.5V14.5H10V15.5H14.5V20H15.5V15.5H20V14.5H15.5V10Z" fill="#445368"/>
|
||||
@ -240,19 +236,19 @@
|
||||
<span class="prod-card__dapp-text mob-hidden">Connect DApp...</span>
|
||||
</a>
|
||||
|
||||
<button type="button" class="prod-card__drop-btn btn-no-bg mob-hidden" onclick="showMenu({Item.Num})" onblur="closeMenu({Item.Num})">
|
||||
<button type="button" class="prod-card__drop-btn btn-no-bg mob-hidden" onclick="showMenu($Item.Num)" onblur="closeMenu($Item.Num)">
|
||||
<svg width="4" height="16" viewBox="0 0 4 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2C3.5 2.82843 2.82843 3.5 2 3.5C1.17157 3.5 0.5 2.82843 0.5 2C0.5 1.17157 1.17157 0.5 2 0.5C2.82843 0.5 3.5 1.17157 3.5 2ZM3.5 8C3.5 8.82843 2.82843 9.5 2 9.5C1.17157 9.5 0.5 8.82843 0.5 8C0.5 7.17157 1.17157 6.5 2 6.5C2.82843 6.5 3.5 7.17157 3.5 8ZM2 15.5C2.82843 15.5 3.5 14.8284 3.5 14C3.5 13.1716 2.82843 12.5 2 12.5C1.17157 12.5 0.5 13.1716 0.5 14C0.5 14.8284 1.17157 15.5 2 15.5Z" fill="#445368"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="prod-card__dropdown" style="display: none;" id="idBt{Item.Num}">
|
||||
<a class="editdapp" onclick="SetSmart({Item.Num},{SmartObj.Num})">Change dApp</a>
|
||||
<a class="editdapp" onclick="DelSmart({Item.Num},-1)">Disconnect dApp</a>
|
||||
<a onclick="DelAccount({Item.Num})">Hide account</a>
|
||||
<div class="prod-card__dropdown" style="display: none;" id="idBt$Item.Num">
|
||||
<a class="editdapp" onclick="SetSmart($Item.Num,$SmartObj.Num)">Change dApp</a>
|
||||
<a class="editdapp" onclick="DelSmart($Item.Num,-1)">Disconnect dApp</a>
|
||||
<a onclick="DelAccount($Item.Num)">Hide account</a>
|
||||
<a onclick="RestoreAllAccounts()">Show All accounts</a>
|
||||
</div>
|
||||
</div>
|
||||
<a class="prod-card__footer-empty" style="display: none;" onclick="ConnectSmart({Item.Num},{SmartObj.Num})"><span class="mob-hidden">Connect dapp...</span></a>
|
||||
<a class="prod-card__footer-empty" style="display: none;" onclick="ConnectSmart($Item.Num,$SmartObj.Num)"><span class="mob-hidden">Connect dapp...</span></a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -407,26 +403,19 @@
|
||||
<ul id="DappRowCardTemplate" class="grid prod-list">
|
||||
<li class="prod-card dapps-page__card">
|
||||
<div class="prod-card__first-line">
|
||||
<span class="prod-card__id light-grey-text">ID: {Item.Num}</span>
|
||||
<span class="prod-card__id light-grey-text">OWNER: {Item.Owner}</span>
|
||||
<a onclick="OpenDappCard({Item.Num})" class="prod-card__link prod-card__link--info">More info</a>
|
||||
<span class="prod-card__id light-grey-text">ID: $Item.Num</span>
|
||||
<span class="prod-card__id light-grey-text">OWNER: $Item.Owner</span>
|
||||
<a onclick="OpenDappCard($Item.Num)" class="prod-card__link prod-card__link--info">More info</a>
|
||||
</div>
|
||||
<div class="prod-card__second-line">
|
||||
<div class="prod-card__second-line-left">
|
||||
<div class="prod-card__heading">
|
||||
<a class="prod-card__link" onclick="OpenOnlyDapp({Item.Num},{Item.HTMLLength})">{Item.Name}</a>
|
||||
<!--<span class="lighter-grey-text">Without token generate</span>-->
|
||||
<!--<span class="dapp-modal__ok-token">Token generate</span>-->
|
||||
<a class="prod-card__link" onclick="OpenOnlyDapp($Item.Num,$Item.HTMLLength)">$Item.Name</a>
|
||||
</div>
|
||||
<p>{Item.Description}</p>
|
||||
<!-- <ol>-->
|
||||
<!--<li>Gaming & VR</li>-->
|
||||
<!--<li>Gaming & VR</li>-->
|
||||
<!--<li>Gaming & VR</li>-->
|
||||
<!--</ol> -->
|
||||
<p>$Item.Description</p>
|
||||
</div>
|
||||
<div class="prod-card__second-line-img">
|
||||
<a class="prod-card__link" onclick="OpenOnlyDapp({Item.Num},{Item.HTMLLength})"><img src="{Item.IconPath}" width="32"></a>
|
||||
<a class="prod-card__link" onclick="OpenOnlyDapp($Item.Num,$Item.HTMLLength)"><img $item.iconpath width="32"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@ -436,9 +425,10 @@
|
||||
|
||||
<section id="TabExplorer" class="explorer-page" style="display: none;">
|
||||
<div id="idCurrentBlockNum" class="currentBlockNum">
|
||||
<p><span>Blockchain height:</span> <b id="idBHeight">26003136</b></p>
|
||||
<p><span>Current create:</span> <b id="idBCurrent">26003140</b></p>
|
||||
<p><span>Protocol ver:</span> <b id="idBVersion">0.1057</b></p>
|
||||
<p><span>Blockchain height:</span> <b id="idBHeight">00000000</b></p>
|
||||
<!--<p><span>Current create:</span> <b id="idBCurrent">00000000</b></p>-->
|
||||
<p><span>Protocol ver:</span> <b id="idBVersion">00000</b></p>
|
||||
<p><span>Wallet ver:</span> <b id="idWVersion">000</b></p>
|
||||
</div>
|
||||
|
||||
<button onclick="ViewCurrent(DefAccounts,1,this);" class="btview explorer-page__explore btn btn--white btn--full-width">Accounts</button>
|
||||
@ -518,12 +508,12 @@
|
||||
<section class="dapp-modal modal" id="DappCardTemplate" style="display: none;">
|
||||
<div class="modal__header">
|
||||
<div class="modal__title-wrap">
|
||||
<span class="light-grey-text">ID: {Item.Num}</span>
|
||||
<h3>{Item.Name}</h3>
|
||||
<span class="light-grey-text">ID: $Item.Num</span>
|
||||
<h3>$Item.Name</h3>
|
||||
<ol class="modal__ol">
|
||||
<li class="modal__category dappcategory1">{Item.Category1}</li>
|
||||
<li class="modal__category dappcategory2">{Item.Category2}</li>
|
||||
<li class="modal__category dappcategory3">{Item.Category3}</li>
|
||||
<li class="modal__category dappcategory1">$Item.Category1</li>
|
||||
<li class="modal__category dappcategory2">$Item.Category2</li>
|
||||
<li class="modal__category dappcategory3">$Item.Category3</li>
|
||||
</ol>
|
||||
<p class="dapp-modal__token-status dapp-modal__token-status--ok">
|
||||
<!--<span class="light-grey-text">Without token generate</span>-->
|
||||
@ -531,27 +521,27 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal__img-wrap">
|
||||
<img src="{Item.IconPath}" alt="dApp logo" width="32">
|
||||
<img $item.iconpath alt="dApp logo" width="32">
|
||||
</div>
|
||||
</div>
|
||||
<p>{Item.Description}</p>
|
||||
<p>$Item.Description</p>
|
||||
<dl class="modal__def-list def-list">
|
||||
<div class="def-list__item">
|
||||
<dt>Account</dt>
|
||||
<dd>{Item.Account}</dd>
|
||||
<dd>$Item.Account</dd>
|
||||
</div>
|
||||
<div class="def-list__item">
|
||||
<dt>Owner</dt>
|
||||
<dd>{Item.Owner}</dd>
|
||||
<dd>$Item.Owner</dd>
|
||||
</div>
|
||||
<div class="def-list__item">
|
||||
<dt>Block num</dt>
|
||||
<dd>{Item.BlockNum}</dd>
|
||||
<dd>$Item.BlockNum</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<div class="modal__btns-wrap">
|
||||
<button class="btn" onclick="OpenOnlyDapp({Item.Num},{Item.HTMLLength})">Open DApp</button>
|
||||
<button class="btn" onclick="OpenOnlyDapp($Item.Num,$Item.HTMLLength)">Open DApp</button>
|
||||
<button class="btn btn--white" onclick="closeModal()">Back</button>
|
||||
</div>
|
||||
|
||||
|
@ -611,38 +611,6 @@ module.exports = class CConnect extends require("./transfer-msg")
|
||||
Info.Node.IsAddrList = Data.IsAddrList
|
||||
AddNodeInfo(Info.Node, "RETGETNODES length=" + arr.length)
|
||||
}
|
||||
static
|
||||
RETGETNODES2_F()
|
||||
{
|
||||
return "{arr:[\
|
||||
{\
|
||||
addrStr:str64,\
|
||||
ip:str30,\
|
||||
port:uint16,\
|
||||
portweb:uint16,\
|
||||
LastTime:uint,\
|
||||
DeltaTime:uint,\
|
||||
StatData:arr70\
|
||||
}\
|
||||
],\
|
||||
IsAddrList:byte}";
|
||||
}
|
||||
RETGETNODES2(Info, CurTime)
|
||||
{
|
||||
var Data = this.DataFromF(Info);
|
||||
var arr = Data.arr;
|
||||
if(arr && arr.length > 0)
|
||||
{
|
||||
for(var i = 0; i < arr.length; i++)
|
||||
{
|
||||
var Item = this.AddToArrNodes(arr[i], true);
|
||||
if(Item)
|
||||
Item.LastTimeGetNode = CurTime - 0
|
||||
}
|
||||
}
|
||||
Info.Node.IsAddrList = Data.IsAddrList
|
||||
AddNodeInfo(Info.Node, "RETGETNODES2 length=" + arr.length)
|
||||
}
|
||||
GetNewNode(ip, port, addrStr)
|
||||
{
|
||||
var bTemp;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Telegram: https://t.me/terafoundation
|
||||
*/
|
||||
|
||||
global.UPDATE_CODE_VERSION_NUM = 1165;
|
||||
global.UPDATE_CODE_VERSION_NUM = 1167;
|
||||
global.MIN_CODE_VERSION_NUM = 1114;
|
||||
global.MINING_VERSION_NUM = 0;
|
||||
global.InitParamsArg = InitParamsArg;
|
||||
|
@ -117,7 +117,6 @@ module.exports = class CTransport extends require("./connect")
|
||||
Map["GETBLOCK"] = {Period:PERIOD_GET_BLOCK, Hard:2, Process:global.STATIC_PROCESS}
|
||||
Map["GETNODES"] = {Period:1000, Hard:1, LowVersion:1, IsAddrList:1}
|
||||
Map["RETGETNODES"] = {Period:0, IsAddrList:1}
|
||||
Map["RETGETNODES2"] = {Period:0, IsAddrList:1}
|
||||
Map["GETCODE"] = {Period:10000, Hard:1, LowVersion:1, Process:global.STATIC_PROCESS}
|
||||
Map["RETBLOCKHEADER"] = {Period:0}
|
||||
Map["RETBLOCKHEADER100"] = {Period:0}
|
||||
|
@ -284,6 +284,12 @@ WalletFileMap["glass.svg"] = 1;
|
||||
WalletFileMap["dapp-edit.html"] = 1;
|
||||
WalletFileMap["TeraLogo.svg"] = 1;
|
||||
WalletFileMap["mobile-wallet.html"] = "web-wallet.html";
|
||||
var MapRedirect = {};
|
||||
MapRedirect["map.html"] = "teraexplorer.org";
|
||||
MapRedirect["explorer.html"] = "teraexplorer.org";
|
||||
MapRedirect["history.html"] = "teraexplorer.org";
|
||||
MapRedirect["GetSupply"] = "teraexplorer.org";
|
||||
MapRedirect["DappTemplateFile"] = "terawallet.org";
|
||||
global.WebApi2 = {};
|
||||
global.HostingCaller = {};
|
||||
|
||||
@ -355,23 +361,12 @@ function DoCommandNew(response,Type,Path,Params)
|
||||
Method = "DappTemplateFile";
|
||||
if(HTTPS_HOSTING_DOMAIN === "terafoundation.org")
|
||||
{
|
||||
if(Method === "map.html")
|
||||
{
|
||||
response.writeHead(301, {"Location":'http://teraexplorer.org/map.html'});
|
||||
return response.end();
|
||||
}
|
||||
else
|
||||
if(Method === "explorer.html")
|
||||
{
|
||||
response.writeHead(301, {"Location":'http://teraexplorer.org'});
|
||||
return response.end();
|
||||
}
|
||||
else
|
||||
if(Method === "DappTemplateFile")
|
||||
var DomenName = MapRedirect[Method];
|
||||
if(DomenName)
|
||||
{
|
||||
if(Path.substr(0, 1) !== "/")
|
||||
Path = "/" + Path;
|
||||
response.writeHead(301, {"Location":'http://terawallet.org' + Path});
|
||||
response.writeHead(301, {"Location":'http://' + DomenName + Path});
|
||||
return response.end();
|
||||
}
|
||||
}
|
||||
@ -846,6 +841,8 @@ HostingCaller.GetHistoryTransactions = function (Params)
|
||||
};
|
||||
HostingCaller.GetSupply = function (Params)
|
||||
{
|
||||
if(HTTPS_HOSTING_DOMAIN === "terafoundation.org")
|
||||
return "" + (1000000000 - 420000000);
|
||||
var Data = DApps.Accounts.ReadState(0);
|
||||
if(!Data)
|
||||
return "";
|
||||
|
Loading…
Reference in New Issue
Block a user