Skip to content

Commit

Permalink
chenges for 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
positivecrash committed Apr 9, 2024
1 parent b9667a0 commit 1633ca6
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 93 deletions.
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let setExpireDate = () => {
if(store.state.robonomicsUIvue.rws.active) {
// записываем timestamp окончания подписки для подписки с владельцем active, если дата есть
store.commit('rws/setExpiredate', new Date('2024-01-5').getTime())
// Если подписка не находится совсем, то возращаем null
// store.commit('rws/setExpiredate', null)
}
Expand Down
240 changes: 157 additions & 83 deletions src/views/examples/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,121 @@
<robo-layout>
<dapp-header title="Dashboard" />

<robo-layout-section>
<robo-grid offset="x0" gap="x1" valign="start" galign="start" minColumnWidth="550px" maxColumnWidth="1fr">

<!-- {
src: 'https://static.robonomics.network/dapp/Robonomics-smart-home-intro.webm',
type: 'video/webm'
},
{
src: 'https://static.robonomics.network/dapp/Robonomics-smart-home-intro.mp4',
type: 'video/mp4'
} -->


<robo-video
autoplay
loop
:sources="[
{
src: 'https://crustipfs.art/ipfs/QmStCDsEHCYwVYvnDdmZBMnobPmrgZx3iJLm65b8XNzKQa',
type: 'video/mp4'
}
]"
script="<p>Robonomics is a decentralized cloud service that can be used to enhance
your smart home system. It addresses two main problems: the lack of
control over data shared with vendors or third parties, and the vulnerability of
smart homes to centralized cloud server shutdowns.</p>
<p>With Robonomics, you can take advantage of its secure,
serverless, and decentralized cloud service to improve the functionality of
your smart home. Plus, you can use it with a wide range of Zigbee smart devices
to automate and control various aspects of your home.</p>
<p>Installing Robonomics on top of Home Assistant is easy, and there are
several options to choose from. Simply select the method that works best for you
and your smart home on wiki.robonomics.network.</p>"
/>

<robo-grid-item align="stretch">
<robo-grid offset="x0" gap="x1" minColumnWidth="270px" maxColumnWidth="1fr">

<robo-card fixedButton>
<robo-grid offset="x0" gap="x05" valign="start">
<robo-icon icon="current-version" size="big" />
<div>
<robo-text title="4">Your RWS subscriptions</robo-text>
</div>
<robo-layout-section width="middle-wide">
<robo-grid offset="x0" minColumnWidth="200px">
<robo-section offset="x0">
<robo-card>
<template v-if="rwsactive && rwsactive !== ''">
<robo-template-rws-active />
</template>
<template v-else>
<robo-text title="4" align="left">RWS subscription</robo-text>
<robo-section offset="x1">
<robo-text size="small" weight="normal-italic">
<robo-grid offset="x0" gap="x05" columns="1">
<robo-grid-item borderbottom>
Price from: <b>~ 1 XRT </b>

<robo-details>
<template #summary>
<robo-icon icon="circle-question" />
</template>
<robo-grid offset="x0" gap="x05">
<robo-text weight="bold">Where to buy XRT</robo-text>
<robo-link href="https://app.basilisk.cloud/trade">
Basilisk
</robo-link>
<robo-link
href="https://app.solarbeam.io/exchange/swap"
>
Solarbeam
</robo-link>
<robo-link
href="https://trade.kraken.com/markets/kraken/xrt/usd"
>
Kraken
</robo-link>
</robo-grid>
</robo-details>
</robo-grid-item>

<robo-grid-item borderbottom>
Activation time <b>~ 2 min</b>
</robo-grid-item>

<robo-grid-item>
Available subscriptions:
<b>12</b>
</robo-grid-item>
</robo-grid>
<robo-button :router="store.state.robonomicsUIvue.rws.links.list">View details</robo-button>
</robo-card>

<robo-card :pale="rws?.length < 1" fixedButton>
<robo-grid offset="x0" gap="x05" valign="start">
<robo-icon icon="plug" size="big" />
<div>
<robo-text title="4">Control smart devices</robo-text>
</div>
</robo-grid>
<robo-button :router="store.state.robonomicsUIvue.rws.links.devices" :disabled="rws?.length < 1">Manage devices</robo-button>
</robo-card>

<robo-card :pale="rws?.length < 1" fixedButton>
<robo-grid offset="x0" gap="x05" valign="start">
<robo-icon icon="user-group" size="big" />
<div>
<robo-text title="4">Share your telemetry</robo-text>
</div>
</robo-grid>
<robo-button :router="store.state.robonomicsUIvue.rws.links.users" :disabled="rws?.length < 1">Manage Users</robo-button>
</robo-card>

<robo-card>
<robo-text title="4" offset="x0">Need help?</robo-text>
<robo-grid gap="x05" offset="x1">
<robo-text size="small" weight="bold"><robo-link href="https://wiki.robonomics.network">Wiki</robo-link> - Tutorials</robo-text>
<robo-text size="small" weight="bold"><robo-link href="https://github.com/airalab/dapp.robonomics.network">Github</robo-link> - Bugs & improvements</robo-text>
<robo-text size="small" weight="bold"><robo-link href="https://discord.gg/JpaN2XAmqY">Discord</robo-link> - Team support</robo-text>
</robo-grid>
</robo-card>
</robo-grid>
</robo-grid-item>

