Browse Source

feat(gui-v2): add sponsors

pull/3130/head
Wing-Kam Wong 2 years ago
parent
commit
1023854ac4
  1. 47
      packages/nc-gui-v2/components/general/Sponsors.vue
  2. 193
      packages/nc-gui-v2/pages/index/index.vue

47
packages/nc-gui-v2/components/general/Sponsors.vue

@ -1,37 +1,36 @@
<script lang="ts" setup> <script lang="ts" setup>
import MdiHeartsCard from '~icons/mdi/cards-heart'
interface Props { interface Props {
nav?: boolean nav?: boolean
img?: boolean
} }
const { nav = false, img = true } = defineProps<Props>() const { nav = false } = defineProps<Props>()
</script> </script>
<template> <template>
<v-card :rounded="0" class="dark:bg-gray-900" href="https://github.com/sponsors/nocodb" target="_blank"> <a-card class="w-[300px] ma-10 shadow-lg rounded-lg" href="https://github.com/sponsors/nocodb" target="_blank">
<v-img v-if="img" src="/ants-leaf-cutter.jpeg" :cover="true" :aspect-ratio="1" :height="nav ? 80 : ''" /> <template #cover>
<img class="max-h-[180px]" alt="cover" src="/ants-leaf-cutter.jpeg" />
</template>
<v-card-title v-if="!nav" class="pb-2"> <a-card-meta>
{{ $t('msg.info.sponsor.header') }} <template #title>
</v-card-title> <span v-if="!nav" class="text-xl pb-4">
{{ $t('msg.info.sponsor.header') }}
</span>
</template>
</a-card-meta>
<v-card-text v-if="!nav" class="pb-0"> <div v-if="!nav" class="py-5 text-sm">
{{ $t('msg.info.sponsor.message') }} {{ $t('msg.info.sponsor.message') }}
</v-card-text> </div>
<v-card-actions class="justify-center"> <div class="flex justify-center">
<v-btn color="primary" class="dark:(!text-white)"> <a-button class="!shadow" size="large">
<MdiHeartsCard class="text-red-500 mr-2" /> <div class="flex items-center">
{{ $t('activity.sponsorUs') }} <mdi-cards-heart class="text-red-500 mr-2" />
</v-btn> {{ $t('activity.sponsorUs') }}
</v-card-actions> </div>
</v-card> </a-button>
</div>
</a-card>
</template> </template>
<style>
a img {
margin: 0 !important;
}
</style>

193
packages/nc-gui-v2/pages/index/index.vue

