ソースを参照

add copyright info

tycoding 1 年間 前
コミット
17e807f46d
100 ファイル変更1780 行追加179 行削除
  1. 24 8
      langchat-ui-client/src/App.vue
  2. 16 0
      langchat-ui-client/src/api/auth.ts
  3. 16 0
      langchat-ui-client/src/api/chat.ts
  4. 16 0
      langchat-ui-client/src/api/conversation.ts
  5. 16 0
      langchat-ui-client/src/api/docs.ts
  6. 16 0
      langchat-ui-client/src/api/models/index.d.ts
  7. 17 1
      langchat-ui-client/src/components/common/HoverButton/Button.vue
  8. 17 1
      langchat-ui-client/src/components/common/HoverButton/index.vue
  9. 17 1
      langchat-ui-client/src/components/common/NaiveProvider/index.vue
  10. 17 1
      langchat-ui-client/src/components/common/SvgIcon/index.vue
  11. 16 0
      langchat-ui-client/src/components/common/index.ts
  12. 16 0
      langchat-ui-client/src/hooks/useBasicLayout.ts
  13. 16 0
      langchat-ui-client/src/hooks/useIconRender.ts
  14. 16 0
      langchat-ui-client/src/hooks/useLanguage.ts
  15. 17 1
      langchat-ui-client/src/hooks/useTheme.ts
  16. 16 0
      langchat-ui-client/src/icons/403.vue
  17. 16 0
      langchat-ui-client/src/icons/404.svg
  18. 16 0
      langchat-ui-client/src/icons/500.vue
  19. 16 0
      langchat-ui-client/src/layout/Sider.vue
  20. 16 0
      langchat-ui-client/src/layout/index.ts
  21. 21 5
      langchat-ui-client/src/layout/index.vue
  22. 16 0
      langchat-ui-client/src/locales/en-US.ts
  23. 16 0
      langchat-ui-client/src/locales/index.ts
  24. 16 0
      langchat-ui-client/src/locales/zh-CN.ts
  25. 16 0
      langchat-ui-client/src/main.ts
  26. 16 0
      langchat-ui-client/src/plugins/assets.ts
  27. 16 0
      langchat-ui-client/src/plugins/index.ts
  28. 82 66
      langchat-ui-client/src/plugins/naive.ts
  29. 16 0
      langchat-ui-client/src/plugins/scrollbarStyle.ts
  30. 16 0
      langchat-ui-client/src/router/index.ts
  31. 16 0
      langchat-ui-client/src/router/permission.ts
  32. 16 0
      langchat-ui-client/src/store/helper.ts
  33. 16 0
      langchat-ui-client/src/store/index.ts
  34. 16 0
      langchat-ui-client/src/store/modules/app/helper.ts
  35. 16 0
      langchat-ui-client/src/store/modules/app/index.ts
  36. 16 0
      langchat-ui-client/src/store/modules/auth/helper.ts
  37. 17 0
      langchat-ui-client/src/store/modules/auth/index.ts
  38. 16 0
      langchat-ui-client/src/store/modules/index.ts
  39. 16 0
      langchat-ui-client/src/store/modules/settings/helper.ts
  40. 16 0
      langchat-ui-client/src/store/modules/settings/index.ts
  41. 16 0
      langchat-ui-client/src/store/modules/user/index.ts
  42. 16 0
      langchat-ui-client/src/styles/global.less
  43. 16 0
      langchat-ui-client/src/styles/lib/github-markdown.less
  44. 16 0
      langchat-ui-client/src/styles/lib/highlight.less
  45. 16 0
      langchat-ui-client/src/styles/lib/tailwind.css
  46. 16 0
      langchat-ui-client/src/styles/login.less
  47. 16 0
      langchat-ui-client/src/typings/chat.d.ts
  48. 16 0
      langchat-ui-client/src/typings/env.d.ts
  49. 16 0
      langchat-ui-client/src/typings/global.d.ts
  50. 16 0
      langchat-ui-client/src/utils/copy.ts
  51. 16 0
      langchat-ui-client/src/utils/dateUtil.ts
  52. 16 0
      langchat-ui-client/src/utils/debounce.ts
  53. 16 0
      langchat-ui-client/src/utils/downloadFile.ts
  54. 16 0
      langchat-ui-client/src/utils/functions/debounce.ts
  55. 16 0
      langchat-ui-client/src/utils/functions/index.ts
  56. 16 0
      langchat-ui-client/src/utils/is/index.ts
  57. 16 0
      langchat-ui-client/src/utils/request/axios.ts
  58. 16 0
      langchat-ui-client/src/utils/request/index.ts
  59. 16 0
      langchat-ui-client/src/utils/storage/index.ts
  60. 17 1
      langchat-ui-client/src/views/exception/404/index.vue
  61. 16 0
      langchat-ui-client/src/views/exception/500/index.vue
  62. 16 0
      langchat-ui-client/src/views/login/EmailRegister.vue
  63. 16 0
      langchat-ui-client/src/views/login/Forget.vue
  64. 16 0
      langchat-ui-client/src/views/login/Login.vue
  65. 16 0
      langchat-ui-client/src/views/login/PhoneLogin.vue
  66. 16 0
      langchat-ui-client/src/views/login/PhoneRegister.vue
  67. 16 0
      langchat-ui-client/src/views/login/data.ts
  68. 30 14
      langchat-ui-client/src/views/login/index.vue
  69. 19 3
      langchat-ui-client/src/views/modules/chart/components/ChartConfig.vue
  70. 17 1
      langchat-ui-client/src/views/modules/chart/components/ChartData.vue
  71. 18 2
      langchat-ui-client/src/views/modules/chart/components/ChartExport.vue
  72. 20 4
      langchat-ui-client/src/views/modules/chart/components/ChartSelect.vue
  73. 39 23
      langchat-ui-client/src/views/modules/chart/components/component/BaseConfig.vue
  74. 22 6
      langchat-ui-client/src/views/modules/chart/components/component/CodeConfig.vue
  75. 26 10
      langchat-ui-client/src/views/modules/chart/components/component/LineConfig.vue
  76. 22 6
      langchat-ui-client/src/views/modules/chart/components/component/PieConfig.vue
  77. 22 6
      langchat-ui-client/src/views/modules/chart/index.vue
  78. 16 0
      langchat-ui-client/src/views/modules/chart/store/index.ts
  79. 16 0
      langchat-ui-client/src/views/modules/chat/Header.vue
  80. 16 0
      langchat-ui-client/src/views/modules/chat/index.vue
  81. 20 4
      langchat-ui-client/src/views/modules/chat/message/Avatar.vue
  82. 17 1
      langchat-ui-client/src/views/modules/chat/message/Message.vue
  83. 16 0
      langchat-ui-client/src/views/modules/chat/message/TextComponent.vue
  84. 16 0
      langchat-ui-client/src/views/modules/chat/message/styles/github-markdown.less
  85. 16 0
      langchat-ui-client/src/views/modules/chat/message/styles/highlight.less
  86. 16 0
      langchat-ui-client/src/views/modules/chat/message/styles/index.less
  87. 16 0
      langchat-ui-client/src/views/modules/chat/message/styles/style.less
  88. 19 3
      langchat-ui-client/src/views/modules/chat/sider/List.vue
  89. 24 8
      langchat-ui-client/src/views/modules/chat/sider/index.vue
  90. 16 0
      langchat-ui-client/src/views/modules/chat/store/chat.d.ts
  91. 16 0
      langchat-ui-client/src/views/modules/chat/store/useBasicLayout.ts
  92. 16 0
      langchat-ui-client/src/views/modules/chat/store/useChatStore.ts
  93. 16 0
      langchat-ui-client/src/views/modules/chat/store/useIconRender.ts
  94. 16 0
      langchat-ui-client/src/views/modules/chat/store/useScroll.ts
  95. 16 0
      langchat-ui-client/src/views/modules/common/ModelProvider.vue
  96. 16 0
      langchat-ui-client/src/views/modules/common/data.ts
  97. 16 0
      langchat-ui-client/src/views/modules/doc/components/Chat.vue
  98. 16 0
      langchat-ui-client/src/views/modules/doc/components/FileList.vue
  99. 19 3
      langchat-ui-client/src/views/modules/doc/components/FileView.vue
  100. 16 0
      langchat-ui-client/src/views/modules/doc/components/Message.vue