</robo-grid>
</robo-layout-section>
</robo-text>
</robo-section>

<robo-button :router="linkActivate" size="small" block>
<robo-icon icon="wallet" /> Buy a subscription
</robo-button>
</template>
</robo-card>
</robo-section>

<robo-section offset="x0">
<robo-text title="4" align="left">What you get with RWS</robo-text>
<robo-text size="small" weight="normal-italic">
<robo-grid offset="x0" gap="x05" columns="1">
<robo-grid-item borderbottom>
<robo-icon icon="check" /> Brand-independent smart home
</robo-grid-item>
<robo-grid-item borderbottom>
<robo-icon icon="check" /> Secured data, only you have access
</robo-grid-item>
<robo-grid-item borderbottom>
<robo-icon icon="check" /> Remote control without corporate clouds
</robo-grid-item>
<robo-grid-item>
<robo-icon icon="check" /> Home assistant integration
</robo-grid-item>
</robo-grid>
</robo-text>
</robo-section>

<robo-section offset="x0">
<robo-text title="4" align="left">What is RWS</robo-text>
<robo-text weight="normal-italic" size="small" offset="x1">
Robonomics Web Services (RWS) is a smart home integration that enables
secure interaction with smart devices and robots through transactions
on the Robonomics parachain, rather than relying on centralized cloud
services.
</robo-text>
<robo-text weight="normal-italic" size="small" offset="x1">
An RWS subscription ensures stable transaction processing with every
block, making it an ideal choice for those who wish to receive data
from devices and remotely manage them.
</robo-text>
<robo-text weight="normal-italic" size="small" offset="x1">
Easy to start for Home Assistant users.
<robo-link
href="https://wiki.robonomics.network/docs/hass-image-install/#hardware-you-need-for-installation"
>
Guide to start
</robo-link>
</robo-text>
</robo-section>
</robo-grid>
</robo-layout-section>

<robo-layout-section>
<robo-grid id="home-links" offset="x0" :columns="3" gap="x05">
<robo-link href="https://www.youtube.com/watch?v=onMv_An8h2Q">
<span>What is Robonomics</span>
</robo-link>
<robo-link href="https://wiki.robonomics.network">
<span>Step-by-step tutorials</span>
</robo-link>
<robo-link href="https://robonomics.academy">
<span>Advanced cources</span>
</robo-link>
</robo-grid>
</robo-layout-section>

<dapp-footer />

Expand All @@ -104,9 +138,49 @@ import { computed } from 'vue'
import { useStore } from 'vuex'
const store = useStore()
const rws = computed( () => {
return store.state.robonomicsUIvue.rws.list
// const rws = computed( () => {
// return store.state.robonomicsUIvue.rws.list
// })
const rwsactive = computed(() => {
return store.state.robonomicsUIvue.rws.active;
})
/* - get rws */
</script>
</script>

<style>
#home-links .robo-link {
position: relative;
display: block;
background-color: var(--robo-color-blue-80);
min-height: 150px;
color: var(--robo-color-light);
padding: var(--robo-space);
font-weight: bold;
text-transform: uppercase;
}
#home-links .robo-link:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 15px;
background-color: var(--robo-color-blue);
z-index: 1;
transition: 0.2s all;
}
#home-links .robo-link:hover::before {
height: 100%;
}
#home-links .robo-link span {
display: block;
margin-top: 30px;
position: relative;
z-index: 2;
}
</style>
18 changes: 15 additions & 3 deletions src/views/examples/rwsbuy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
activationtime="2"
available="7"

:chainInfoUploaded="chainInfoStatus"
:rwsExpiration="expiredate"
@on-activate="activateRWS"
/>
Expand All @@ -28,8 +29,18 @@ import { useStore } from 'vuex'
const store = useStore()
const expiredate = ref(null)
const chainInfoStatus = ref(false)
onMounted( () => {
onMounted( async () => {
/*
Проверка загрузки данных из чейна. Если все загрузилось, то ставим true.
Можно оставить setTimeout всегда, чтобы лоадер сильно не мерцал, если данные быстро загрузились.
*/
setTimeout(() => {
chainInfoStatus.value = true
}, 1000)
/*
При загрузке надо проверить есть ли подписка для подключенного адреса (store.state.robonomicsUIvue.polkadot.address)
Expand All @@ -39,11 +50,12 @@ onMounted( () => {
expiredate.value = new Date('2024-02-05').getTime()
/*
Если подключенный полкадот адрес меняется, то надо опять промерить для этого адреса подписку и так же передать в prop rwsExpiration
Если подключенный полкадот адрес меняется, то надо опять проверить для этого адреса подписку и так же передать в prop rwsExpiration
*/
watch( () => store.state.robonomicsUIvue.polkadot.address, () => {
expiredate.value = null
expiredate.value = new Date('2024-01-05').getTime()
// expiredate.value = null
// ну или дата окончания подписки для этого адреса
})
})
Expand Down
Loading

0 comments on commit 1633ca6

Please sign in to comment.