forked from Chanzhaoyu/chatgpt-web
-
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
72df35c
commit 39f718e
Showing
15 changed files
with
192 additions
and
76 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 |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
"OPENAI", | ||
"pinia", | ||
"rushstack", | ||
"Sider", | ||
"tailwindcss", | ||
"unplugin", | ||
"VITE", | ||
|
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,13 +1,12 @@ | ||
<script setup lang="ts"> | ||
import { GithubSite, NaiveProvider } from '@/components' | ||
import { NaiveProvider } from '@/components/common' | ||
import Chat from '@/views/Chat/index.vue' | ||
</script> | ||
|
||
<template> | ||
<NaiveProvider> | ||
<div class="h-full overflow-hidden pb-[50px] p-4"> | ||
<div class="h-full p-4 overflow-hidden"> | ||
<Chat /> | ||
<GithubSite /> | ||
</div> | ||
</NaiveProvider> | ||
</template> |
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,20 @@ | ||
<script setup lang='ts'> | ||
interface Emit { | ||
(e: 'click'): void | ||
} | ||
const emit = defineEmits<Emit>() | ||
function handleClick() { | ||
emit('click') | ||
} | ||
</script> | ||
|
||
<template> | ||
<button | ||
class="flex items-center justify-center w-10 h-10 transition rounded-full hover:bg-neutral-100" | ||
@click="handleClick" | ||
> | ||
<slot /> | ||
</button> | ||
</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,46 @@ | ||
<script setup lang='ts'> | ||
import { computed } from 'vue' | ||
import type { PopoverPlacement } from 'naive-ui' | ||
import { NTooltip } from 'naive-ui' | ||
import Button from './Button.vue' | ||
interface Props { | ||
tooltip?: string | ||
placement?: PopoverPlacement | ||
} | ||
interface Emit { | ||
(e: 'click'): void | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
tooltip: '', | ||
placement: 'bottom', | ||
}) | ||
const emit = defineEmits<Emit>() | ||
const showTooltip = computed(() => Boolean(props.tooltip)) | ||
function handleClick() { | ||
emit('click') | ||
} | ||
</script> | ||
|
||
<template> | ||
<div v-if="showTooltip"> | ||
<NTooltip :placement="placement" trigger="hover"> | ||
<template #trigger> | ||
<Button @click="handleClick"> | ||
<slot /> | ||
</Button> | ||
</template> | ||
{{ tooltip }} | ||
</NTooltip> | ||
</div> | ||
<div v-else> | ||
<Button @click="handleClick"> | ||
<slot /> | ||
</Button> | ||
</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,46 @@ | ||
<script setup lang="ts"> | ||
import { defineComponent, h } from 'vue' | ||
import { | ||
NConfigProvider, | ||
NDialogProvider, | ||
NLoadingBarProvider, | ||
NMessageProvider, | ||
NNotificationProvider, | ||
useDialog, | ||
useLoadingBar, | ||
useMessage, | ||
useNotification, | ||
} from 'naive-ui' | ||
function registerNaiveTools() { | ||
window.$loadingBar = useLoadingBar() | ||
window.$dialog = useDialog() | ||
window.$message = useMessage() | ||
window.$notification = useNotification() | ||
} | ||
const NaiveProviderContent = defineComponent({ | ||
name: 'NaiveProviderContent', | ||
setup() { | ||
registerNaiveTools() | ||
}, | ||
render() { | ||
return h('div') | ||
}, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<NConfigProvider class="h-full"> | ||
<NLoadingBarProvider> | ||
<NDialogProvider> | ||
<NNotificationProvider> | ||
<NMessageProvider> | ||
<slot /> | ||
<NaiveProviderContent /> | ||
</NMessageProvider> | ||
</NNotificationProvider> | ||
</NDialogProvider> | ||
</NLoadingBarProvider> | ||
</NConfigProvider> | ||
</template> |
File renamed without changes.
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,5 @@ | ||
import HoverButton from './HoverButton/index.vue' | ||
import NaiveProvider from './NaiveProvider.vue' | ||
import SvgIcon from './SvgIcon.vue' | ||
|
||
export { HoverButton, NaiveProvider, SvgIcon } |
File renamed without changes.
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,3 @@ | ||
import GithubSite from './GithubSite.vue' | ||
|
||
export { GithubSite } |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
interface Window { | ||
$loadingBar?: import('naive-ui').LoadingBarProviderInst; | ||
$dialog?: import('naive-ui').DialogProviderInst; | ||
$message?: import('naive-ui').MessageProviderInst; | ||
$notification?: import('naive-ui').NotificationProviderInst; | ||
} |
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,27 @@ | ||
<script setup lang='ts'> | ||
import { NLayout, NLayoutContent, NLayoutSider } from 'naive-ui' | ||
</script> | ||
|
||
<template> | ||
<div class="h-full overflow-hidden border rounded-md shadow-md"> | ||
<NLayout class="h-full" has-sider> | ||
<NLayoutSider | ||
collapse-mode="width" | ||
:collapsed-width="120" | ||
:width="240" | ||
show-trigger="arrow-circle" | ||
class="p-4" | ||
bordered | ||
> | ||
<span>Sider</span> | ||
</NLayoutSider> | ||
<NLayoutContent class="h-full"> | ||
<slot /> | ||
</NLayoutContent> | ||
</NLayout> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Layout from './Layout.vue' | ||
|
||
export { Layout } |