|
|
@ -69,6 +69,15 @@ var css = csjs` |
|
|
|
margin-top: 2%; |
|
|
|
margin-top: 2%; |
|
|
|
border: none; |
|
|
|
border: none; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.pendingTxsContainer { |
|
|
|
|
|
|
|
${styles.displayBox} |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
background-color: ${styles.colors.transparent}; |
|
|
|
|
|
|
|
margin-top: 2%; |
|
|
|
|
|
|
|
border: none; |
|
|
|
|
|
|
|
padding-bottom: 0; |
|
|
|
|
|
|
|
} |
|
|
|
.container { |
|
|
|
.container { |
|
|
|
${styles.displayBox} |
|
|
|
${styles.displayBox} |
|
|
|
margin-top: 2%; |
|
|
|
margin-top: 2%; |
|
|
@ -76,6 +85,11 @@ var css = csjs` |
|
|
|
.contractNames { |
|
|
|
.contractNames { |
|
|
|
${styles.dropdown} |
|
|
|
${styles.dropdown} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.subcontainer { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
flex-direction: row; |
|
|
|
|
|
|
|
align-items: baseline; |
|
|
|
|
|
|
|
} |
|
|
|
.buttons { |
|
|
|
.buttons { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
@ -115,11 +129,11 @@ var css = csjs` |
|
|
|
color: ${styles.colors.lightGrey}; |
|
|
|
color: ${styles.colors.lightGrey}; |
|
|
|
font-style: italic; |
|
|
|
font-style: italic; |
|
|
|
} |
|
|
|
} |
|
|
|
.legend { |
|
|
|
.pendingTxsText { |
|
|
|
float: right; |
|
|
|
${styles.displayBox} |
|
|
|
display: flex; |
|
|
|
text-align: center; |
|
|
|
word-break: normal; |
|
|
|
color: ${styles.colors.lightGrey}; |
|
|
|
margin-left: auto; |
|
|
|
font-style: italic; |
|
|
|
} |
|
|
|
} |
|
|
|
.item { |
|
|
|
.item { |
|
|
|
margin-right: 1em; |
|
|
|
margin-right: 1em; |
|
|
@ -138,13 +152,21 @@ var css = csjs` |
|
|
|
color: ${styles.colors.lightBlue}; |
|
|
|
color: ${styles.colors.lightBlue}; |
|
|
|
margin-right: .3em; |
|
|
|
margin-right: .3em; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.pendingContainer { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
align-items: baseline; |
|
|
|
|
|
|
|
} |
|
|
|
.pending { |
|
|
|
.pending { |
|
|
|
background-color: ${styles.colors.lightRed}; |
|
|
|
|
|
|
|
width: 75px; |
|
|
|
|
|
|
|
height: 25px; |
|
|
|
height: 25px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
padding-left: 10px; |
|
|
|
padding-left: 10px; |
|
|
|
border-radius: 3px; |
|
|
|
border-radius: 3px; |
|
|
|
|
|
|
|
margin-left: 5px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.icon { |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
color: ${styles.colors.orange}; |
|
|
|
|
|
|
|
margin-left: 10%; |
|
|
|
} |
|
|
|
} |
|
|
|
` |
|
|
|
` |
|
|
|
console.log(styles.displayBox.toString()) |
|
|
|
console.log(styles.displayBox.toString()) |
|
|
@ -155,16 +177,26 @@ module.exports = runTab |
|
|
|
var instanceContainer = yo`<div class="${css.instanceContainer}"></div>` |
|
|
|
var instanceContainer = yo`<div class="${css.instanceContainer}"></div>` |
|
|
|
var noInstancesText = yo`<div class="${css.noInstancesText}">No Contract Instances.</div>` |
|
|
|
var noInstancesText = yo`<div class="${css.noInstancesText}">No Contract Instances.</div>` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var pendingTxsText = yo`<div class="${css.pendingTxsText}"></div>` |
|
|
|
|
|
|
|
var pendingTxsContainer = yo`<div class="${css.pendingTxsContainer}">${pendingTxsText}</div>` |
|
|
|
|
|
|
|
|
|
|
|
function runTab (container, appAPI, appEvents, opts) { |
|
|
|
function runTab (container, appAPI, appEvents, opts) { |
|
|
|
var el = yo` |
|
|
|
var el = yo` |
|
|
|
<div class="${css.runTabView}" id="runTabView"> |
|
|
|
<div class="${css.runTabView}" id="runTabView"> |
|
|
|
${settings(appAPI, appEvents)} |
|
|
|
${settings(appAPI, appEvents)} |
|
|
|
${contractDropdown(appAPI, appEvents, instanceContainer)} |
|
|
|
${contractDropdown(appAPI, appEvents, instanceContainer)} |
|
|
|
|
|
|
|
${pendingTxsContainer} |
|
|
|
${instanceContainer} |
|
|
|
${instanceContainer} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
` |
|
|
|
` |
|
|
|
container.appendChild(el) |
|
|
|
container.appendChild(el) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PENDING transactions
|
|
|
|
|
|
|
|
function updatePendingTxs (container, appAPI) { |
|
|
|
|
|
|
|
var pendingCount = Object.keys(appAPI.udapp().pendingTransactions()).length |
|
|
|
|
|
|
|
pendingTxsText.innerText = pendingCount + ' pending transactions' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DROPDOWN
|
|
|
|
// DROPDOWN
|
|
|
|
var selectExEnv = el.querySelector('#selectExEnvOptions') |
|
|
|
var selectExEnv = el.querySelector('#selectExEnvOptions') |
|
|
|
selectExEnv.addEventListener('change', function (event) { |
|
|
|
selectExEnv.addEventListener('change', function (event) { |
|
|
@ -211,10 +243,6 @@ function updateAccountBalances (container, appAPI) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function updatePendingTxs (container, appAPI) { |
|
|
|
|
|
|
|
container.querySelector('#pendingtxs').innerText = Object.keys(appAPI.udapp().pendingTransactions()).length + ' pending' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ------------------------------------------------ |
|
|
|
/* ------------------------------------------------ |
|
|
|
section CONTRACT DROPDOWN and BUTTONS |
|
|
|
section CONTRACT DROPDOWN and BUTTONS |
|
|
|
------------------------------------------------ */ |
|
|
|
------------------------------------------------ */ |
|
|
@ -231,7 +259,9 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { |
|
|
|
var selectContractNames = yo`<select class="${css.contractNames}" disabled></select>` |
|
|
|
var selectContractNames = yo`<select class="${css.contractNames}" disabled></select>` |
|
|
|
var el = yo` |
|
|
|
var el = yo` |
|
|
|
<div class="${css.container}"> |
|
|
|
<div class="${css.container}"> |
|
|
|
${selectContractNames} ${legend()} |
|
|
|
<div class="${css.subcontainer}"> |
|
|
|
|
|
|
|
${selectContractNames} |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="${css.buttons}"> |
|
|
|
<div class="${css.buttons}"> |
|
|
|
<div class="${css.button}"> |
|
|
|
<div class="${css.button}"> |
|
|
|
<div class="${css.atAddress}" onclick=${function () { loadFromAddress(appAPI) }}>At Address</div> |
|
|
|
<div class="${css.atAddress}" onclick=${function () { loadFromAddress(appAPI) }}>At Address</div> |
|
|
@ -397,19 +427,3 @@ function settings (appAPI, appEvents) { |
|
|
|
|
|
|
|
|
|
|
|
return el |
|
|
|
return el |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* ------------------------------------------------ |
|
|
|
|
|
|
|
section LEGEND |
|
|
|
|
|
|
|
------------------------------------------------ */ |
|
|
|
|
|
|
|
function legend () { |
|
|
|
|
|
|
|
var el = |
|
|
|
|
|
|
|
yo` |
|
|
|
|
|
|
|
<div class="${css.legend}"> |
|
|
|
|
|
|
|
<div class="${css.item}"><i class="fa fa-circle ${css.call}" aria-hidden="true"></i>Call</div> |
|
|
|
|
|
|
|
<div class="${css.item}"><i class="fa fa-circle ${css.transact}" aria-hidden="true"></i>Transact</div> |
|
|
|
|
|
|
|
<div class="${css.item}"><i class="fa fa-circle ${css.payable}" aria-hidden="true"></i>Transact(Payable)</div> |
|
|
|
|
|
|
|
<div class="${css.item} ${css.pending}" id="pendingtxs"></div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
return el |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|