-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
692d305
commit 5988814
Showing
17 changed files
with
489 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
<template> | ||
<div id="app"> | ||
<navigation /> | ||
<router-view /> | ||
</div> | ||
</template> | ||
<script setup> | ||
import Navigation from "@/components/Navigation.vue"; | ||
</script> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#home { | ||
height: 100%; | ||
|
||
#home-top { | ||
background: #F9F9F9; | ||
height: 100vh; | ||
display: grid; | ||
grid-template-rows: auto fit-content(0px) auto; | ||
transition: 0.3s height; | ||
#home-slug { | ||
text-align: center; | ||
margin-bottom: 60px; | ||
font-weight: 400; | ||
b { | ||
font-weight: 600; | ||
} | ||
} | ||
#home-top-contents { | ||
} | ||
|
||
&.logged-in { | ||
height: initial; | ||
grid-template-rows: 50px fit-content(60px) 50px; | ||
#home-slug { | ||
display: none; | ||
} | ||
#home-top-contents { | ||
margin-top: 55px; | ||
} | ||
} | ||
|
||
|
||
@media (prefers-color-scheme: dark) { | ||
background: #111111; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<script setup> | ||
import Modal from "@/components/Modal.vue"; | ||
import {apiClient} from "@/main"; | ||
import {ref, watch, watchEffect} from "vue"; | ||
import router from "@/router"; | ||
const visible = defineModel('visible') | ||
const resultModalVisible = ref(false) | ||
const slugChanged = ref(false) | ||
const createWorkspace = ref({ | ||
name: '', | ||
slug: '' | ||
}) | ||
const result = ref(null) | ||
const emit = defineEmits(['created', 'dnsCheckDone']) | ||
watch(visible, () => { | ||
if (visible.value) { | ||
createWorkspace.value = { | ||
name: '', | ||
slug: '' | ||
} | ||
slugChanged.value = false | ||
} | ||
}) | ||
watch(() => createWorkspace.value.name, () => { | ||
if (!slugChanged.value) { | ||
createWorkspace.value.slug = createWorkspace.value.name.replaceAll(' ', '-').toLowerCase().replace(/[^0-9a-z\-_]/gi, '') | ||
} | ||
}) | ||
const create = async () => { | ||
const workspace = await apiClient.createWorkspaces(createWorkspace.value) | ||
result.value = {workspace} | ||
visible.value = true | ||
resultModalVisible.value = true | ||
await router.push({ | ||
name: 'workspace-home', | ||
params: { | ||
workspace: workspace.slug | ||
} | ||
}) | ||
} | ||
</script> | ||
<template> | ||
<Modal v-model:visible="visible" title="Add Workspace" @submit="create"> | ||
<div class="mb-3"> | ||
<label class="mb-1">NAME</label> | ||
<input autofocus v-model="createWorkspace.name" type="text" class="input"> | ||
</div> | ||
<div class="mb-4"> | ||
<label class="mb-1">SLUG (Only a-z, 1-9, _, - are allowed)</label> | ||
<input @input="slugChanged = true" @change="slugChanged = true" v-model="createWorkspace.slug" type="text" class="input"> | ||
</div> | ||
|
||
|
||
<button type="submit" class="btn right mt-4">Confirm</button> | ||
</Modal> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script setup> | ||
import CreateWorkspaceModal from "@/components/CreateWorkspaceModal.vue"; | ||
import {onMounted, ref} from "vue"; | ||
import {apiClient} from "@/main"; | ||
const createWorkspaceModalVisible = ref(false) | ||
const workspaces = ref([]) | ||
onMounted(async () => { | ||
workspaces.value = (await apiClient.getWorkspaces()).data | ||
}) | ||
</script> | ||
<template> | ||
<div class="mt-3"> | ||
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px"> | ||
<router-link v-for="workspace of workspaces" :to="{name: 'workspace-home', params: {workspace: workspace.slug}}" class="block no-underline"> | ||
<div class="border-1 border-300 p-2 hover:surface-100 transition-duration-300 border-round-md text-900 text-center"> | ||
{{ workspace.name }} | ||
</div> | ||
</router-link> | ||
|
||
<div @click="createWorkspaceModalVisible = true" class="cursor-pointer border-1 border-300 p-2 border-dashed hover:surface-100 transition-duration-300 border-round-md text-900 text-center"> | ||
add workspace | ||
</div> | ||
</div> | ||
<CreateWorkspaceModal v-model:visible="createWorkspaceModalVisible" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<navigation /> | ||
<router-view /> | ||
</template> | ||
<script setup lang="ts"> | ||
import Navigation from "@/components/Navigation.vue"; | ||
</script> |
Oops, something went wrong.