Browse Source

wip: create project page

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2534/head
Pranav C 2 years ago
parent
commit
2a8a8f066e
  1. 50
      packages/nc-gui-v2/pages/dashboard/[projectId].vue
  2. 0
      packages/nc-gui-v2/pages/projects/create.vue
  3. 0
      packages/nc-gui-v2/pages/projects/createExternal.vue
  4. 28
      packages/nc-gui-v2/plugins/primevue.ts

50
packages/nc-gui-v2/pages/dashboard/[projectId].vue

@ -1,39 +1,43 @@
<template>
<!-- todo: move to layout or create a reusable component -->
<div class="nc-container">
<div class="nc-topbar shadow-2">
</div>
<div class="nc-sidebar shadow-2 p-4 overflow-y-auto">
<DashboardTreeView></DashboardTreeView>
</div>
<div class="nc-content p-4 overflow-auto">
<DashboardTabView></DashboardTabView>
<NuxtLayout>
<!-- todo: move to layout or create a reusable component -->
<div class="nc-container">
<div class="nc-topbar shadow-2">
</div>
<div class="nc-sidebar shadow-2 p-4 overflow-y-auto">
<DashboardTreeView></DashboardTreeView>
</div>
<div class="nc-content p-4 overflow-auto">
<DashboardTabView></DashboardTabView>
</div>
</div>
</div>
</NuxtLayout>
</template>
<script setup lang="ts">
import {useProject} from "~/composables/project";
import {watch} from "vue";
import {useTabs} from "~/composables/tabs";
import { useProject } from "~/composables/project";
import { watch } from "vue";
import { useTabs } from "~/composables/tabs";
const route = useRoute()
const {loadProject, loadTables} = useProject()
const {clearTabs} = useTabs()
const route = useRoute();
const { loadProject, loadTables } = useProject();
const { clearTabs } = useTabs();
onMounted(async () => {
await loadProject(route.params.projectId as string)
await loadTables()
})
await loadProject(route.params.projectId as string);
await loadTables();
});
watch(() => route.params.projectId, async (newVal, oldVal) => {
if (newVal && newVal !== oldVal) {
clearTabs()
await loadProject(newVal as string)
await loadTables()
clearTabs();
await loadProject(newVal as string);
await loadTables();
}
})
});
</script>

0
packages/nc-gui-v2/pages/projects/create.vue

0
packages/nc-gui-v2/pages/projects/createExternal.vue

28
packages/nc-gui-v2/plugins/primevue.ts

@ -1,4 +1,4 @@
import {defineNuxtPlugin} from "#app";
import { defineNuxtPlugin } from "#app";
import PrimeVue from "primevue/config";
import Button from "primevue/button";
import InputText from "primevue/inputtext";
@ -9,19 +9,21 @@ import Message from "primevue/message";
import TabMenu from "primevue/tabmenu";
import DataTable from "primevue/datatable";
import Column from "primevue/column";
import ToastService from 'primevue/toastservice';
import Dropdown from "primevue/dropdown";
import ToastService from "primevue/toastservice";
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(PrimeVue, {ripple: true});
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.vueApp.use(PrimeVue, { ripple: true });
nuxtApp.vueApp.use(ToastService);
nuxtApp.vueApp.component('Button', Button);
nuxtApp.vueApp.component('InputText', InputText);
nuxtApp.vueApp.component('Toast', Toast);
nuxtApp.vueApp.component('Card', Card);
nuxtApp.vueApp.component('Sidebar', Sidebar);
nuxtApp.vueApp.component('Message', Message);
nuxtApp.vueApp.component('TabMenu', TabMenu);
nuxtApp.vueApp.component('DataTable', DataTable);
nuxtApp.vueApp.component('Column', Column);
nuxtApp.vueApp.component("Button", Button);
nuxtApp.vueApp.component("InputText", InputText);
nuxtApp.vueApp.component("Toast", Toast);
nuxtApp.vueApp.component("Card", Card);
nuxtApp.vueApp.component("Sidebar", Sidebar);
nuxtApp.vueApp.component("Message", Message);
nuxtApp.vueApp.component("TabMenu", TabMenu);
nuxtApp.vueApp.component("DataTable", DataTable);
nuxtApp.vueApp.component("Dropdown", Dropdown);
nuxtApp.vueApp.component("Column", Column);
//other components that you need
});

Loading…
Cancel
Save