tranche tweaks
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
</template>
|
||||
<template v-slot:expanded-row="{item}">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="100">
|
||||
<v-table>
|
||||
<!--
|
||||
@@ -50,8 +51,8 @@
|
||||
-->
|
||||
<tbody>
|
||||
<tr v-for="(t, i) in item.order.tranches">
|
||||
<td>Tranche {{ i + 1 }}</td>
|
||||
<td>
|
||||
<td class="text-right">Tranche {{ i + 1 }}</td>
|
||||
<td class="text-center w-33">
|
||||
<suspense>
|
||||
<span>
|
||||
<token-amount :addr="item.amountToken" :amount="item.trancheFilled[i]" :raw="true"/>
|
||||
@@ -60,10 +61,11 @@
|
||||
</span>
|
||||
</suspense>
|
||||
</td>
|
||||
<td>
|
||||
{{describeTrancheTime(item,t)}}
|
||||
{{describeTrancheLine(item,true,t.minIntercept,t.minSlope)}}
|
||||
{{describeTrancheLine(item,false,t.maxIntercept,t.maxSlope)}}
|
||||
<td class="text-left">
|
||||
<span class="mx-3">{{ describeTrancheTime(item, true, t) }}</span>
|
||||
<span class="mx-3">{{ describeTrancheTime(item, false, t) }}</span>
|
||||
<span class="mx-3">{{ describeTrancheLine(item, true, t.minIntercept, t.minSlope) }}</span>
|
||||
<span class="mx-3">{{ describeTrancheLine(item, false, t.maxIntercept, t.maxSlope) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -225,22 +227,20 @@ const orders = computed(()=>{
|
||||
return result
|
||||
})
|
||||
|
||||
function describeTrancheTime(st, t) {
|
||||
function describeTrancheTime(st, isStart, t) {
|
||||
let result = ''
|
||||
if( t.minIsBarrier || t.maxIsBarrier )
|
||||
return 'barrier'
|
||||
if( t.startTime > 0 ) {
|
||||
if( isStart && t.startTime > 0 ) {
|
||||
const started = t.startTimeIsRelative ? st.start + t.startTime : t.startTime
|
||||
console.log('started', started, st.start, t.startTime)
|
||||
result += started*1000 < Date.now() ? 'Activated ' : 'Activates '
|
||||
result += dateString(started) + ' '
|
||||
}
|
||||
if( t.endTime < 4294967295 ) {
|
||||
if( !isStart && t.endTime < 4294967295 ) {
|
||||
const ended = t.endTimeIsRelative ? st.start + t.endTime : t.endTime
|
||||
result += ended*1000 < Date.now() ? 'Expired ' : 'Expires '
|
||||
result += dateString(ended)
|
||||
}
|
||||
console.log('tt', st, t)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user