Browse Source

/get/:zone/:domain

vue
Lev 2 years ago
parent
commit
2103bd8593
  1. 30
      .idea/workspace.xml
  2. 15
      src/components/DomainBar.vue
  3. 4
      src/components/ZoneTable.vue
  4. 16
      src/router/index.ts
  5. 29
      src/views/Get.vue
  6. 2
      src/views/TonDns.vue

30
.idea/workspace.xml

@ -1,18 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ddb8afd5-d3ba-47b1-b6d0-227403f1abf7" name="Changes" comment="Started writing ZoneTable + improvements to the search bar">
<change afterPath="$PROJECT_DIR$/src/components/TonButton.vue" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/components/ZonePricing.vue" afterDir="false" />
<list default="true" id="ddb8afd5-d3ba-47b1-b6d0-227403f1abf7" name="Changes" comment="ZoneTable with ZonePricing">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/assets/main.css" beforeDir="false" afterPath="$PROJECT_DIR$/src/assets/main.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/DarkLayout.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/DarkLayout.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/DomainBar.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/DomainBar.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/ZoneTable.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/ZoneTable.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/views/Find.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/views/Find.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zone.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zone.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/router/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/router/index.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/views/Get.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/views/Get.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/views/TonDns.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/views/TonDns.vue" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -79,7 +74,8 @@
<workItem from="1670839496719" duration="10862000" />
<workItem from="1670927344373" duration="29000" />
<workItem from="1670927391338" duration="2277000" />
<workItem from="1671024025708" duration="16340000" />
<workItem from="1671024025708" duration="19806000" />
<workItem from="1671204365793" duration="4251000" />
</task>
<task id="LOCAL-00001" summary="Wrote the landing">
<created>1670844191163</created>
@ -116,7 +112,14 @@
<option name="project" value="LOCAL" />
<updated>1671100962105</updated>
</task>
<option name="localTasksCounter" value="6" />
<task id="LOCAL-00006" summary="ZoneTable with ZonePricing">
<created>1671116726928</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1671116726928</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -139,6 +142,7 @@
<MESSAGE value="Adaptivity + more assets" />
<MESSAGE value="DarkLayout + Domain Bar" />
<MESSAGE value="Started writing ZoneTable + improvements to the search bar" />
<option name="LAST_COMMIT_MESSAGE" value="Started writing ZoneTable + improvements to the search bar" />
<MESSAGE value="ZoneTable with ZonePricing" />
<option name="LAST_COMMIT_MESSAGE" value="ZoneTable with ZonePricing" />
</component>
</project>

15
src/components/DomainBar.vue

@ -1,8 +1,8 @@
<template>
<div class="domain-bar">
<div style="display: flex" class="prompt-cont">
<contenteditable :contenteditable="editable" tag="div" class="prompt" v-model="val" :no-html="true" @returned="search()"></contenteditable>
<div class="post-prompt">{{ postprompt }}</div>
<contenteditable :contenteditable="editable" tag="div" class="prompt" :no-nl="true" v-model="val" :no-html="true" @returned="search()"></contenteditable>
<div class="post-prompt">{{ zone }}</div>
</div>
<div class="search" v-if="has_button" @click="search()">Search</div>
</div>
@ -15,9 +15,9 @@ export default {
name: "DomainBar",
components: {contenteditable},
props: {
postprompt: {
zone: {
type: String,
default: ".ton"
default: ".*"
},
has_button: {
type: Boolean,
@ -44,10 +44,11 @@ export default {
},
watch: {
value: function (val) {
val = val.replace('\n', '');
this.val = val;
},
val: function (val) {
this.$emit("input", val);
this.$emit("input_d", val);
}
}
}
@ -123,4 +124,8 @@ export default {
margin-top: 1rem;
margin-bottom: 1rem;
}
.post-prompt {
font-family: 'Inconsolata', monospace;
}
</style>

4
src/components/ZoneTable.vue

@ -1,6 +1,6 @@
<template>
<div style="overflow-x: auto; max-width: 98vw;">
<table class="table_outer">
<table class="table_outer mobile-scale">
<thead class="table_header">
<tr>
<th>Domain</th>
@ -10,7 +10,7 @@
<tbody class="table_content">
<tr v-for="zone in zones" :key="zone.zone">
<td class="mobile-scale">
<router-link :to="{name: 'Find' /*todo: specify zone here*/}" style="color: white">
<router-link :to="{name: 'GetZ', params: {zone: zone.zone}}" style="color: white">
{{ zone.zone }}
</router-link>
</td>

16
src/router/index.ts

@ -1,6 +1,14 @@
import {createRouter, createWebHistory} from 'vue-router'
import Landing from '../views/Landing.vue'
/*
/find - bar + table
/find/query - search results
/get/zone - get a domain in a zone (should be able to go to /find)
/get/zone/domain - get a specific domain
*/
// todo: change zone repr from .zone.ton to zone
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
@ -25,7 +33,13 @@ const router = createRouter({
component: () => import('../views/TonDns.vue')
},
{
path: '/get/:domain',
path: '/get/:zone',
name: 'GetZ',
component: () => import('../views/Get.vue'),
props: true
},
{
path: '/get/:zone/:domain_init',
name: 'Get',
component: () => import('../views/Get.vue'),
props: true

29
src/views/Get.vue

@ -1,7 +1,7 @@
<template>
<DarkLayout>
<router-link :to="{name: 'Find'}"></router-link>
<DomainBar/>
<router-link :to="{name: 'Find'}"><!-- todo: "All zones" button here --></router-link>
<DomainBar :zone="zone" :value="domain" @search="search()" @input_d="handle_input($event)"/>
</DarkLayout>
</template>
@ -11,11 +11,32 @@ import DomainBar from "../components/DomainBar.vue";
export default {
name: "Get",
props: {
domain: {
domain_init: {
type: String,
},
zone: {
type: String,
}
},
components: {DomainBar, DarkLayout},
data() {
return {
domain: this.domain_init
}
},
components: {DomainBar, DarkLayout}
methods: {
search() {
this.$router.push({name: 'Get', params: {domain_init: this.domain, zone: this.zone}});
},
handle_input(val) {
this.domain = val;
}
},
watch: {
domain_init: function (val) {
this.domain = val;
}
}
}
</script>

2
src/views/TonDns.vue

@ -18,7 +18,7 @@
</div>
</template>
<template v-slot:buttons>
<router-link to="/get">
<router-link :to="{name: 'Find'}">
<button class="b blue wide">
<span>Omg, can I get one?</span>
<img src="@/assets/icons/ton_right.svg" alt="Next"/>

Loading…
Cancel
Save