@ -58,97 +58,108 @@ onMounted(() => {
<template> <template>
<NuxtLayout> <NuxtLayout>
<a-card class="mx-auto mt-10 !max-w-[600px] shadow-lg"> <a-row>
<h1 class="text-center text-4xl pa-2 nc-project-page-title flex align-center justify-center gap-2 text-gray-600"> <a-col :span="8"></a-col>
<!-- My Projects --> <a-col :span="8" class="!bg-red">
<b>{{ $t('title.myProject') }}</b> <a-card class="mx-auto mt-10 !max-w-[600px] shadow-lg">
<h1 class="text-center text-4xl pa-2 nc-project-page-title flex align-center justify-center gap-2 text-gray-600">
<MdiRefresh <!-- My Projects -->
v-t="['a:project:refresh']" <b>{{ $t('title.myProject') }}</b>
class="text-sm text-gray-500 hover:text-primary mt-1 cursor-pointer"
@click="loadProjects" <MdiRefresh
></MdiRefresh> v-t="['a:project:refresh']"
</h1> class="text-sm text-gray-500 hover:text-primary mt-1 cursor-pointer"
@click="loadProjects"
<div class="flex mb-6"> ></MdiRefresh>
<a-input-search </h1>
v-model:value="filterQuery"
class="max-w-[200px] nc-project-page-search" <div class="flex mb-6">
:placeholder="$t('activity.searchProject')" <a-input-search
></a-input-search> v-model:value="filterQuery"
<div class="flex-grow"></div> class="max-w-[200px] nc-project-page-search"
:placeholder="$t('activity.searchProject')"
<a-dropdown @click.stop> ></a-input-search>
<a-button class="nc-new-project-menu !shadow"> <div class="flex-grow"></div>
<div class="flex align-center">
{{ $t('title.newProj') }} <a-dropdown @click.stop>
<MdiMenuDown class="menu-icon" /> <a-button class="nc-new-project-menu !shadow">
</div> <div class="flex align-center">
</a-button> {{ $t('title.newProj') }}
<MdiMenuDown class="menu-icon" />
<template #overlay> </div>
<a-menu> </a-button>
<div
v-t="['c:project:create:xcdb']" <template #overlay>
class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2 nc-create-xc-db-project" <a-menu>
@click="navigateTo('/project/create')" <div
> v-t="['c:project:create:xcdb']"
<MdiPlus class="col-span-2 mr-1 mt-[1px] text-primary text-lg" /> class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2 nc-create-xc-db-project"
<div class="col-span-10 text-sm xl:text-md">{{ $t('activity.createProject') }}</div> @click="navigateTo('/project/create')"
</div> >
<div <MdiPlus class="col-span-2 mr-1 mt-[1px] text-primary text-lg" />
v-t="['c:project:create:extdb']" <div class="col-span-10 text-sm xl:text-md">{{ $t('activity.createProject') }}</div>
class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2 nc-create-external-db-project" </div>
@click="navigateTo('/project/create-external')" <div
> v-t="['c:project:create:extdb']"
<MdiDatabaseOutline class="col-span-2 mr-1 mt-[1px] text-green-500 text-lg" /> class="grid grid-cols-12 cursor-pointer hover:bg-gray-200 flex items-center p-2 nc-create-external-db-project"
<div class="col-span-10 text-sm xl:text-md" v-html="$t('activity.createProjectExtended.extDB')" /> @click="navigateTo('/project/create-external')"
</div> >
</a-menu> <MdiDatabaseOutline class="col-span-2 mr-1 mt-[1px] text-green-500 text-lg" />
</template> <div class="col-span-10 text-sm xl:text-md" v-html="$t('activity.createProjectExtended.extDB')" />
</a-dropdown> </div>
</div> </a-menu>
</template>
<div v-if="isLoading"> </a-dropdown>
<a-skeleton /> </div>
</div>
<div v-if="isLoading">
<a-table <a-skeleton />
v-else </div>
:custom-row="
(record) => ({ <a-table
onClick: () => { v-else
$e('a:project:open') :custom-row="
navigateTo(`/nc/${record.id}`) (record) => ({
}, onClick: () => {
}) $e('a:project:open')
" navigateTo(`/nc/${record.id}`)
:data-source="filteredProjects" },
:pagination="{ position: ['bottomCenter'] }" })
> "
<!-- Title --> :data-source="filteredProjects"
<a-table-column key="title" :title="$t('general.title')" data-index="title"> :pagination="{ position: ['bottomCenter'] }"
<template #default="{ text }"> >
<div class="capitalize !w-[400px] overflow-hidden overflow-ellipsis whitespace-nowrap nc-project-row" :title="text"> <!-- Title -->
{{ text }} <a-table-column key="title" :title="$t('general.title')" data-index="title">
</div> <template #default="{ text }">
</template> <div
</a-table-column> class="capitalize !w-[400px] overflow-hidden overflow-ellipsis whitespace-nowrap nc-project-row"
<!-- Actions --> :title="text"
<a-table-column key="id" :title="$t('labels.actions')" data-index="id"> >
<template #default="{ text, record }"> {{ text }}
<div class="flex align-center"> </div>
<MdiEditOutline </template>
v-t="['c:project:edit:rename']" </a-table-column>
class="nc-action-btn" <!-- Actions -->
@click.stop="navigateTo(`/project/${text}`)" <a-table-column key="id" :title="$t('labels.actions')" data-index="id">
/> <template #default="{ text, record }">
<MdiDeleteOutline class="nc-action-btn" @click.stop="deleteProject(record)" /> <div class="flex align-center">
</div> <MdiEditOutline
</template> v-t="['c:project:edit:rename']"
</a-table-column> class="nc-action-btn"
</a-table> @click.stop="navigateTo(`/project/${text}`)"
</a-card> />
<MdiDeleteOutline class="nc-action-btn" @click.stop="deleteProject(record)" />
</div>
</template>
</a-table-column>
</a-table>
</a-card>
</a-col>
<a-col :span="8" class="col-sm-12 col-lg-3 d-sm-none d-md-flex justify-center justify-lg-end align-start">
<GeneralSponsors />
</a-col>
</a-row>
</NuxtLayout> </NuxtLayout>
</template> </template>

Loading…
Cancel
Save