This commit is contained in:
tim
2025-01-16 20:17:03 -04:00
parent 19a8ffbbd4
commit 0545cd6e97
51 changed files with 482 additions and 436 deletions

View File

@@ -18,12 +18,16 @@ let timer = null
const bypass = useRoute().query.approval
function tryApproval() {
console.log('approval query', bypass)
console.log('trying region approval')
if (timer!==null) {
clearTimeout(timer)
timer = null
}
if (s.regionApproved===null) {
if (s.regionApproved===true) {
console.log('region approved')
}
else if (s.regionApproved===null) {
console.log('asking for region approval', bypass)
socket.emit('approveRegion', bypass)
timer = setTimeout(tryApproval, 1000)
}

View File

@@ -1,10 +0,0 @@
<template>
</template>
<script setup>
</script>
<style scoped lang="scss">
</style>

View File

@@ -32,7 +32,8 @@ import {applyLinePoints, linePointsValue, useChartOrderStore} from "@/orderbuild
import {newTranche} from "@/blockchain/orderlib.js";
import TimeEntry from "@/components/TimeEntry.vue";
import RoutePrice from "@/components/RoutePrice.vue";
import {timestamp} from "@/misc.js";
import {timestamp} from "@/common.js";
const s = useStore()
const os = useOrderStore()

View File

@@ -1,15 +1,16 @@
<template>
<span class="d-inline-flex align-center">
<v-icon icon="mdi-arrow-up-bold" color="primary" class="arrow"/>
<span class="logo">dexorder</span>
<beta v-if="showTag"/>
</span>
<div class="d-inline-flex">
<v-img :src="`/media/dexorder_vectors/dexorder_full_${s.theme}mode.svg`" width="6em" inline/>
<beta/>
</div>
</template>
<script setup>
import Beta from "@/components/Beta.vue";
import {useStore} from "@/store/store.js";
const s = useStore()
const props = defineProps({
showTag: {type: Boolean, default: false}
})

View File

@@ -41,10 +41,10 @@ watchEffect(pulse)
@keyframes pulse {
0% {
background-color: gray;
background-color: #888;
}
100% {
background-color: white;
background-color: inherit;
}
}
</style>
</style>

View File

@@ -1,8 +1,8 @@
<template>
<div>
<!-- <v-btn variant="plain" icon="mdi-linkedin" @click="open('https://www.linkedin.com/company/dexorder','dexorder_linkedin')" :size="size"/>-->
<v-btn variant="plain" icon="mdi-discord" @click="open('https://discord.gg/fqp9JXXQyt','dexorder_discord')" :size="size"/>
<v-btn variant="plain" icon="mdi-twitter" @click="open('https://twitter.com/Dexorder_trade','dexorder_twitter')" :size="size"/>
<v-btn variant="plain" icon="mdi-discord" @click="open('https://discord.gg/fqp9JXXQyt','dexorder_discord')" :size="size"/>
<v-btn variant="plain" icon="mdi-github" @click="open('https://github.com/dexorder-trade/contract','dexorder_github')" :size="size"/>
<!-- <v-btn variant="plain" icon="mdi-facebook" @click="open('https://facebook.com','dexorder_facebook')" :size="size"/>-->
<!-- <v-btn variant="plain" icon="mdi-reddit" @click="open('https://reddit.com','dexorder_reddit')" :size="size"/>-->

View File

@@ -5,7 +5,7 @@
<div class="top">
<slot name="top"/>
</div>
<div class="resizer bg-grey-lighten-2" :data-direction="horizontal?'horizontal':'vertical'" ref="resizerElement"></div>
<div class="resizer" :data-direction="horizontal?'horizontal':'vertical'" ref="resizerElement"></div>
<div class="scrollpane">
<slot name="bottom"/>
</div>
@@ -119,14 +119,16 @@ body {
width: 100%;
}
// todo light/dark mode
.resizer[data-direction='horizontal'] {
background-color: #cbd5e0;
background-color: #444;
cursor: ew-resize;
height: 100%;
width: 2px;
}
.resizer[data-direction='vertical'] {
background-color: #444;
cursor: ns-resize;
height: 4px;
width: 100%;
@@ -143,5 +145,6 @@ body {
width: 100%;
min-height: 5em;
max-height: 100%;
overflow-y: hidden;
}
</style>

View File

@@ -106,7 +106,7 @@
<div v-if="s.clock < item.trancheStatus[i].startTime">
Activates {{ timestampString(item.trancheStatus[i].startTime) }}
</div>
<div v-if="item.trancheStatus[i].endTime<DISTANT_FUTURE">
<div v-if="s.clock < item.trancheStatus[i].endTime && item.trancheStatus[i].endTime < DISTANT_FUTURE">
Expires {{ timestampString(item.trancheStatus[i].endTime) }}
</div>
</div>
@@ -242,7 +242,7 @@ onUnmounted(()=>{
})
const datatableHeaders = [
{title: 'Date', align: 'start', key: 'start'},
{title: 'Date', align: 'start', key: 'startTime'},
{title: 'Input', align: 'end', key: 'input'},
{title: 'Output', align: 'end', key: 'output'},
{title: 'Avg Price', align: 'end', key: 'avg'},
@@ -317,6 +317,8 @@ const orders = computed(()=>{
result.push(st)
st.id = `${vault}|${index}`
st.index = parseInt(index)
// st.startTime = timestampString(st.startTime)
console.log('starttime', st.startTime)
/*
o.tranches = o.tranches.map((tranche)=>{
const t = {...tranche}

View File

@@ -1,5 +1,8 @@
<template>
</template>
<!-- Crisp -->
<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="b153f30a-4b0b-49cc-8a38-989409a73acb";(function(){const d=document;const s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
<script setup>
if(window.location.hostname !== 'localhost') {
window.$crisp = [];window.CRISP_WEBSITE_ID = "b153f30a-4b0b-49cc-8a38-989409a73acb";(function () {const d = document;const s = d.createElement("script");s.src = "https://client.crisp.chat/l.js";s.async = 1;d.getElementsByTagName("head")[0].appendChild(s);})();
}
</script>

View File

@@ -658,7 +658,8 @@ at <a href="mailto:legal@dexorder.trade">legal@dexorder.trade</a> or <a href="ma
import {usePrefStore} from "@/store/store.js";
import {computed, ref, watch} from "vue";
import {timestamp} from "@/misc.js";
import {timestamp} from "@/common.js";
// INCREMENT THIS WHEN CHANGING THE TOS
const CURRENT_VERSION=1

View File

@@ -2,7 +2,7 @@
<template>
<row-bar :color="color">
<color-band :color="color"/>
<div :style="faintColorStyle" style="width: 100%" class="justify-start align-content-start">
<div style="width: 100%" class="justify-start align-content-start">
<v-text-field type="number" inputmode="numeric" pattern="[0-9]*\.?[0-9]*" v-model="order.amount" variant="outlined"
density="compact"
:hint="available" :persistent-hint="true"
@@ -157,12 +157,12 @@ onUnmounted(() => delete orderFuncs[lastId])
const theme = useTheme().current
const color = computed(()=>new Color(props.order.buy?theme.value.colors.success:theme.value.colors.error).darken(0.2).string())
const lightColor = computed(() => lightenColor(color.value))
const faintColor = computed(() => lightenColor2(color.value))
const colorStyle = computed(() => { return {'color': color.value} })
const bgColorStyle = computed(() => { return {'background-color': color.value} })
const lightColorStyle = computed(() => { return {'background-color': lightColor.value} })
const faintColorStyle = computed(() => { return {'background-color': faintColor.value} })
// const lightColor = computed(() => lightenColor(color.value))
// const faintColor = computed(() => lightenColor2(color.value))
// const colorStyle = computed(() => { return {'color': color.value} })
// const bgColorStyle = computed(() => { return {'background-color': color.value} })
// const lightColorStyle = computed(() => { return {'background-color': lightColor.value} })
// const faintColorStyle = computed(() => { return {'background-color': faintColor.value} })
const inToken = computed( ()=>props.order.buy ? co.quoteToken : co.baseToken )
const maxAmount = computed(()=>{

View File

@@ -9,20 +9,22 @@
<v-btn variant="text" prepend-icon="mdi-delete" v-if="co.orders.length>0"
:disabled="!orderChanged" @click="cancelOrder">Reset</v-btn>
</template>
<needs-chart>
<template v-for="o in co.orders">
<chart-order :order="o"/>
</template>
<v-dialog v-model="showResetDialog" max-width="300">
<v-card title="Cancel Order?" text="Do you want to cancel this order and start again?">
<v-card-actions>
<v-spacer/>
<v-btn @click="()=>showResetDialog=false">Keep Existing</v-btn>
<v-btn @click="()=>{co.resetOrders(); showResetDialog=false}" color="red" text="Reset Order"/>
</v-card-actions>
</v-card>
</v-dialog>
</needs-chart>
<div class="overflow-y-auto">
<needs-chart>
<template v-for="o in co.orders">
<chart-order :order="o"/>
</template>
<v-dialog v-model="showResetDialog" max-width="300">
<v-card title="Cancel Order?" text="Do you want to cancel this order and start again?">
<v-card-actions>
<v-spacer/>
<v-btn @click="()=>showResetDialog=false">Keep Existing</v-btn>
<v-btn @click="()=>{co.resetOrders(); showResetDialog=false}" color="red" text="Reset Order"/>
</v-card-actions>
</v-card>
</v-dialog>
</needs-chart>
</div>
</toolbar-pane>
</template>
@@ -63,7 +65,7 @@ const theme = useTheme().current
const orderColor = computed(()=>co.orders.length===0?null : co.orders[0].buy ? theme.value.colors.success:theme.value.colors.error)
const valid = computed(()=>{
if (!s.allowed)
if (!s.approved)
return false
if (co.drawing)
return false
@@ -127,7 +129,7 @@ async function placeOrder() {
</script>
<style lang="scss">
<style lang="scss"> // NOT scoped
body {
overflow-y: hidden;
}

View File

@@ -8,7 +8,7 @@ import {computed} from "vue";
const props = defineProps(['color'])
const computedStyle = computed(() => {
return {
'background-color': props.color,
// 'background-color': props.color,
'border-color': props.color,
'width': '.67em',
'border-top-width': '1px',

View File

@@ -202,7 +202,7 @@ function buildTranches() {
const t = newTranche({
fraction: ws[i] * MAX_FRACTION,
startTime: ts[i],
endTime: ets[i],
endTime: Math.max(ets[i],ts[i]+60), // always give at least 60 seconds of window to execute
slippage: builder.slippage,
})
tranches.push(t)

View File

@@ -1,6 +1,6 @@
<template>
<div class="d-flex mb-1 align-center w-100">
<logo class="d-flex align-end clickable logo-large" @click="nav('Order')" :show-tag="true"/>
<logo class="d-flex align-end clickable logo-large ml-1" @click="nav('Order')" :show-tag="true" max-height="32"/>
<slot/>
<div class="ml-auto d-flex align-center">
<span class="title mr-4">{{title}}</span>
@@ -9,7 +9,7 @@
<toolbar-button tooltip="Assets" icon="mdi-currency-btc" route="Assets"/>
<!-- mdi-format-list-checks mdi-format-list-bulleted-square -->
<toolbar-button tooltip="Status" icon="mdi-format-list-checks" route="Status"/>
<v-btn variant="text" icon="mdi-information-outline" text="Info" @click="showCorp"></v-btn>
<toolbar-button tooltip="About" icon="mdi-information-outline" href="https://dexorder.trade/home" target="dexorder-help"/>
</div>
</div>
</template>
@@ -21,10 +21,6 @@ import {nav} from "@/misc.js";
const props = defineProps(['title', 'icon'])
function showCorp() {
window.open('https://dexorder.trade/', 'dexorder')
}
</script>
<style scoped lang="scss">

View File

@@ -2,7 +2,7 @@
<v-tooltip :text="tooltip" location="top">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" :color="isCurrent?'primary':undefined" variant="text"
:icon="icon" @click="()=>nav(route)"/>
:icon="icon" @click="click"/>
</template>
</v-tooltip>
</template>
@@ -12,9 +12,25 @@ import {computed} from "vue";
import {useRoute} from "vue-router";
import {nav} from "/src/misc.js"
const props = defineProps(['icon', 'route', 'tooltip'])
const props = defineProps(['icon', 'route', 'tooltip', 'href', 'target'])
const router = useRoute();
const isCurrent = computed(() => router.name === props.route)
function click() {
if (!props.href && !props.route)
console.warn('must set href or route in toolbar-button')
else if (props.href && props.route)
console.warn('cannot set both rout and href in toolbar-button')
else if (props.href) {
if (props.target)
window.open(props.href, props.target)
else
window.location.href = props.href
}
else
nav(props.route)
}
</script>
<style scoped lang="scss">