Thu Aug 1 16:38:01 CST 2019 Source Update...

This commit is contained in:
MiaoWoo 2019-08-01 16:38:01 +08:00
parent 99967cb1d6
commit ea0bd38cae
8 changed files with 84 additions and 65 deletions

View File

@ -1,4 +1,21 @@
/*@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');*/
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
:root { :root {
--blue-grey: #445368; --blue-grey: #445368;
@ -1104,7 +1121,7 @@ textarea {
z-index: 10; z-index: 10;
} }
.dapp-modal { .dapp-modal {
top: calc(50% - 210px); top: calc(50% - 160px);
left: 20px; left: 20px;
right: 20px; right: 20px;
transform: none; transform: none;
@ -1272,7 +1289,7 @@ textarea {
transform: rotate(-45deg); transform: rotate(-45deg);
} }
.modal__btns-wrap .btn { .modal__btns-wrap .btn {
margin: 0 15px; margin: 0 5px;
padding: 14px 10px; padding: 14px 10px;
min-width: 125px; min-width: 125px;
} }
@ -2774,10 +2791,22 @@ iframe
.btn--float .btn--setdapp
{ {
float: left; float: left;
width: 220px; width: 220px;
margin: 10px; margin: 10px;
} }
.dapp_desc
{
word-break: break-all;
}
@media (max-width: 600px)
{
.btn--setdapp
{
float: none;
}
}

View File

@ -959,7 +959,7 @@ function RetOpenDapps(Item,bNum,AccountNum)
if(Item.HTMLLength > 0) if(Item.HTMLLength > 0)
{ {
var StrText = RetIconDapp(Item) + Name; var StrText = RetIconDapp(Item) + Name;
return '<button type="button" class="bt_open_dapp" style="margin: -2px 0 0 0" onclick="OpenDapps(' + Item.Num + ',' + AccountNum + ')">' + StrText + '</button>'; return '<button type="button" class="bt_open_dapp" style="margin: -2px 0 0 0" onclick="OpenDapps(' + Item.Num + ',' + AccountNum + ',1)">' + StrText + '</button>';
} }
else else
return RetIconDapp(Item) + Name; return RetIconDapp(Item) + Name;

View File

@ -8,7 +8,7 @@
* Telegram: https://t.me/terafoundation * Telegram: https://t.me/terafoundation
*/ */
var WEB_WALLET_VERSION = "0.04"; var WEB_WALLET_VERSION = "0.05";
var SaveIdArr = ["idAccount", "idTo", "idSumSend", "idDescription", "idCurTabName", "idViewBlockNum", "idViewAccountNum", "idViewDappNum", var SaveIdArr = ["idAccount", "idTo", "idSumSend", "idDescription", "idCurTabName", "idViewBlockNum", "idViewAccountNum", "idViewDappNum",
"idLang"]; "idLang"];
var CONFIG_DATA = {PRICE_DAO:{NewAccount:10}, MaxNumBlockDB:0, MaxAccID:0, MaxDappsID:0}; var CONFIG_DATA = {PRICE_DAO:{NewAccount:10}, MaxNumBlockDB:0, MaxAccID:0, MaxDappsID:0};
@ -1265,27 +1265,27 @@ var LangMap = {};
LangMap["ENG"] = {}; LangMap["ENG"] = {};
LangMap["RUS"] = {"TERA WALLET":"TERA КОШЕЛЕК", "Generate key":"Сгенерировать ключ", "OK":"OK", "Cancel":"Отмена", "Edit":"Редактирование", LangMap["RUS"] = {"TERA WALLET":"TERA КОШЕЛЕК", "Generate key":"Сгенерировать ключ", "OK":"OK", "Cancel":"Отмена", "Edit":"Редактирование",
"Save key":"Сохран.", "+ CREATE A NEW ACCOUNT":"+ СОЗДАТЬ НОВЫЙ СЧЕТ", "Create account":"Создать счет", "Send":"Отправить", "Save key":"Сохран.", "+ CREATE A NEW ACCOUNT":"+ СОЗДАТЬ НОВЫЙ СЧЕТ", "Create account":"Создать счет", "Send":"Отправить",
"CONFIRM":"Подтверждение", "Accounts":"Счета", "Account(s)":"Счет(а,ов)", "Blocks and Tx":"Блоки и Транзакции", "Counters":"Показатели", "CONFIRM":"Подтвердить", "Accounts":"Счета", "Account(s)":"Счет(а,ов)", "Blocks and Tx":"Блоки и Транзакции", "Counters":"Показатели",
"Open DApp":"Открыть Дапп", "Back":"Назад", "Delete":"Удалить", "Save to book":"Сохранить в книгу", "Choose":"Выбрать", "RECONNECT":"КОННЕКТ", "Open DApp":"Открыть", "Back":"Назад", "Delete":"Удалить", "Save to book":"Сохранить в книгу", "Choose":"Выбрать", "RECONNECT":"КОННЕКТ",
"DApps":"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":"Хеш блока", "Block Num":"Ном блока", "Num":"Ном", "Date":"Дата", "Data Hash":"Хеш данных", "PowHash":"Хеш сложности", "Block Hash":"Хеш блока",
"Bytes":"Байт", "Pow":"Сложн", "Miner":"Майнер", "(secret)":"(секрет)", "Show":"Показать", "TERA":"TERA", "Blockchain height:":"Высота блокчейна:", "Bytes":"Байт", "Pow":"Сложн", "Miner":"Майнер", "(secret)":"(секрет)", "Show":"Показать", "TERA":"TERA", "Blockchain height:":"Высота блокчейна:",
"Current create:":"Текущий блок:", "Protocol ver:":"Версия протокола:", "ID: $Item.Num":"ИД: $Item.Num", "Token generate":"Генерация токенов", "Current create:":"Текущий блок:", "Protocol ver:":"Версия протокола:", "ID: $Item.Num":"ИД: $Item.Num", "Token generate":"Генерация токенов",
"ACCOUNTS":"СЧЕТА", "SEND":"ОТПРАВИТЬ", "DAPPS":"ДАППС", "EXPLORER":"ПРОСМ", "ATTENTION: Before using the wallet, save the private key.":"ВНИМАНИЕ: Перед использованием кошелька сохраните приватный ключ", "ACCOUNTS":"СЧЕТА", "SEND":"ОТПРАВИТЬ", "DAPPS":"ДАППС", "EXPLORER":"ПРОСМ", "ATTENTION: Before using the wallet, save the private key.":"ВНИМАНИЕ: Перед использованием кошелька сохраните приватный ключ",
"Web-site":"Веб-сайт", "Bitcointalk":"Bitcointalk", "Twitter":"Твиттер", "Telegram":"Телеграм", "Discord":"Дискорд", "QQchat":"QQchat", "Web-site":"Веб-сайт", "Bitcointalk":"Bitcointalk", "Twitter":"Твиттер", "Telegram":"Телеграм", "Discord":"Дискорд", "QQchat":"QQchat",
"Buy/sell/mine TERA":"Купить/Продать", "+ CREATE NEW":"+ СОЗДАТЬ", "Confirm Transaction":"Подтверждение транзакции", "CREATE DAPPS":"СОЗДАТЬ", "Buy/sell/mine TERA":"Купить/продать/майнить", "+ CREATE NEW":"+ СОЗДАТЬ", "Confirm Transaction":"Подтверждение транзакции",
"Set pass":"Установить пароль", "Unlock":"Разблокировать", "Entrance to sub-wallet":"Войти в под-кошелек", "Public name":"Публичное имя", "CREATE DAPPS":"СОЗДАТЬ", "Set pass":"Установить пароль", "Unlock":"Разблокировать", "Entrance to sub-wallet":"Войти в под-кошелек",
"Currency":"Валюта", "Pay to:":"Получатель:", "Amount:":"Сумма:", "Description:":"Описание:", "Welcome to TERA Wallet":"Добро пожаловать в кошелек TERA", "Public name":"Публичное имя", "Currency":"Валюта", "Pay to:":"Получатель:", "Amount:":"Сумма:", "Description:":"Описание:",
"Edit your wallet":"Редактирование вашего кошелька", "Key settings":"Задание ключей", "KEY SETTINGS":"КЛЮЧИ", "Create an account":"Создание счета", "Welcome to TERA Wallet":"Добро пожаловать в кошелек TERA", "Edit your wallet":"Редактирование вашего кошелька", "Key settings":"Задание ключей",
"Sending coins":"Отправка монет", "Decentralized applications (dApps)":"Децентрализованные приложения (DApps)", "Secure your wallet":"Безопасность вашего кошелька", "KEY SETTINGS":"КЛЮЧИ", "Create an account":"Создание счета", "Sending coins":"Отправка монет", "Decentralized applications (dApps)":"Децентрализованные приложения (DApps)",
"Wallet is secured":"Установлен пароль", "Total":"Всего", "Item.Name":"Item.Name", "You have no accounts yet":"У вас нет ни одного счета", "Secure your wallet":"Безопасность вашего кошелька", "Wallet is secured":"Установлен пароль", "Total":"Всего", "Item.Name":"Item.Name",
"Wait 10-15 sec":"Ждите 10-15 сек", "Creating your account":"Идет создание вашего счета", "From:":"Отправитель:", "Set a password for protect entry":"Установите пароль для безопасности", "You have no accounts yet":"У вас нет ни одного счета", "Wait 10-15 sec":"Ждите 10-15 сек", "Creating your account":"Идет создание вашего счета",
"Enter password to unlock wallet":"Введите пароль для разблокировки кошелька", "From ID:":"Отправитель:", "Pay to ID:":"Получатель:", "From:":"Отправитель:", "Set a password for protect entry":"Установите пароль для безопасности", "Enter password to unlock wallet":"Введите пароль для разблокировки кошелька",
"Account":"Счет", "Owner":"Владелец", "Block num":"Ном блока", "Private key (secret)":"Приватный ключ (секретно)", "Load key":"Загруз.", "From ID:":"Отправитель:", "Pay to ID:":"Получатель:", "Account":"Счет", "Owner":"Владелец", "Block num":"Ном блока", "Private key (secret)":"Приватный ключ (секретно)",
"Create your first account and start using TERA":"Создайте свой первый счет и начните использовать TERA", "0 Accounts":"0 Счетов", "Load key":"Загруз.", "Create your first account and start using TERA":"Создайте свой первый счет и начните использовать TERA",
"OWNER: {Item.Owner}":"Владелец: {Item.Owner}", "More info":"Информация", "Public key":"Публичный ключ", "Enter number of dapp":"Введите номер Даппа", "0 Accounts":"0 Счетов", "OWNER: {Item.Owner}":"Владелец: {Item.Owner}", "More info":"Инфо", "Public key":"Публичный ключ",
"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 number of dapp":"Введите номер 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.":"Введите номер Dapp, который будет добавлен в ваш аккаунт. Внимание убедитесь, что Вы доверяете ему, в противном случае вы можете потерять все средства на этом счете.",
"Sending Tx":"Отправка транзакции", }; "Sending Tx":"Отправка транзакции", "Wallet ver:":"Версия:", };
LangMap["简体中文"] = {"TERA WALLET":"TERA 钱包", "Generate key":"生成私钥", "OK":"OK", "Cancel":"取消", "Edit":"编辑", "Save key":"保存私钥", LangMap["简体中文"] = {"TERA WALLET":"TERA 钱包", "Generate key":"生成私钥", "OK":"OK", "Cancel":"取消", "Edit":"编辑", "Save key":"保存私钥",
"+ CREATE A NEW ACCOUNT":"+ 新建账号", "Create account":"创建账号", "Send":"发送", "SEND":"转账", "CONFIRM":"确认", "Accounts":"账号", "Account(s)":"账号", "+ 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":"选择", "Blocks and Tx":"区块和交易", "Counters":"状态统计", "Open DApp":"打开DApp", "Back":"返回", "Delete":"删除", "Save to book":"保存到地址本", "Choose":"选择",

View File

@ -510,11 +510,11 @@
<div class="modal__title-wrap"> <div class="modal__title-wrap">
<span class="light-grey-text">ID: $Item.Num</span> <span class="light-grey-text">ID: $Item.Num</span>
<h3>$Item.Name</h3> <h3>$Item.Name</h3>
<ol class="modal__ol"> <ul class="modal__ol">
<li class="modal__category dappcategory1">$Item.Category1</li> <li class="modal__category dappcategory1">$Item.Category1</li>
<li class="modal__category dappcategory2">$Item.Category2</li> <li class="modal__category dappcategory2">$Item.Category2</li>
<li class="modal__category dappcategory3">$Item.Category3</li> <li class="modal__category dappcategory3">$Item.Category3</li>
</ol> </ul>
<p class="dapp-modal__token-status dapp-modal__token-status--ok"> <p class="dapp-modal__token-status dapp-modal__token-status--ok">
<!--<span class="light-grey-text">Without token generate</span>--> <!--<span class="light-grey-text">Without token generate</span>-->
<span class="dapp-modal__ok-token">Token generate</span> <span class="dapp-modal__ok-token">Token generate</span>
@ -524,7 +524,7 @@
<img $item.iconpath alt="dApp logo" width="32"> <img $item.iconpath alt="dApp logo" width="32">
</div> </div>
</div> </div>
<p>$Item.Description</p> <p class="dapp_desc">$Item.Description</p>
<dl class="modal__def-list def-list"> <dl class="modal__def-list def-list">
<div class="def-list__item"> <div class="def-list__item">
<dt>Account</dt> <dt>Account</dt>
@ -628,13 +628,14 @@
</section> </section>
<section class="modal dapp-modal" id="idSmartEnter" style="display: none; margin-top: 20px; padding: 20px"> <section class="modal dapp-modal" id="idSmartEnter" style="display: none; margin-top: -10px; padding: 20px">
<h2 class="password-modal__title"><span>Enter number of dapp</span></h2> <h2 class="password-modal__title"><span>Enter number of dapp</span></h2>
<p class="password-modal__subtitle">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.</p> <p class="password-modal__subtitle">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.</p>
<DIV align='center'>
<input type="number" class="password-modal__input" placeholder="Dapp number" id="idSmartNum"> <input type="number" class="password-modal__input" placeholder="" id="idSmartNum">
<a class="btn btn--270 btn--float" onclick="DoSetSmartLocal()">OK</a> <a class="btn btn--270 btn--setdapp" onclick="DoSetSmartLocal()">OK</a>
<a class="btn btn--270 btn--float btn--white" onclick="closeModal()">Cancel</a> <a class="btn btn--270 btn--setdapp btn--white" onclick="closeModal()">Cancel</a>
</DIV>
</section> </section>

View File

@ -8,7 +8,7 @@
* Telegram: https://t.me/terafoundation * Telegram: https://t.me/terafoundation
*/ */
global.UPDATE_CODE_VERSION_NUM = 1167; global.UPDATE_CODE_VERSION_NUM = 1171;
global.MIN_CODE_VERSION_NUM = 1114; global.MIN_CODE_VERSION_NUM = 1114;
global.MINING_VERSION_NUM = 0; global.MINING_VERSION_NUM = 0;
global.InitParamsArg = InitParamsArg; global.InitParamsArg = InitParamsArg;
@ -17,9 +17,9 @@ global.CONST_NAME_ARR = ["AUTO_CORRECT_TIME", "DELTA_CURRENT_TIME", "COMMON_KEY"
"WALLET_NAME", "WALLET_DESCRIPTION", "USE_API_WALLET", "USE_API_V1", "USE_HARD_API_V2", "COUNT_VIEW_ROWS", "USE_HINT", "ALL_VIEW_ROWS", "WALLET_NAME", "WALLET_DESCRIPTION", "USE_API_WALLET", "USE_API_V1", "USE_HARD_API_V2", "COUNT_VIEW_ROWS", "USE_HINT", "ALL_VIEW_ROWS",
"ALL_LOG_TO_CLIENT", "LOG_LEVEL", "USE_MINING", "MINING_START_TIME", "MINING_PERIOD_TIME", "POW_MAX_PERCENT", "COUNT_MINING_CPU", "ALL_LOG_TO_CLIENT", "LOG_LEVEL", "USE_MINING", "MINING_START_TIME", "MINING_PERIOD_TIME", "POW_MAX_PERCENT", "COUNT_MINING_CPU",
"SIZE_MINING_MEMORY", "POW_RUN_COUNT", "USE_AUTO_UPDATE", "RESTART_PERIOD_SEC", "MAX_GRAY_CONNECTIONS_TO_SERVER", "TRANSACTION_PROOF_COUNT", "SIZE_MINING_MEMORY", "POW_RUN_COUNT", "USE_AUTO_UPDATE", "RESTART_PERIOD_SEC", "MAX_GRAY_CONNECTIONS_TO_SERVER", "TRANSACTION_PROOF_COUNT",
"UPDATE_NUM_COMPLETE", "LIMIT_SEND_TRAFIC", "WATCHDOG_DEV", "ADDRLIST_MODE", "CheckPointDelta", "MIN_VER_STAT", "DEBUG_WALLET", "LIMIT_SEND_TRAFIC", "WATCHDOG_DEV", "ADDRLIST_MODE", "CheckPointDelta", "MIN_VER_STAT", "DEBUG_WALLET", "HTTP_HOSTING_PORT",
"HTTP_HOSTING_PORT", "HTTPS_HOSTING_DOMAIN", "HTTP_MAX_COUNT_ROWS", "HTTP_ADMIN_PASSWORD", "HTTP_START_PAGE", "WATCHDOG_BADACCOUNT", "HTTPS_HOSTING_DOMAIN", "HTTP_MAX_COUNT_ROWS", "HTTP_ADMIN_PASSWORD", "HTTP_START_PAGE", "WATCHDOG_BADACCOUNT", "RESYNC_CONDITION",
"RESYNC_CONDITION", "MAX_CONNECTIONS_COUNT", "TRUST_PROCESS_COUNT", "REST_START_COUNT", "LOAD_TO_BEGIN", ]; "MAX_CONNECTIONS_COUNT", "TRUST_PROCESS_COUNT", "REST_START_COUNT", "LOAD_TO_BEGIN", ];
global.MAX_LENGTH_SENDER_MAP = 3000; global.MAX_LENGTH_SENDER_MAP = 3000;
global.DELTA_START_SENDER_MAP = 24; global.DELTA_START_SENDER_MAP = 24;
global.NODES_DELTA_CALC_HOUR = 4; global.NODES_DELTA_CALC_HOUR = 4;
@ -35,7 +35,7 @@ global.WATCHDOG_BADACCOUNT = 1;
global.WATCHDOG_DEV = 0; global.WATCHDOG_DEV = 0;
global.RESYNC_CONDITION = {"OWN_BLOCKS":20, "K_POW":5}; global.RESYNC_CONDITION = {"OWN_BLOCKS":20, "K_POW":5};
global.REST_BLOCK_SCALE = 1000; global.REST_BLOCK_SCALE = 1000;
global.REST_START_COUNT = 1000; global.REST_START_COUNT = 10000;
global.LOAD_TO_BEGIN = 2; global.LOAD_TO_BEGIN = 2;
global.DEBUG_WALLET = 0; global.DEBUG_WALLET = 0;
global.CHECK_GLOBAL_TIME = 1; global.CHECK_GLOBAL_TIME = 1;
@ -48,7 +48,6 @@ global.USE_NET_FOR_SERVER_ADDRES = 1;
global.NET_WORK_MODE = undefined; global.NET_WORK_MODE = undefined;
global.STAT_MODE = 0; global.STAT_MODE = 0;
global.MAX_STAT_PERIOD = 1 * 3600; global.MAX_STAT_PERIOD = 1 * 3600;
global.UPDATE_NUM_COMPLETE = 0;
global.WALLET_NAME = "TERA"; global.WALLET_NAME = "TERA";
global.WALLET_DESCRIPTION = ""; global.WALLET_DESCRIPTION = "";
global.USE_MINING = 0; global.USE_MINING = 0;

View File

@ -29,13 +29,12 @@ ContenTypeMap["html"] = "text/html";
ContenTypeMap["txt"] = "text/plain"; ContenTypeMap["txt"] = "text/plain";
ContenTypeMap["csv"] = "text/csv"; ContenTypeMap["csv"] = "text/csv";
ContenTypeMap["svg"] = "image/svg+xml"; ContenTypeMap["svg"] = "image/svg+xml";
ContenTypeMap[""] = "application/octet-stream";
ContenTypeMap["zip"] = "application/zip"; ContenTypeMap["zip"] = "application/zip";
ContenTypeMap["pdf"] = "application/pdf"; ContenTypeMap["pdf"] = "application/pdf";
ContenTypeMap["exe"] = "application/octet-stream"; ContenTypeMap["exe"] = "application/octet-stream";
ContenTypeMap["msi"] = "application/octet-stream"; ContenTypeMap["msi"] = "application/octet-stream";
ContenTypeMap["woff"] = "application/font-woff"; ContenTypeMap["woff"] = "application/font-woff";
ContenTypeMap["html"] = "text/html"; var DefaultContentType = "application/octet-stream";
ContenTypeMap["psd"] = "application/octet-stream"; ContenTypeMap["psd"] = "application/octet-stream";
global.HTTPCaller = {}; global.HTTPCaller = {};
@ -1453,8 +1452,8 @@ var MapFileHTML5 = {};
function SendWebFile(response,name,StrCookie,bParsing) function SendWebFile(response,name,StrCookie,bParsing)
{ {
var type = name.substr(name.length - 4, 4); var type = name.substr(name.length - 4, 4);
if(type.substr(0, 1) === ".") var index1 = type.indexOf(".");
type = type.substr(1); type = type.substr(index1 + 1);
var Path; var Path;
if(name.substr(0, 2) !== "./") if(name.substr(0, 2) !== "./")
Path = "./" + name; Path = "./" + name;
@ -1473,7 +1472,9 @@ function SendWebFile(response,name,StrCookie,bParsing)
return ; return ;
} }
var StrContentType = ContenTypeMap[type]; var StrContentType = ContenTypeMap[type];
if(!StrContentType || StrContentType === "text/html") if(!StrContentType)
StrContentType = DefaultContentType;
if(StrContentType === "text/html")
{ {
var Headers = {'Content-Type':'text/html', "X-Frame-Options":"sameorigin"}; var Headers = {'Content-Type':'text/html', "X-Frame-Options":"sameorigin"};
if(StrCookie) if(StrCookie)
@ -1700,7 +1701,7 @@ function SetSafeResponce(response)
{ {
try try
{ {
if(arguments && arguments[0] && arguments[0].length) if(global.STAT_MODE === 2 && arguments && arguments[0] && arguments[0].length)
{ {
ADD_TO_STAT("HTTP_SEND", arguments[0].length); ADD_TO_STAT("HTTP_SEND", arguments[0].length);
if(response.DetailStatName) if(response.DetailStatName)

View File

@ -151,9 +151,11 @@ function MainHTTPFunction(request,response)
var Params = querystring.parse(DataURL.query); var Params = querystring.parse(DataURL.query);
var Path = querystring.unescape(DataURL.pathname); var Path = querystring.unescape(DataURL.pathname);
ToLogWeb("Get Path:" + Path); ToLogWeb("Get Path:" + Path);
ADD_TO_STAT("HTTP_ALL");
if(global.STAT_MODE === 2) if(global.STAT_MODE === 2)
{
ADD_TO_STAT("HTTP_ALL");
response.DetailStatName = ":" + Path; response.DetailStatName = ":" + Path;
}
var Type = request.method; var Type = request.method;
if(Type === "POST") if(Type === "POST")
{ {
@ -186,12 +188,12 @@ function MainHTTPFunction(request,response)
Response.end("Error data parsing"); Response.end("Error data parsing");
} }
} }
DoCommandNew(response, Type, Path, Data); DoCommandNew(request, response, Type, Path, Data);
}); });
} }
else else
{ {
DoCommandNew(response, Type, Path, Params); DoCommandNew(request, response, Type, Path, Params);
} }
}; };
var bWasRun = 0; var bWasRun = 0;
@ -284,20 +286,19 @@ WalletFileMap["glass.svg"] = 1;
WalletFileMap["dapp-edit.html"] = 1; WalletFileMap["dapp-edit.html"] = 1;
WalletFileMap["TeraLogo.svg"] = 1; WalletFileMap["TeraLogo.svg"] = 1;
WalletFileMap["mobile-wallet.html"] = "web-wallet.html"; 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.WebApi2 = {};
global.HostingCaller = {}; global.HostingCaller = {};
function DoCommandNew(response,Type,Path,Params) function DoCommandNew(request,response,Type,Path,Params)
{ {
if(Path.substring(0, 1) === "/") if(Path.substring(0, 1) === "/")
Path = Path.substring(1); Path = Path.substring(1);
var ArrPath = Path.split('/', 5); var ArrPath = Path.split('/', 5);
if(global.AddonCommand)
{
if(!global.AddonCommand(request, response, Type, Path, Params, ArrPath))
return ;
}
var Caller = HostingCaller; var Caller = HostingCaller;
var Method = ArrPath[0]; var Method = ArrPath[0];
var APIv2 = 0; var APIv2 = 0;
@ -316,9 +317,11 @@ function DoCommandNew(response,Type,Path,Params)
} }
Method = ArrPath[2]; Method = ArrPath[2];
} }
ADD_TO_STAT("HTTP:" + Method);
if(global.STAT_MODE === 2) if(global.STAT_MODE === 2)
{
ADD_TO_STAT("HTTP:" + Method);
response.DetailStatName = ":" + Method; response.DetailStatName = ":" + Method;
}
var F = Caller[Method]; var F = Caller[Method];
if(F) if(F)
{ {
@ -359,17 +362,6 @@ function DoCommandNew(response,Type,Path,Params)
Method = Method.toLowerCase(); Method = Method.toLowerCase();
if(Method === "dapp" && ArrPath.length === 2) if(Method === "dapp" && ArrPath.length === 2)
Method = "DappTemplateFile"; Method = "DappTemplateFile";
if(HTTPS_HOSTING_DOMAIN === "terafoundation.org")
{
var DomenName = MapRedirect[Method];
if(DomenName)
{
if(Path.substr(0, 1) !== "/")
Path = "/" + Path;
response.writeHead(301, {"Location":'http://' + DomenName + Path});
return response.end();
}
}
switch(Method) switch(Method)
{ {
case "index.html": case "index.html":
@ -841,8 +833,6 @@ HostingCaller.GetHistoryTransactions = function (Params)
}; };
HostingCaller.GetSupply = function (Params) HostingCaller.GetSupply = function (Params)
{ {
if(HTTPS_HOSTING_DOMAIN === "terafoundation.org")
return "" + (1000000000 - 420000000);
var Data = DApps.Accounts.ReadState(0); var Data = DApps.Accounts.ReadState(0);
if(!Data) if(!Data)
return ""; return "";

View File

@ -293,7 +293,6 @@ class AccountApp extends require("./dapp")
var MaxNum = this.DBAct.GetMaxNum(); var MaxNum = this.DBAct.GetMaxNum();
if(MaxNum >= TRANSACTION_PROOF_COUNT * 2) if(MaxNum >= TRANSACTION_PROOF_COUNT * 2)
{ {
ToLog("Rename act files")
this.DBActPrev.CloseDBFile(this.DBActPrev.FileName) this.DBActPrev.CloseDBFile(this.DBActPrev.FileName)
this.DBAct.CloseDBFile(this.DBAct.FileName) this.DBAct.CloseDBFile(this.DBAct.FileName)
if(fs.existsSync(this.DBActPrev.FileNameFull)) if(fs.existsSync(this.DBActPrev.FileNameFull))