-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kb): Main page with creation and persistence on Aleph
- Loading branch information
1 parent
0f9ed31
commit d7a2f27
Showing
15 changed files
with
3,687 additions
and
4,989 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// import { boot } from 'quasar/wrappers'; | ||
// import KnowledgeStoreUploader from 'components/KnowledgeStoreUploader.ts'; | ||
// "async" is optional; | ||
// more info on params: https://v2.quasar.dev/quasar-cli/boot-files | ||
// export default boot(async ({ _app }) => { | ||
// // something to do | ||
// // app.component('KnowledgeStoreUploader', KnowledgeStoreUploader); | ||
// }); | ||
import { boot } from 'quasar/wrappers'; | ||
|
||
import dayjs from 'dayjs'; | ||
import localizedFormat from 'dayjs/plugin/localizedFormat'; | ||
import relativeTime from 'dayjs/plugin/relativeTime'; | ||
|
||
export default boot(() => { | ||
dayjs.extend(localizedFormat); | ||
dayjs.extend(relativeTime); | ||
}); |
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,53 @@ | ||
<template> | ||
<q-dialog class="q-pa-lg text-light" style="flex-grow: 1"> | ||
<q-card class="q-pa-md"> | ||
<q-card-actions :class="`flex flex-left text-semibold ${$q.dark.mode ? '' : 'text-purple700'}`"> | ||
Create knowledge base | ||
<q-space /> | ||
<q-btn | ||
v-close-popup | ||
:icon="`img:icons/svg/close${$q.dark.mode ? '_lighten' : ''}.svg`" | ||
flat | ||
size="sm" | ||
unelevated | ||
/> | ||
</q-card-actions> | ||
|
||
<q-card-section horizontal> | ||
<q-card-section> | ||
<span>Name</span> | ||
<q-input v-model="name" bg-color="secondary" input-class="text-light q-px-sm" outlined></q-input> | ||
</q-card-section> | ||
</q-card-section> | ||
|
||
<q-card-section class="text-primary tw-mt-4" horizontal> | ||
<q-btn v-close-popup class="q-px-xl tw-py-1" label="Close" rounded /> | ||
<q-space /> | ||
<q-btn | ||
v-close-popup | ||
class="bg-primary q-px-xl tw-py-1" | ||
label="Confirm" | ||
rounded | ||
text-color="white" | ||
@click="createKnowledgeBase" | ||
/> | ||
</q-card-section> | ||
</q-card> | ||
</q-dialog> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
import { useQuasar } from 'quasar'; | ||
const $q = useQuasar(); | ||
const emit = defineEmits<{ create: [name: string] }>(); | ||
// Form values | ||
const name = ref(''); | ||
const createKnowledgeBase = () => { | ||
emit('create', name.value); | ||
}; | ||
</script> |
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 was deleted.
Oops, something went wrong.
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,52 @@ | ||
<template> | ||
<section class="max-sm:tw-mx-4 md:tw-mx-10 tw-my-5"> | ||
<h4 class="text-h4 text-semibold tw-mb-5">Knowledge base</h4> | ||
<p>Manage your knowledge bases</p> | ||
<div class="tw-mt-4 tw-mb-8 tw-flex md:tw-justify-end"> | ||
<q-btn | ||
class="border-primary-highlight" | ||
icon="img:icons/svg/add.svg" | ||
label="Create knowledge base" | ||
no-caps | ||
rounded | ||
unelevated | ||
@click="createKnowledgeDialog = true" | ||
/> | ||
<knowledge-base-creation-dialog v-model="createKnowledgeDialog" @create="createKnowledgeBase" /> | ||
</div> | ||
|
||
<div class="tw-space-y-4"> | ||
<RouterLink | ||
v-for="knowledgeBase of knowledgeStore.knowledgeBases" | ||
:key="knowledgeBase.id" | ||
:to="`/knowledge-base/${knowledgeBase.id}`" | ||
class="tw-block" | ||
> | ||
<div class="tw-flex tw-border tw-rounded-lg tw-p-4"> | ||
<img alt="folder" class="tw-mr-4" height="20" src="/icons/svg/folder.svg" width="20" /> | ||
<p class="tw-font-bold tw-text-base">{{ knowledgeBase.name }}</p> | ||
<div class="tw-ml-auto tw-flex tw-gap-4"> | ||
<p>{{ knowledgeBase.documents.length }} File{{ knowledgeBase.documents.length !== 1 ? 's' : '' }}</p> | ||
<p>Last updated: {{ dayjs(knowledgeBase.lastUpdatedAt).format('LL') }}</p> | ||
<img alt="chevron" height="22" src="/icons/svg/chevron-right.svg" width="22" /> | ||
</div> | ||
</div> | ||
</RouterLink> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
import KnowledgeBaseCreationDialog from 'components/dialog/KnowledgeBaseCreationDialog.vue'; | ||
import { useKnowledgeStore } from 'stores/knowledge'; | ||
import dayjs from 'dayjs'; | ||
const knowledgeStore = useKnowledgeStore(); | ||
const createKnowledgeDialog = ref(false); | ||
const createKnowledgeBase = (name: string) => { | ||
knowledgeStore.createKnowledgeBase(name); | ||
}; | ||
</script> |
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
Oops, something went wrong.