+ 24 - 8
langchat-ui-client/src/App.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { NaiveProvider } from '@/components/common';
   import { useTheme } from '@/hooks/useTheme';
   import { useLanguage } from '@/hooks/useLanguage';
@@ -11,10 +27,10 @@
 
 <template>
   <n-config-provider
-    class="h-full w-full"
+    :locale="language"
     :theme="theme"
     :theme-overrides="themeOverrides"
-    :locale="language"
+    class="h-full w-full"
   >
     <NaiveProvider>
       <RouterView />
@@ -24,15 +40,15 @@
   <NWatermark
     v-if="waterMark !== ''"
     :content="waterMark"
-    cross
-    fullscreen
-    :z-index="9999"
     :font-size="14"
+    :height="384"
     :line-height="10"
+    :rotate="-20"
     :width="284"
-    :height="384"
     :x-offset="22"
     :y-offset="100"
-    :rotate="-20"
+    :z-index="9999"
+    cross
+    fullscreen
   />
 </template>

+ 16 - 0
langchat-ui-client/src/api/auth.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { http } from '@/utils/request';
 import { TokenInfo, User } from '@/api/models';
 

+ 16 - 0
langchat-ui-client/src/api/chat.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { http } from '@/utils/request';
 import { ChatR } from '@/api/models';
 import { AxiosProgressEvent } from 'axios';

