mirror of https://github.com/nocodb/nocodb
Pranav C
3 years ago
17 changed files with 271 additions and 203 deletions
@ -0,0 +1,12 @@ |
|||||||
|
<component name="ProjectRunConfigurationManager"> |
||||||
|
<configuration default="false" name="Run GUI" type="js.build_tools.npm"> |
||||||
|
<package-json value="$PROJECT_DIR$/packages/nc-gui/package.json" /> |
||||||
|
<command value="run" /> |
||||||
|
<scripts> |
||||||
|
<script value="dev" /> |
||||||
|
</scripts> |
||||||
|
<node-interpreter value="project" /> |
||||||
|
<envs /> |
||||||
|
<method v="2" /> |
||||||
|
</configuration> |
||||||
|
</component> |
@ -0,0 +1,8 @@ |
|||||||
|
import type { NuxtApp as BaseApp } from '#app/nuxt' |
||||||
|
import type { Api } from 'nocodb-sdk' |
||||||
|
|
||||||
|
declare module '#app/nuxt' { |
||||||
|
interface NuxtApp extends BaseApp { |
||||||
|
$api: Api<any>; |
||||||
|
} |
||||||
|
} |
@ -1,88 +1,94 @@ |
|||||||
<template> |
<template> |
||||||
|
<NuxtLayout> |
||||||
|
<v-navigation-drawer color="" permanent></v-navigation-drawer> |
||||||
<!-- todo: move to layout or create a reusable component --> |
<v-main> |
||||||
<div class="nc-container"> |
<v-container> |
||||||
<div class="nc-topbar shadow-2"> |
<!-- tod |
||||||
</div> |
o: move to layout or create a reusable component --> |
||||||
<div class="nc-sidebar shadow-2 p-4 overflow-y-auto"> |
<!-- <div class="nc-container">--> |
||||||
|
<!-- <div class="nc-topbar shadow-2">--> |
||||||
</div> |
<!-- </div>--> |
||||||
<div class="nc-content p-4 overflow-auto"> |
<!-- <div class="nc-sidebar shadow-2 p-4 overflow-y-auto">--> |
||||||
<div class="grid"> |
|
||||||
<div class="col-3 p-3" v-for="project in projects" :key="project.id"> |
<!-- </div>--> |
||||||
|
<!-- <div class="nc-content p-4 overflow-auto">--> |
||||||
<Card @click="navigateToDashboard(project)"> |
<v-row> |
||||||
<template #content> |
<v-col cols="4" v-for="project in projects" :key="project.id"> |
||||||
<div class="text-center"> |
|
||||||
<h3>{{ project.title }}</h3> |
<v-card @click="navigateToDashboard(project)"> |
||||||
</div> |
<v-card-title> |
||||||
</template> |
<div class="text-center"> |
||||||
</Card> |
<h3>{{ project.title }}</h3> |
||||||
|
</div> |
||||||
</div> |
</v-card-title> |
||||||
</div> |
</v-card> |
||||||
</div> |
|
||||||
</div> |
</v-col> |
||||||
|
</v-row> |
||||||
|
</v-container> |
||||||
|
<!-- </div>--> |
||||||
|
<!-- </div>--> |
||||||
|
|
||||||
|
|
||||||
|
</v-main> |
||||||
|
</NuxtLayout> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||||
|
|
||||||
import {useRouter} from "#app"; |
import { useRouter } from "#app"; |
||||||
|
|
||||||
const {$api} = useNuxtApp() |
|
||||||
const {user} = useUser() |
|
||||||
|
|
||||||
|
const { $api } = useNuxtApp(); |
||||||
|
const { user } = useUser(); |
||||||
|
|
||||||
|
|
||||||
const $router = useRouter() |
const $router = useRouter(); |
||||||
|
|
||||||
const projects = ref() |
const projects = ref(); |
||||||
|
|
||||||
const loadProjects = async () => { |
const loadProjects = async () => { |
||||||
const projectsResponse = await $api.project.list({}, { |
const projectsResponse = await $api.project.list({}, { |
||||||
headers: { |
headers: { |
||||||
'xc-auth': user.token |
"xc-auth": user.token |
||||||
} |
} |
||||||
}) |
}); |
||||||
projects.value = projectsResponse.list |
projects.value = projectsResponse.list; |
||||||
} |
}; |
||||||
|
|
||||||
const navigateToDashboard = async (project) => { |
const navigateToDashboard = async (project) => { |
||||||
await $router.push('/dashboard/' + project.id) |
await $router.push("/dashboard/" + project.id); |
||||||
} |
}; |
||||||
|
|
||||||
onMounted(async () => { |
onMounted(async () => { |
||||||
await loadProjects() |
await loadProjects(); |
||||||
}) |
}); |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped lang="scss"> |
<style scoped lang="scss"> |
||||||
.nc-container { |
//.nc-container { |
||||||
.nc-topbar { |
// .nc-topbar { |
||||||
position: fixed; |
// position: fixed; |
||||||
top: 0; |
// top: 0; |
||||||
left: 0; |
// left: 0; |
||||||
height: 50px; |
// height: 50px; |
||||||
width: 100%; |
// width: 100%; |
||||||
z-index: 5; |
// z-index: 5; |
||||||
} |
// } |
||||||
|
// |
||||||
.nc-sidebar { |
// .nc-sidebar { |
||||||
position: fixed; |
// position: fixed; |
||||||
top: 50px; |
// top: 50px; |
||||||
left: 0; |
// left: 0; |
||||||
height: calc(100% - 50px); |
// height: calc(100% - 50px); |
||||||
width: 250px; |
// width: 250px; |
||||||
} |
// } |
||||||
|
// |
||||||
.nc-content { |
// .nc-content { |
||||||
position: fixed; |
// position: fixed; |
||||||
top: 50px; |
// top: 50px; |
||||||
left: 250px; |
// left: 250px; |
||||||
height: calc(100% - 50px); |
// height: calc(100% - 50px); |
||||||
width: calc(100% - 250px); |
// width: calc(100% - 250px); |
||||||
} |
// } |
||||||
} |
//} |
||||||
</style> |
</style> |
||||||
|
@ -1,29 +1,29 @@ |
|||||||
import { defineNuxtPlugin } from "#app"; |
// import { defineNuxtPlugin } from "#app";
|
||||||
import PrimeVue from "primevue/config"; |
// import PrimeVue from "primevue/config";
|
||||||
import Button from "primevue/button"; |
// import Button from "primevue/button";
|
||||||
import InputText from "primevue/inputtext"; |
// import InputText from "primevue/inputtext";
|
||||||
import Toast from "primevue/toast"; |
// import Toast from "primevue/toast";
|
||||||
import Card from "primevue/card"; |
// import Card from "primevue/card";
|
||||||
import Sidebar from "primevue/sidebar"; |
// import Sidebar from "primevue/sidebar";
|
||||||
import Message from "primevue/message"; |
// import Message from "primevue/message";
|
||||||
import TabMenu from "primevue/tabmenu"; |
// import TabMenu from "primevue/tabmenu";
|
||||||
import DataTable from "primevue/datatable"; |
// import DataTable from "primevue/datatable";
|
||||||
import Column from "primevue/column"; |
// import Column from "primevue/column";
|
||||||
import Dropdown from "primevue/dropdown"; |
// import Dropdown from "primevue/dropdown";
|
||||||
import ToastService from "primevue/toastservice"; |
// import ToastService from "primevue/toastservice";
|
||||||
|
//
|
||||||
export default defineNuxtPlugin(nuxtApp => { |
export default defineNuxtPlugin(nuxtApp => { |
||||||
nuxtApp.vueApp.use(PrimeVue, { ripple: true }); |
// nuxtApp.vueApp.use(PrimeVue, { ripple: true });
|
||||||
nuxtApp.vueApp.use(ToastService); |
// nuxtApp.vueApp.use(ToastService);
|
||||||
nuxtApp.vueApp.component("Button", Button); |
// nuxtApp.vueApp.component("Button", Button);
|
||||||
nuxtApp.vueApp.component("InputText", InputText); |
// nuxtApp.vueApp.component("InputText", InputText);
|
||||||
nuxtApp.vueApp.component("Toast", Toast); |
// nuxtApp.vueApp.component("Toast", Toast);
|
||||||
nuxtApp.vueApp.component("Card", Card); |
// nuxtApp.vueApp.component("Card", Card);
|
||||||
nuxtApp.vueApp.component("Sidebar", Sidebar); |
// nuxtApp.vueApp.component("Sidebar", Sidebar);
|
||||||
nuxtApp.vueApp.component("Message", Message); |
// nuxtApp.vueApp.component("Message", Message);
|
||||||
nuxtApp.vueApp.component("TabMenu", TabMenu); |
// nuxtApp.vueApp.component("TabMenu", TabMenu);
|
||||||
nuxtApp.vueApp.component("DataTable", DataTable); |
// nuxtApp.vueApp.component("DataTable", DataTable);
|
||||||
nuxtApp.vueApp.component("Dropdown", Dropdown); |
// nuxtApp.vueApp.component("Dropdown", Dropdown);
|
||||||
nuxtApp.vueApp.component("Column", Column); |
// nuxtApp.vueApp.component("Column", Column);
|
||||||
//other components that you need
|
// //other components that you need
|
||||||
}); |
}); |
||||||
|
@ -1,21 +1,21 @@ |
|||||||
import { createVuetify } from 'vuetify' |
import { createVuetify } from 'vuetify' |
||||||
import { |
// import {
|
||||||
VApp, |
// VApp,
|
||||||
VAppBar, |
// VAppBar,
|
||||||
VBtn |
// VBtn
|
||||||
} from 'vuetify/components' |
// } from 'vuetify/components'
|
||||||
import {defineNuxtPlugin} from "nuxt/app"; |
import {defineNuxtPlugin} from "nuxt/app"; |
||||||
|
|
||||||
// Import everything
|
// Import everything
|
||||||
// import * as components from 'vuetify/components'
|
import * as components from 'vuetify/components' |
||||||
|
|
||||||
export default defineNuxtPlugin((nuxtApp) => { |
export default defineNuxtPlugin((nuxtApp) => { |
||||||
// const vuetify = createVuetify({
|
const vuetify = createVuetify({ |
||||||
// components/*: {
|
components/*: { |
||||||
// VApp,
|
VApp, |
||||||
// VAppBar,
|
VAppBar, |
||||||
// VBtn*/
|
VBtn*/ |
||||||
// // }
|
// }
|
||||||
// })
|
}) |
||||||
// nuxtApp.vueApp.use(vuetify)
|
nuxtApp.vueApp.use(vuetify) |
||||||
}) |
}) |
||||||
|
Loading…
Reference in new issue