diff --git a/examples/sites/package.json b/examples/sites/package.json index 5956602b10..49eebbf846 100644 --- a/examples/sites/package.json +++ b/examples/sites/package.json @@ -1,7 +1,7 @@ { "name": "@opentiny/vue-docs", "type": "module", - "version": "3.24.0", + "version": "3.24.3", "license": "MIT", "scripts": { "start": "vite", @@ -27,8 +27,7 @@ "@docsearch/css": "^3.8.0", "@docsearch/js": "^3.8.0", "@docsearch/react": "npm:@docsearch/css", - "@opentiny/next": "0.1.2", - "@opentiny/next-vue": "0.0.1-alpha.1", + "@opentiny/next-vue": "0.0.1", "@opentiny/tiny-robot": "0.2.1", "@opentiny/tiny-robot-kit": "0.2.1", "@opentiny/tiny-robot-svgs": "0.2.1", diff --git a/examples/sites/src/App.vue b/examples/sites/src/App.vue index 22969fc421..c9f43ba785 100644 --- a/examples/sites/src/App.vue +++ b/examples/sites/src/App.vue @@ -17,7 +17,7 @@ import { iconClose } from '@opentiny/vue-icon' import { appData } from './tools' import useTheme from './tools/useTheme' import { useNextClient } from '@opentiny/next-vue' -import { globalConversation } from './composable/utils' +import { globalConversation, $session } from './composable/utils' export default defineComponent({ name: 'AppVue', @@ -33,7 +33,7 @@ export default defineComponent({ const { sessionId } = useNextClient({ clientInfo: { name: 'tiny-vue-website', version: '1.0.0' }, - proxyOptions: { url: 'https://39.108.160.245/sse', token: '' } + proxyOptions: { url: 'https://agent.icjs.ink/sse', token: '', sessionId: $session.sessionId } }) watch( diff --git a/examples/sites/src/components/MessageCard.vue b/examples/sites/src/components/MessageCard.vue new file mode 100644 index 0000000000..503704abff --- /dev/null +++ b/examples/sites/src/components/MessageCard.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/examples/sites/src/composable/utils.ts b/examples/sites/src/composable/utils.ts index 217bcfc3aa..82453888a2 100644 --- a/examples/sites/src/composable/utils.ts +++ b/examples/sites/src/composable/utils.ts @@ -5,16 +5,16 @@ import type { ChatMessage, ChatCompletionResponse, StreamHandler } from '@opentiny/tiny-robot-kit' import type { ChatCompletionRequest } from '@opentiny/tiny-robot-kit' -import { ref, type Ref } from 'vue' +import { ref, reactive, type Ref } from 'vue' -export { $local } from './storage' +export { $local, $session } from './storage' export const showTinyRobot = ref(true) -export const globalConversation = { +export const globalConversation = reactive({ id: '', sessionId: '' -} +}) /** * 处理SSE流式响应 * @param response fetch响应对象 diff --git a/examples/sites/src/router.js b/examples/sites/src/router.js index 9b471c4a94..c438df9d23 100644 --- a/examples/sites/src/router.js +++ b/examples/sites/src/router.js @@ -8,6 +8,7 @@ const Docs = () => import('@/views/docs/docs.vue') const Overview = () => import('@/views/overview.vue') const Features = () => import('@/views/features.vue') const Comprehensive = () => import('@/views/comprehensive/index.vue') +const Remoter = () => import('@/views/remoter/index.vue') const context = import.meta.env.VITE_CONTEXT @@ -24,6 +25,11 @@ let routes = [ component: Comprehensive, name: 'comprehensive' }, + { + path: `${context}:all?/zh-CN/:theme/remoter`, + component: Remoter, + name: 'remoter' + }, // 文档 { path: `${context}:all?/:lang/:theme/docs/:docId`, diff --git a/examples/sites/src/views/comprehensive/index.vue b/examples/sites/src/views/comprehensive/index.vue index 310d78cc59..289b88157b 100644 --- a/examples/sites/src/views/comprehensive/index.vue +++ b/examples/sites/src/views/comprehensive/index.vue @@ -96,7 +96,7 @@ watch( const encryptedId = CryptoJS.AES.encrypt(newVal, 'secret-session-id').toString() const secretId = encodeURIComponent(encryptedId) - sessionUrl.value = 'http://39.108.160.245?id=' + secretId + sessionUrl.value = `https://agent.icjs.ink?id=${secretId}` } }, { immediate: true } @@ -202,9 +202,7 @@ watch( border-radius: 12px; padding: 32px; width: 460px; - box-shadow: - 0 20px 25px -5px rgba(0, 0, 0, 0.1), - 0 10px 10px -5px rgba(0, 0, 0, 0.04); + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); } .qr-modal-header { @@ -267,22 +265,13 @@ watch( @keyframes glow { 0% { - box-shadow: - 0 0 5px rgba(22, 119, 255, 0.2), - 0 0 10px rgba(22, 119, 255, 0.2), - 0 0 15px rgba(22, 119, 255, 0.2); + box-shadow: 0 0 5px rgba(22, 119, 255, 0.2), 0 0 10px rgba(22, 119, 255, 0.2), 0 0 15px rgba(22, 119, 255, 0.2); } 50% { - box-shadow: - 0 0 10px rgba(22, 119, 255, 0.3), - 0 0 20px rgba(22, 119, 255, 0.3), - 0 0 30px rgba(22, 119, 255, 0.3); + box-shadow: 0 0 10px rgba(22, 119, 255, 0.3), 0 0 20px rgba(22, 119, 255, 0.3), 0 0 30px rgba(22, 119, 255, 0.3); } 100% { - box-shadow: - 0 0 5px rgba(22, 119, 255, 0.2), - 0 0 10px rgba(22, 119, 255, 0.2), - 0 0 15px rgba(22, 119, 255, 0.2); + box-shadow: 0 0 5px rgba(22, 119, 255, 0.2), 0 0 10px rgba(22, 119, 255, 0.2), 0 0 15px rgba(22, 119, 255, 0.2); } } diff --git a/examples/sites/src/views/remoter/index.vue b/examples/sites/src/views/remoter/index.vue new file mode 100644 index 0000000000..61af1798a2 --- /dev/null +++ b/examples/sites/src/views/remoter/index.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/examples/sites/src/views/remoter/sound.vue b/examples/sites/src/views/remoter/sound.vue new file mode 100644 index 0000000000..d9a7b17718 --- /dev/null +++ b/examples/sites/src/views/remoter/sound.vue @@ -0,0 +1,349 @@ + + + + +