+ 16 - 0
langchat-ui-client/src/api/conversation.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { http } from '@/utils/request';
 
 export function page(params: any) {

+ 16 - 0
langchat-ui-client/src/api/docs.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { http } from '@/utils/request';
 import { AxiosProgressEvent } from 'axios';
 

+ 16 - 0
langchat-ui-client/src/api/models/index.d.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export type TokenInfo = {
   token?: string;
   expires?: number;

+ 17 - 1
langchat-ui-client/src/components/common/HoverButton/Button.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   interface Emit {
     (e: 'click'): void;
   }

+ 17 - 1
langchat-ui-client/src/components/common/HoverButton/index.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { computed } from 'vue';
   import type { PopoverPlacement } from 'naive-ui';
   import { NTooltip } from 'naive-ui';

+ 17 - 1
langchat-ui-client/src/components/common/NaiveProvider/index.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { defineComponent, h } from 'vue';
   import {
     NDialogProvider,

+ 17 - 1
langchat-ui-client/src/components/common/SvgIcon/index.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { computed, useAttrs } from 'vue';
   import { Icon } from '@iconify/vue';
 

+ 16 - 0
langchat-ui-client/src/components/common/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import HoverButton from './HoverButton/index.vue';
 import NaiveProvider from './NaiveProvider/index.vue';
 import SvgIcon from './SvgIcon/index.vue';

+ 16 - 0
langchat-ui-client/src/hooks/useBasicLayout.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
 
 export function useBasicLayout() {

+ 16 - 0
langchat-ui-client/src/hooks/useIconRender.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { h } from 'vue';
 import { SvgIcon } from '@/components/common';
 

+ 16 - 0
langchat-ui-client/src/hooks/useLanguage.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { computed } from 'vue';
 import { enUS, koKR, zhCN, zhTW } from 'naive-ui';
 import { useAppStore } from '@/store';

+ 17 - 1
langchat-ui-client/src/hooks/useTheme.ts

@@ -1,6 +1,22 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { GlobalThemeOverrides } from 'naive-ui';
-import { computed, watch } from 'vue';
 import { darkTheme, useOsTheme } from 'naive-ui';
+import { computed, watch } from 'vue';
 import { useAppStore } from '@/store';
 
 export function useTheme() {

ファイルの差分が大きいため隠しています
+ 16 - 0
langchat-ui-client/src/icons/403.vue


ファイルの差分が大きいため隠しています
+ 16 - 0
langchat-ui-client/src/icons/404.svg


ファイルの差分が大きいため隠しています
+ 16 - 0
langchat-ui-client/src/icons/500.vue


+ 16 - 0
langchat-ui-client/src/layout/Sider.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { computed } from 'vue';

+ 16 - 0
langchat-ui-client/src/layout/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import Layout from './index.vue';
 
 export { Layout };

+ 21 - 5
langchat-ui-client/src/layout/index.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import Sider from './Sider.vue';
   import { onMounted, ref, watch } from 'vue';
   import { useBasicLayout } from '@/hooks/useBasicLayout';
@@ -15,13 +31,13 @@
 </script>
 
 <template>
-  <n-layout has-sider class="h-full">
+  <n-layout class="h-full" has-sider>
     <n-layout-sider
-      bordered
-      collapse-mode="width"
+      :collapsed="collapsed"
       :collapsed-width="0"
       :width="77"
-      :collapsed="collapsed"
+      bordered
+      collapse-mode="width"
       show-trigger="bar"
       @collapse="collapsed = true"
       @expand="collapsed = false"

+ 16 - 0
langchat-ui-client/src/locales/en-US.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export default {
   common: {
     add: 'Add',

+ 16 - 0
langchat-ui-client/src/locales/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { App } from 'vue';
 import { createI18n } from 'vue-i18n';
 import enUS from './en-US';

+ 16 - 0
langchat-ui-client/src/locales/zh-CN.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export default {
   app: 'Lang Chat',
   common: {

+ 16 - 0
langchat-ui-client/src/main.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { createApp } from 'vue';
 import App from './App.vue';
 import { setupI18n } from './locales';

+ 16 - 0
langchat-ui-client/src/plugins/assets.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import 'katex/dist/katex.min.css';
 import '@/styles/lib/tailwind.css';
 import '@/styles/lib/highlight.less';

+ 16 - 0
langchat-ui-client/src/plugins/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import setupAssets from './assets';
 import setupScrollbarStyle from './scrollbarStyle';
 

+ 82 - 66
langchat-ui-client/src/plugins/naive.ts

@@ -1,89 +1,105 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { App } from 'vue';
 import {
   create,
-  NMessageProvider,
-  NDialogProvider,
-  NConfigProvider,
-  NInput,
-  NButton,
-  NForm,
-  NFormItem,
-  NCheckboxGroup,
-  NCheckbox,
-  NIcon,
-  NLayout,
-  NLayoutHeader,
-  NLayoutContent,
-  NLayoutFooter,
-  NLayoutSider,
-  NMenu,
+  NAlert,
+  NAutoComplete,
+  NAvatar,
+  NBackTop,
+  NBadge,
   NBreadcrumb,
   NBreadcrumbItem,
-  NDropdown,
-  NSpace,
-  NTooltip,
-  NAvatar,
-  NTabs,
-  NTab,
-  NTabPane,
+  NButton,
   NCard,
-  NRow,
+  NCascader,
+  NCheckbox,
+  NCheckboxGroup,
   NCol,
+  NCollapse,
+  NCollapseItem,
+  NColorPicker,
+  NConfigProvider,
+  NCountdown,
+  NDataTable,
+  NDatePicker,
+  NDescriptions,
+  NDescriptionsItem,
+  NDialogProvider,
+  NDivider,
   NDrawer,
   NDrawerContent,
-  NDivider,
-  NSwitch,
-  NBadge,
-  NAlert,
+  NDropdown,
   NElement,
-  NTag,
-  NNotificationProvider,
-  NProgress,
-  NDatePicker,
+  NEllipsis,
+  NEmpty,
+  NForm,
+  NFormItem,
+  NGradientText,
   NGrid,
   NGridItem,
+  NIcon,
+  NInput,
+  NInputGroup,
+  NInputNumber,
+  NLayout,
+  NLayoutContent,
+  NLayoutFooter,
+  NLayoutHeader,
+  NLayoutSider,
   NList,
   NListItem,
-  NThing,
-  NDataTable,
-  NPopover,
+  NLoadingBarProvider,
+  NMenu,
+  NMessageProvider,
+  NModal,
+  NNotificationProvider,
+  NP,
   NPagination,
-  NSelect,
-  NRadioGroup,
+  NPopconfirm,
+  NPopover,
+  NPopselect,
+  NProgress,
   NRadio,
-  NSteps,
-  NStep,
-  NInputGroup,
+  NRadioGroup,
   NResult,
-  NDescriptions,
-  NDescriptionsItem,
-  NTable,
-  NInputNumber,
-  NLoadingBarProvider,
-  NModal,
-  NUpload,
-  NUploadDragger,
-  NTree,
-  NSpin,
-  NTimePicker,
-  NBackTop,
+  NRow,
+  NScrollbar,
+  NSelect,
   NSkeleton,
-  NCascader,
-  NGradientText,
-  NEllipsis,
   NSlider,
-  NPopconfirm,
-  NScrollbar,
-  NAutoComplete,
-  NCountdown,
-  NText,
-  NP,
-  NCollapse,
-  NCollapseItem,
-  NColorPicker,
-  NEmpty,
-  NPopselect,
+  NSpace,
+  NSpin,
   NSplit,
+  NStep,
+  NSteps,
+  NSwitch,
+  NTab,
+  NTable,
+  NTabPane,
+  NTabs,
+  NTag,
+  NText,
+  NThing,
+  NTimePicker,
+  NTooltip,
+  NTree,
+  NUpload,
+  NUploadDragger,
 } from 'naive-ui';
 
 // https://www.naiveui.com/en-US/os-theme/docs/import-on-demand

+ 16 - 0
langchat-ui-client/src/plugins/scrollbarStyle.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { darkTheme, lightTheme } from 'naive-ui';
 
 const setupScrollbarStyle = () => {

+ 16 - 0
langchat-ui-client/src/router/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { App } from 'vue';
 import type { RouteRecordRaw } from 'vue-router';
 import { createRouter, createWebHashHistory } from 'vue-router';

+ 16 - 0
langchat-ui-client/src/router/permission.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { Router } from 'vue-router';
 import { useAuthStoreWithout } from '@/store/modules/auth';
 

+ 16 - 0
langchat-ui-client/src/store/helper.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { createPinia } from 'pinia';
 
 export const store = createPinia();

+ 16 - 0
langchat-ui-client/src/store/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { App } from 'vue';
 import { store } from './helper';
 

+ 16 - 0
langchat-ui-client/src/store/modules/app/helper.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { storage } from '@/utils/storage';
 
 const LOCAL_NAME = 'appSetting';

+ 16 - 0
langchat-ui-client/src/store/modules/app/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { defineStore } from 'pinia';
 import type { AppState, Language, Theme } from './helper';
 import { getLocalSetting, setLocalSetting } from './helper';

+ 16 - 0
langchat-ui-client/src/store/modules/auth/helper.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { storage } from '@/utils/storage';
 
 const LOCAL_NAME = 'SECRET_TOKEN';

+ 17 - 0
langchat-ui-client/src/store/modules/auth/index.ts

@@ -1,6 +1,23 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { defineStore } from 'pinia';
 import { getToken, removeToken, setToken } from './helper';
 import { store } from '@/store/helper';
+
 // import { fetchSession } from '@/api';
 
 interface SessionResponse {

+ 16 - 0
langchat-ui-client/src/store/modules/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export * from './app';
 export * from './user';
 export * from './settings';

+ 16 - 0
langchat-ui-client/src/store/modules/settings/helper.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { storage } from '@/utils/storage';
 
 const LOCAL_NAME = 'settingsStorage';

+ 16 - 0
langchat-ui-client/src/store/modules/settings/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { defineStore } from 'pinia';
 import type { SettingsState } from './helper';
 import { defaultSetting, getLocalState, removeLocalState, setLocalState } from './helper';

+ 16 - 0
langchat-ui-client/src/store/modules/user/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { defineStore } from 'pinia';
 import { storage } from '@/utils/storage';
 import { login, logout } from '@/api/auth';

+ 16 - 0
langchat-ui-client/src/styles/global.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 html,
 body,
 #app {

+ 16 - 0
langchat-ui-client/src/styles/lib/github-markdown.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 html.dark {
   .markdown-body {
     color-scheme: dark;

+ 16 - 0
langchat-ui-client/src/styles/lib/highlight.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 html.dark {
 	pre code.hljs {
 		display: block;

+ 16 - 0
langchat-ui-client/src/styles/lib/tailwind.css

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 @tailwind base;
 @tailwind components;
 @tailwind utilities;

+ 16 - 0
langchat-ui-client/src/styles/login.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 @keyframes anim-num {
   0% {
     transform: translateY(60px);

+ 16 - 0
langchat-ui-client/src/typings/chat.d.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 declare namespace Chat {
   interface Chat {
     dateTime: string;

+ 16 - 0
langchat-ui-client/src/typings/env.d.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /// <reference types="vite/client" />
 
 interface ImportMetaEnv {

+ 16 - 0
langchat-ui-client/src/typings/global.d.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 interface Window {
   $loadingBar?: import('naive-ui').LoadingBarProviderInst;
   $dialog?: import('naive-ui').DialogProviderInst;

+ 16 - 0
langchat-ui-client/src/utils/copy.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export function copyToClip(text: string) {
   return new Promise((resolve, reject) => {
     try {

+ 16 - 0
langchat-ui-client/src/utils/dateUtil.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { format } from 'date-fns';
 
 const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';

+ 16 - 0
langchat-ui-client/src/utils/debounce.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 type CallbackFunc<T extends unknown[]> = (...args: T) => void;
 
 export function debounce<T extends unknown[]>(

+ 16 - 0
langchat-ui-client/src/utils/downloadFile.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import html2canvas from 'html2canvas';
 import jspdf from 'jspdf';
 

+ 16 - 0
langchat-ui-client/src/utils/functions/debounce.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 type CallbackFunc<T extends unknown[]> = (...args: T) => void;
 
 export function debounce<T extends unknown[]>(

+ 16 - 0
langchat-ui-client/src/utils/functions/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { h } from 'vue';
 import { NIcon } from 'naive-ui';
 

+ 16 - 0
langchat-ui-client/src/utils/is/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export function isNumber<T extends number>(value: T | unknown): value is number {
   return Object.prototype.toString.call(value) === '[object Number]';
 }

+ 16 - 0
langchat-ui-client/src/utils/request/axios.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import axios, { type AxiosResponse } from 'axios';
 import { useUserStore } from '@/store';
 

+ 16 - 0
langchat-ui-client/src/utils/request/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { AxiosProgressEvent, AxiosResponse, GenericAbortSignal } from 'axios';
 import request from './axios';
 import { router } from '@/router';

+ 16 - 0
langchat-ui-client/src/utils/storage/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 interface StorageData<T = any> {
   data: T;
   expire: number | null;

+ 17 - 1
langchat-ui-client/src/views/exception/404/index.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { useRouter } from 'vue-router';
 
@@ -18,7 +34,7 @@
       </p>
       <div class="flex items-center justify-center text-center">
         <div class="w-[300px]">
-          <img src="../../../icons/404.svg" alt="404" />
+          <img alt="404" src="../../../icons/404.svg" />
         </div>
       </div>
       <n-button type="primary" @click="goHome"> Go to Home </n-button>

+ 16 - 0
langchat-ui-client/src/views/exception/500/index.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { useRouter } from 'vue-router';
   import Icon500 from '@/icons/500.vue';

+ 16 - 0
langchat-ui-client/src/views/login/EmailRegister.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { reactive, ref, toRaw } from 'vue';

+ 16 - 0
langchat-ui-client/src/views/login/Forget.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { reactive, ref, toRaw } from 'vue';

+ 16 - 0
langchat-ui-client/src/views/login/Login.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { reactive, ref, toRaw } from 'vue';

+ 16 - 0
langchat-ui-client/src/views/login/PhoneLogin.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { reactive, ref } from 'vue';

+ 16 - 0
langchat-ui-client/src/views/login/PhoneRegister.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { reactive, ref } from 'vue';

+ 16 - 0
langchat-ui-client/src/views/login/data.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { isBlank } from '@/utils/is';
 import { t } from '@/locales';
 

+ 30 - 14
langchat-ui-client/src/views/login/index.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import LoginForm from './Login.vue';
   import PhoneLoginForm from './PhoneLogin.vue';
@@ -21,13 +37,13 @@
   <div class="account-root">
     <div class="account-root-item root-left-item">
       <div class="root-left-logo">
-        <img src="@/assets/login/logo.png" alt="" />
+        <img alt="" src="@/assets/login/logo.png" />
         <div class="stand-title ml-1">{{ t('app') }}</div>
       </div>
       <div class="root-left-title">{{ t('login.slogan') }}</div>
       <div class="root-left-desc" v-html="t('login.des')"> </div>
       <div class="coding-img">
-        <img src="@/assets/login/login_bg.svg" alt="" />
+        <img alt="" src="@/assets/login/login_bg.svg" />
       </div>
     </div>
     <div class="account-root-item root-right-item">
@@ -37,7 +53,7 @@
             <div class="user-account">{{ t('login.loginTip') }}</div>
             <div class="user-register">
               <span>{{ t('login.noAccount') }}</span>
-              <n-button @click="isLogin = false" type="success" text>
+              <n-button text type="success" @click="isLogin = false">
                 {{ t('login.toRegister') }}
               </n-button>
             </div>
@@ -46,23 +62,23 @@
             <div class="user-account">{{ t('login.registerTip') }}</div>
             <div class="user-register">
               <span>{{ t('login.hasAccount') }}</span>
-              <n-button @click="isLogin = true" type="success" text>
+              <n-button text type="success" @click="isLogin = true">
                 {{ t('login.toLogin') }}
               </n-button>
             </div>
           </template>
         </div>
 
-        <n-tabs v-if="isLogin" type="line" animated>
-          <n-tab-pane name="chap1" :tab="t('login.accountType')"><LoginForm /></n-tab-pane>
-          <n-tab-pane name="chap2" :tab="t('login.emailType')"> <PhoneLoginForm /> </n-tab-pane>
+        <n-tabs v-if="isLogin" animated type="line">
+          <n-tab-pane :tab="t('login.accountType')" name="chap1"><LoginForm /></n-tab-pane>
+          <n-tab-pane :tab="t('login.emailType')" name="chap2"> <PhoneLoginForm /> </n-tab-pane>
         </n-tabs>
-        <n-tabs v-else type="line" animated>
-          <n-tab-pane name="chap1" :tab="t('login.emailRegType')"><EmailRegister /></n-tab-pane>
-          <n-tab-pane name="chap2" :tab="t('login.phoneRegType')"> <PhoneRegister /> </n-tab-pane>
+        <n-tabs v-else animated type="line">
+          <n-tab-pane :tab="t('login.emailRegType')" name="chap1"><EmailRegister /></n-tab-pane>
+          <n-tab-pane :tab="t('login.phoneRegType')" name="chap2"> <PhoneRegister /> </n-tab-pane>
         </n-tabs>
         <div class="flex !justify-end w-full text-end">
-          <n-button @click="router.push('/forget')" text> {{ t('login.forget') }} </n-button>
+          <n-button text @click="router.push('/forget')"> {{ t('login.forget') }} </n-button>
         </div>
 
         <n-divider>
@@ -72,19 +88,19 @@
         </n-divider>
         <div class="pb-8">
           <n-space vertical>
-            <n-button @click="onSocialLogin" dashed block round>
+            <n-button block dashed round @click="onSocialLogin">
               <template #icon>
                 <SvgIcon icon="uiw:weixin" />
               </template>
               {{ t('login.wxType') }}
             </n-button>
-            <n-button @click="onSocialLogin" block round dashed>
+            <n-button block dashed round @click="onSocialLogin">
               <template #icon>
                 <SvgIcon icon="ri:google-fill" />
               </template>
               {{ t('login.googleType') }}
             </n-button>
-            <n-button @click="onSocialLogin" block round dashed>
+            <n-button block dashed round @click="onSocialLogin">
               <template #icon>
                 <SvgIcon icon="ri:github-fill" />
               </template>

+ 19 - 3
langchat-ui-client/src/views/modules/chart/components/ChartConfig.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { use } from 'echarts/core';
   import { CanvasRenderer } from 'echarts/renderers';
   import { PieChart, LineChart } from 'echarts/charts';
@@ -89,7 +105,7 @@
       </div>
     </div>
     <n-scrollbar class="!w-3/12" style="height: calc(100vh - 200px)">
-      <div class="flex flex-col gap-2 p-2" v-if="option">
+      <div v-if="option" class="flex flex-col gap-2 p-2">
         <n-collapse expanded-names="1">
           <BaseConfig :option="option" />
           <LineConfig :option="option" />
@@ -101,7 +117,7 @@
   </div>
 </template>
 
-<style scoped lang="less">
+<style lang="less" scoped>
   ::v-deep(.n-collapse .n-collapse-item:not(:first-child)) {
     border: none !important;
     margin: 6px 0 0 0;

+ 17 - 1
langchat-ui-client/src/views/modules/chart/components/ChartData.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { ref } from 'vue';
   import { useMessage } from 'naive-ui';
@@ -71,4 +87,4 @@
   </n-spin>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 18 - 2
langchat-ui-client/src/views/modules/chart/components/ChartExport.vue

@@ -1,7 +1,23 @@
-<script setup lang="ts"></script>
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup></script>
 
 <template>
   <div>Export</div>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 20 - 4
langchat-ui-client/src/views/modules/chart/components/ChartSelect.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import {
     areaBasic,
     areaSimple,
@@ -59,11 +75,11 @@
   <div class="flex flex-col gap-4">
     <div v-for="item in charts" :key="item">
       <div class="mb-2 text-gray-700 dark:text-white text-[17px]">{{ item.group }}</div>
-      <n-grid :x-gap="18" :y-gap="18" :cols="5" class="pl-0.5 pr-0.5">
+      <n-grid :cols="5" :x-gap="18" :y-gap="18" class="pl-0.5 pr-0.5">
         <n-gi v-for="child in item.list" :key="child">
           <n-card
-            class="cursor-pointer !rounded-md"
             :class="child.key == chartStore.key ? 'card-active' : ''"
+            class="cursor-pointer !rounded-md"
             content-style="padding: 10px"
             hoverable
             @click="onSelect(child.key)"
@@ -81,7 +97,7 @@
   </div>
 </template>
 
-<style scoped lang="less">
+<style lang="less" scoped>
   .img-hover:hover {
     img {
       transition: 0.3s ease-in-out;

+ 39 - 23
langchat-ui-client/src/views/modules/chart/components/component/BaseConfig.vue

@@ -1,13 +1,29 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   defineProps<{
     option: any;
   }>();
 </script>
 
 <template>
-  <n-collapse-item title="标题组件" name="1">
+  <n-collapse-item name="1" title="标题组件">
     <template #header-extra>
-      <n-switch size="small" @click.stop v-model:value="option!.title.show" :default-value="true" />
+      <n-switch v-model:value="option!.title.show" :default-value="true" size="small" @click.stop />
     </template>
     <div class="pl-[22px] text-xs flex gap-2 flex-col">
       <div class="flex flex-row justify-center items-center">
@@ -18,25 +34,25 @@
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">顶部距离</div>
-            <n-input size="small" v-model:value="option!.title.top" />
+            <n-input v-model:value="option!.title.top" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">底部距离</div>
-            <n-input size="small" v-model:value="option!.title.bottom" />
+            <n-input v-model:value="option!.title.bottom" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">左侧距离</div>
-            <n-input size="small" v-model:value="option!.title.left" />
+            <n-input v-model:value="option!.title.left" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">右侧距离</div>
-            <n-input size="small" v-model:value="option!.title.right" />
+            <n-input v-model:value="option!.title.right" size="small" />
           </div>
         </n-gi>
       </n-grid>
@@ -46,56 +62,56 @@
   <n-collapse-item title="系列颜色">
     <div class="pl-[22px] text-xs flex gap-2 flex-row">
       <n-color-picker
-        size="small"
         v-model:value="option!.color"
         :swatches="['#FFFFFF', '#18A058', '#2080F0', '#F0A020', 'rgba(208, 48, 80, 1)']"
+        size="small"
       />
     </div>
   </n-collapse-item>
   <n-collapse-item title="图例组件">
     <template #header-extra>
       <n-switch
-        size="small"
-        @click.stop
         v-model:value="option!.legend.show"
         :default-value="true"
+        size="small"
+        @click.stop
       />
     </template>
     <div class="pl-[22px] text-xs flex gap-2 flex-col">
       <div class="flex flex-row justify-center items-center">
         <div class="w-[62px] text-gray-400">位置布局</div>
         <n-select
-          size="small"
           v-model:value="option!.legend.orient"
           :options="[
             { value: 'horizontal', label: 'horizontal' },
             { value: 'vertical', label: 'vertical' },
           ]"
+          size="small"
         />
       </div>
       <n-grid :cols="2" :x-gap="6" :y-gap="8">
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">顶部距离</div>
-            <n-input size="small" v-model:value="option!.legend.top" />
+            <n-input v-model:value="option!.legend.top" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">底部距离</div>
-            <n-input size="small" v-model:value="option!.legend.bottom" />
+            <n-input v-model:value="option!.legend.bottom" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">左侧距离</div>
-            <n-input size="small" v-model:value="option!.legend.left" />
+            <n-input v-model:value="option!.legend.left" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">右侧距离</div>
-            <n-input size="small" v-model:value="option!.legend.right" />
+            <n-input v-model:value="option!.legend.right" size="small" />
           </div>
         </n-gi>
       </n-grid>
@@ -104,48 +120,48 @@
   <n-collapse-item title="提示框组件">
     <template #header-extra>
       <n-switch
-        size="small"
-        @click.stop
         v-model:value="option!.tooltip.show"
         :default-value="true"
+        size="small"
+        @click.stop
       />
     </template>
     <div class="pl-[22px] text-xs flex gap-2 flex-col">
       <div class="flex flex-row justify-center items-center">
         <div class="w-[62px] text-gray-400">触发类型</div>
         <n-select
-          size="small"
           v-model:value="option!.legend.trigger"
           :options="[
             { value: 'item', label: '数据项图形触发' },
             { value: 'axis', label: '坐标轴触发' },
             { value: 'none', label: '不触发' },
           ]"
+          size="small"
         />
       </div>
       <n-grid :cols="2" :x-gap="6" :y-gap="8">
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">顶部距离</div>
-            <n-input size="small" v-model:value="option!.legend.top" />
+            <n-input v-model:value="option!.legend.top" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">底部距离</div>
-            <n-input size="small" v-model:value="option!.legend.bottom" />
+            <n-input v-model:value="option!.legend.bottom" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">左侧距离</div>
-            <n-input size="small" v-model:value="option!.legend.left" />
+            <n-input v-model:value="option!.legend.left" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">右侧距离</div>
-            <n-input size="small" v-model:value="option!.legend.right" />
+            <n-input v-model:value="option!.legend.right" size="small" />
           </div>
         </n-gi>
       </n-grid>
@@ -153,4 +169,4 @@
   </n-collapse-item>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 22 - 6
langchat-ui-client/src/views/modules/chart/components/component/CodeConfig.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { Codemirror } from 'vue-codemirror';
   import { oneDark } from '@codemirror/theme-one-dark';
   import { json } from '@codemirror/lang-json';
@@ -24,18 +40,18 @@
   <n-collapse-item title="编辑源码">
     <Codemirror
       v-model="code"
-      @update:model-value="onChange"
-      placeholder="Code goes here..."
-      :style="{ height: '400px' }"
       :autofocus="true"
+      :extensions="extensions"
       :indent-with-tab="true"
+      :style="{ height: '400px' }"
       :tab-size="2"
-      :extensions="extensions"
+      placeholder="Code goes here..."
+      @update:model-value="onChange"
     />
   </n-collapse-item>
 </template>
 
-<style scoped lang="less">
+<style lang="less" scoped>
   ::v-deep(.cm-focused) {
     outline: none !important;
   }

+ 26 - 10
langchat-ui-client/src/views/modules/chart/components/component/LineConfig.vue

@@ -1,41 +1,57 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   const props = defineProps<{
     option: any;
   }>();
 </script>
 
 <template>
-  <n-collapse-item title="x轴组件" v-if="option.xAxis !== undefined">
+  <n-collapse-item v-if="option.xAxis !== undefined" title="x轴组件">
     <template #header-extra>
-      <n-switch size="small" @click.stop v-model:value="option!.xAxis.show" :default-value="true" />
+      <n-switch v-model:value="option!.xAxis.show" :default-value="true" size="small" @click.stop />
     </template>
     <div class="pl-[22px] flex gap-2 flex-col">
       <div class="flex flex-row justify-center items-center">
         <div class="w-10 text-gray-400">名称</div>
-        <n-input size="small" v-model:value="option!.xAxis.name" />
+        <n-input v-model:value="option!.xAxis.name" size="small" />
       </div>
       <div class="flex flex-row justify-center items-center">
         <div class="w-10 text-gray-400">位置</div>
-        <n-input size="small" v-model:value="option!.title.left" />
+        <n-input v-model:value="option!.title.left" size="small" />
       </div>
     </div>
   </n-collapse-item>
 
-  <n-collapse-item title="y轴组件" v-if="option.yAxis !== undefined">
+  <n-collapse-item v-if="option.yAxis !== undefined" title="y轴组件">
     <template #header-extra>
-      <n-switch size="small" @click.stop v-model:value="option!.yAxis.show" :default-value="true" />
+      <n-switch v-model:value="option!.yAxis.show" :default-value="true" size="small" @click.stop />
     </template>
     <div class="pl-[22px] flex gap-2 flex-col">
       <div class="flex flex-row justify-center items-center">
         <div class="w-10 text-gray-400">名称</div>
-        <n-input size="small" v-model:value="option!.yAxis.name" />
+        <n-input v-model:value="option!.yAxis.name" size="small" />
       </div>
       <div class="flex flex-row justify-center items-center">
         <div class="w-10 text-gray-400">位置</div>
-        <n-input size="small" v-model:value="option!.title.left" />
+        <n-input v-model:value="option!.title.left" size="small" />
       </div>
     </div>
   </n-collapse-item>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 22 - 6
langchat-ui-client/src/views/modules/chart/components/component/PieConfig.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   const props = defineProps<{
     option: any;
   }>();
@@ -15,25 +31,25 @@
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">顶部距离</div>
-            <n-input size="small" v-model:value="option!.title.top" />
+            <n-input v-model:value="option!.title.top" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">底部距离</div>
-            <n-input size="small" v-model:value="option!.title.bottom" />
+            <n-input v-model:value="option!.title.bottom" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">左侧距离</div>
-            <n-input size="small" v-model:value="option!.title.left" />
+            <n-input v-model:value="option!.title.left" size="small" />
           </div>
         </n-gi>
         <n-gi>
           <div class="flex flex-row justify-center items-center">
             <div class="w-[74px] text-gray-400">右侧距离</div>
-            <n-input size="small" v-model:value="option!.title.right" />
+            <n-input v-model:value="option!.title.right" size="small" />
           </div>
         </n-gi>
       </n-grid>
@@ -41,4 +57,4 @@
   </n-collapse-item>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 22 - 6
langchat-ui-client/src/views/modules/chart/index.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import ChartSelect from './components/ChartSelect.vue';
   import ChartData from './components/ChartData.vue';
@@ -18,13 +34,13 @@
 <template>
   <div class="w-full pt-3 dot-bg">
     <div class="flex justify-between items-center pl-10 pr-10">
-      <n-button text type="primary" size="large">
+      <n-button size="large" text type="primary">
         <template #icon>
           <SvgIcon icon="solar:chart-broken" />
         </template>
         <div class="flex gap-1 items-center">
           <span>可视化图表分析</span>
-          <n-tag type="warning" size="small">本功能正在开发中...</n-tag>
+          <n-tag size="small" type="warning">本功能正在开发中...</n-tag>
         </div>
       </n-button>
     </div>
@@ -33,9 +49,9 @@
       <div class="!w-[90%]">
         <n-tabs
           v-model:value="chartStore.step"
-          type="segment"
           animated
           justify-content="space-evenly"
+          type="segment"
         >
           <n-tab-pane
             v-for="(item, index) in steps"
@@ -49,8 +65,8 @@
                 class="flex justify-center items-center w-full pr-2"
               >
                 <div
-                  class="w-full flex justify-center items-center"
                   :class="chartStore.step === index ? 'text-[#70c0e8]' : ''"
+                  class="w-full flex justify-center items-center"
                 >
                   <div class="w-1/2 justify-center flex">{{ item.key }}</div>
                 </div>
@@ -65,7 +81,7 @@
   </div>
 </template>
 
-<style scoped lang="less">
+<style lang="less" scoped>
   ::v-deep(.n-tabs .n-tabs-tab .n-tabs-tab__label) {
     width: 100% !important;
   }

+ 16 - 0
langchat-ui-client/src/views/modules/chart/store/index.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { defineStore } from 'pinia';
 
 export interface ChartState {

+ 16 - 0
langchat-ui-client/src/views/modules/chat/Header.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { useBasicLayout } from '@/hooks/useBasicLayout';

+ 16 - 0
langchat-ui-client/src/views/modules/chat/index.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { computed, onMounted, onUnmounted, onUpdated, ref } from 'vue';
   import { SvgIcon } from '@/components/common';

+ 20 - 4
langchat-ui-client/src/views/modules/chat/message/Avatar.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { computed } from 'vue';
   import { NAvatar } from 'naive-ui';
   import { isString } from '@/utils/is';
@@ -25,14 +41,14 @@
   <template v-if="image">
     <NAvatar
       v-if="isString(avatar) && avatar.length > 0"
-      :src="avatar"
       :fallback-src="defaultAvatar"
+      :src="avatar"
     />
-    <NAvatar v-else round :src="defaultAvatar" />
+    <NAvatar v-else :src="defaultAvatar" round />
   </template>
   <span v-else class="">
     <n-avatar :src="logoAvatar" object-fit="contain" />
   </span>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 17 - 1
langchat-ui-client/src/views/modules/chat/message/Message.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { computed, ref } from 'vue';
   import { useMessage } from 'naive-ui';
@@ -129,4 +145,4 @@
   </div>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 16 - 0
langchat-ui-client/src/views/modules/chat/message/TextComponent.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { computed, onMounted, onUnmounted, onUpdated, ref } from 'vue';
   import MarkdownIt from 'markdown-it';

+ 16 - 0
langchat-ui-client/src/views/modules/chat/message/styles/github-markdown.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 html.dark {
   .markdown-body {
     color-scheme: dark;

+ 16 - 0
langchat-ui-client/src/views/modules/chat/message/styles/highlight.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 html.dark {
 	pre code.hljs {
 		display: block;

+ 16 - 0
langchat-ui-client/src/views/modules/chat/message/styles/index.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 @import "github-markdown.less";
 @import "highlight.less";
 @import "style.less";

+ 16 - 0
langchat-ui-client/src/views/modules/chat/message/styles/style.less

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 .markdown-body {
 	background-color: transparent;
 	font-size: 14px;

+ 19 - 3
langchat-ui-client/src/views/modules/chat/sider/List.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import { computed } from 'vue';
   import { NInput, NPopconfirm, NScrollbar } from 'naive-ui';
   import { SvgIcon } from '@/components/common';
@@ -49,19 +65,19 @@
         <div
           class="flex flex-col items-center mt-4 text-center text-neutral-300 dark:border-neutral-800"
         >
-          <SvgIcon icon="ri:inbox-line" class="mb-2 text-3xl" />
+          <SvgIcon class="mb-2 text-3xl" icon="ri:inbox-line" />
           <span>{{ t('chat.emptyConversation') }}</span>
         </div>
       </template>
       <template v-else>
         <div v-for="(item, index) of dataSources" :key="index">
           <a
-            class="relative flex items-center gap-3 px-3 py-3 break-all border rounded-md cursor-pointer hover:bg-neutral-100 group dark:border-neutral-800 dark:hover:bg-[#24272e]"
             :class="
               isActive(item.id)
                 ? 'border-[#4b9e5f] bg-neutral-100 text-[#4b9e5f] dark:bg-[#24272e] dark:border-[#4b9e5f] pr-14'
                 : ''
             "
+            class="relative flex items-center gap-3 px-3 py-3 break-all border rounded-md cursor-pointer hover:bg-neutral-100 group dark:border-neutral-800 dark:hover:bg-[#24272e]"
             @click="handleSelect(item)"
           >
             <span>

+ 24 - 8
langchat-ui-client/src/views/modules/chat/sider/index.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   import type { CSSProperties } from 'vue';
   import { computed, watch } from 'vue';
   import { SvgIcon } from '@/components/common';
@@ -64,21 +80,21 @@
   <NLayoutSider
     :collapsed="collapsed"
     :collapsed-width="0"
-    :width="260"
     :show-trigger="isMobile ? false : 'arrow-circle'"
+    :style="getMobileClass"
+    :width="260"
+    bordered
     collapse-mode="transform"
     position="absolute"
-    bordered
-    :style="getMobileClass"
     @update-collapsed="handleUpdateCollapsed"
   >
-    <div class="flex flex-col h-full" :style="mobileSafeArea">
+    <div :style="mobileSafeArea" class="flex flex-col h-full">
       <div v-if="loading" class="w-full h-full flex items-center justify-center">
         <n-spin :show="loading" />
       </div>
       <main v-else class="flex flex-col flex-1 min-h-0">
         <div class="p-4 pt-3 flex justify-between items-center gap-2">
-          <n-button @click="onAddConversation" block type="success" secondary>
+          <n-button block secondary type="success" @click="onAddConversation">
             <SvgIcon icon="ic:round-plus" />
             <span>{{ t('chat.newChatButton') }}</span>
           </n-button>
@@ -87,10 +103,10 @@
           <List />
           <div class="pb-2 px-4">
             <n-select
-              :options="chatStore.prompts"
+              v-model:value="chatStore.selectPromptId"
               :label-field="'name'"
+              :options="chatStore.prompts"
               :value-field="'id'"
-              v-model:value="chatStore.selectPromptId"
             />
           </div>
         </div>

+ 16 - 0
langchat-ui-client/src/views/modules/chat/store/chat.d.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export interface ChatState {
   modelId?: string;
   modelName?: string;

+ 16 - 0
langchat-ui-client/src/views/modules/chat/store/useBasicLayout.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
 
 export const useBasicLayout = () => {

+ 16 - 0
langchat-ui-client/src/views/modules/chat/store/useChatStore.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { defineStore } from 'pinia';
 import {
   add as addConversations,

+ 16 - 0
langchat-ui-client/src/views/modules/chat/store/useIconRender.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import { h } from 'vue';
 import { SvgIcon } from '@/components/common';
 

+ 16 - 0
langchat-ui-client/src/views/modules/chat/store/useScroll.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import type { Ref } from 'vue';
 import { nextTick, ref } from 'vue';
 import { LayoutInst } from 'naive-ui';

+ 16 - 0
langchat-ui-client/src/views/modules/common/ModelProvider.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { onMounted, toRaw } from 'vue';
   import { getChatModels } from '@/api/chat';

+ 16 - 0
langchat-ui-client/src/views/modules/common/data.ts

@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 export enum EmbeddingProviderEnum {
   OPENAI = 'openai',
   AZURE_OPENAI = 'azure-openai',

+ 16 - 0
langchat-ui-client/src/views/modules/doc/components/Chat.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { ref } from 'vue';
   import { docsChat } from '@/api/chat';

+ 16 - 0
langchat-ui-client/src/views/modules/doc/components/FileList.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { SvgIcon } from '@/components/common';
   import { UploadCustomRequestOptions, useMessage } from 'naive-ui';

+ 19 - 3
langchat-ui-client/src/views/modules/doc/components/FileView.vue

@@ -1,4 +1,20 @@
-<script setup lang="ts">
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
+<script lang="ts" setup>
   const props = defineProps({
     url: {
       type: String,
@@ -13,7 +29,7 @@
 </script>
 
 <template>
-  <iframe :src="path" width="100%" height="100%" frameborder="0" class="!z-0"></iframe>
+  <iframe :src="path" class="!z-0" frameborder="0" height="100%" width="100%"></iframe>
 </template>
 
-<style scoped lang="less"></style>
+<style lang="less" scoped></style>

+ 16 - 0
langchat-ui-client/src/views/modules/doc/components/Message.vue

@@ -1,3 +1,19 @@
+<!--
+  - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+  -
+  - Licensed under the GNU Affero General Public License, Version 3 (the "License");
+  - you may not use this file except in compliance with the License.
+  - You may obtain a copy of the License at
+  -
+  -     https://www.gnu.org/licenses/agpl-3.0.html
+  -
+  - Unless required by applicable law or agreed to in writing, software
+  - distributed under the License is distributed on an "AS IS" BASIS,
+  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  - See the License for the specific language governing permissions and
+  - limitations under the License.
+  -->
+
 <script lang="ts" setup>
   import { onMounted, onUnmounted, onUpdated, ref } from 'vue';
   import { SvgIcon } from '@/components/common';

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません