explorer-app/components/Project/Create/Categories/Technology.vue

115 lines
3.4 KiB
Vue
Raw Normal View History

2024-09-12 18:03:06 +02:00
<script setup lang="ts">
import type { Project } from '~/types'
const props = defineProps<{
project?: Partial<Project>
}>()
2024-10-10 11:58:35 +02:00
const version = ref(props.project?.project_phase ? props.project?.project_phase?.toLowerCase() : props.project?.project_status?.version ? props.project?.project_status?.version.toLowerCase() : undefined)
2024-09-12 18:03:06 +02:00
const openSource = ref(props.project?.blockchain_features?.opensource || false)
const upgradability = ref(props.project?.blockchain_features?.upgradability?.enabled || false)
const assetType = ref(props.project?.blockchain_features?.asset_custody_type?.toLowerCase() || '')
const encryption = ref(props.project?.blockchain_features?.encryption || '')
const peerToPeer = ref(props.project?.blockchain_features?.p2p)
const decentralizedStorage = ref(props.project?.storage?.decentralized)
const { projectPhase: projectPhaseData, assetCustody: assetCustodyData } = useData()
2024-09-12 18:03:06 +02:00
const { saveProject } = useProject()
function save() {
saveProject({
project_phase: version.value,
2024-10-10 11:58:35 +02:00
project_status: {
live_status: version.value ? true : false,
mainnet: version.value === 'mainnet' ? true : false,
testnet: version.value === 'testnet' ? true : false,
version: version.value,
},
2024-09-12 18:03:06 +02:00
blockchain_features: {
opensource: openSource.value,
upgradability: {
enabled: upgradability.value,
},
asset_custody_type: assetType.value,
encryption: encryption.value,
p2p: peerToPeer.value,
},
storage: {
decentralized: decentralizedStorage.value,
},
})
}
defineExpose({
save,
})
</script>
<template>
<div>
<ProjectCreateComponentsCategoryDivider
w-full
title="VERSION"
/>
<ProjectCreateComponentsRadio
v-model="version"
2024-09-20 08:58:14 +02:00
:options="projectPhaseData?.map(p => ({ label: p.name, value: p.id }))"
2024-09-12 18:03:06 +02:00
/>
<ProjectCreateComponentsCategoryDivider
w-full
title="FEATURES"
/>
<div
flex
flex-col
gap-24px
>
2024-09-27 12:14:49 +02:00
<ProjectCreateComponentsSelect
v-model="assetType"
:options="assetCustodyData?.map(c => ({ label: c.name, value: c.id }))"
label="Asset custody type"
placeholder="Select custody type"
hint="How are users fund handled? (non-custody, multisig, pool,...)"
/>
2024-09-12 18:03:06 +02:00
<ProjectCreateComponentsToggle
v-model="openSource"
label="Open source"
hint="Check when projects source code is openly available and editable"
/>
<ProjectCreateComponentsToggle
v-model="upgradability"
label="Upgradability"
hint="Are developers able to upgrade and change deployed contract?"
/>
</div>
2024-09-27 12:14:49 +02:00
2024-09-12 18:03:06 +02:00
<ProjectCreateComponentsCategoryDivider
w-full
title="ADDITIONAL INFO"
/>
<div
flex
flex-col
gap-24px
>
<ProjectCreateComponentsInput
v-model="encryption"
lg="w-1/2"
label="Technology type / Encryption"
hint="Define technologies your project uses for privacy ex. Zero-Knowledge (ZK), SHA256,"
placeholder="Technology name"
/>
<ProjectCreateComponentsToggle
v-model="peerToPeer"
label="Peer to Peer (P2P)"
hint="Check when you transfer / communicate withou intermediaries"
/>
<ProjectCreateComponentsToggle
v-model="decentralizedStorage"
label="Decentralized storage"
hint="Is your data hosted on IPFS, Filecoin or other decentralized storage?"
/>
</div>
</div>
</template>