style: Oxc 代码格式调整
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||||
"semi": false,
|
"semi": false,
|
||||||
"singleQuote": true
|
"singleQuote": true,
|
||||||
|
"bracketSpacing": true
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
@@ -36,6 +36,7 @@ declare module 'vue' {
|
|||||||
NDataTable: typeof import('naive-ui')['NDataTable']
|
NDataTable: typeof import('naive-ui')['NDataTable']
|
||||||
NDrawer: typeof import('naive-ui')['NDrawer']
|
NDrawer: typeof import('naive-ui')['NDrawer']
|
||||||
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
||||||
|
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
|
||||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||||
NEmpty: typeof import('naive-ui')['NEmpty']
|
NEmpty: typeof import('naive-ui')['NEmpty']
|
||||||
NFlex: typeof import('naive-ui')['NFlex']
|
NFlex: typeof import('naive-ui')['NFlex']
|
||||||
@@ -106,6 +107,7 @@ declare global {
|
|||||||
const NDataTable: typeof import('naive-ui')['NDataTable']
|
const NDataTable: typeof import('naive-ui')['NDataTable']
|
||||||
const NDrawer: typeof import('naive-ui')['NDrawer']
|
const NDrawer: typeof import('naive-ui')['NDrawer']
|
||||||
const NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
const NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
||||||
|
const NDynamicTags: typeof import('naive-ui')['NDynamicTags']
|
||||||
const NEllipsis: typeof import('naive-ui')['NEllipsis']
|
const NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||||
const NEmpty: typeof import('naive-ui')['NEmpty']
|
const NEmpty: typeof import('naive-ui')['NEmpty']
|
||||||
const NFlex: typeof import('naive-ui')['NFlex']
|
const NFlex: typeof import('naive-ui')['NFlex']
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import UserAction from '@/components/admin/UserAction.vue'
|
import UserAction from '@/components/admin/UserAction.vue'
|
||||||
import type {MenuOption} from 'naive-ui'
|
import type { MenuOption } from 'naive-ui'
|
||||||
import {computed, onMounted, ref, useTemplateRef} from 'vue'
|
import { computed, onMounted, ref, useTemplateRef } from 'vue'
|
||||||
import {useRouter} from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import {useNowUser} from '@/stores/now-user.js'
|
import { useNowUser } from '@/stores/now-user.js'
|
||||||
import {useHead} from '@unhead/vue'
|
import { useHead } from '@unhead/vue'
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
titleTemplate: '%s | 管理面板 | NayHome',
|
titleTemplate: '%s | 管理面板 | NayHome',
|
||||||
@@ -76,16 +76,16 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div id="user-page">
|
<div id="user-page">
|
||||||
<div id="user-page-sidebar">
|
<div id="user-page-sidebar">
|
||||||
<user-action/>
|
<user-action />
|
||||||
<div class="nyahome-card">
|
<div class="nyahome-card">
|
||||||
<n-menu ref="menu" v-model:value="selectOption" :options @update:value="handleMenuClick"/>
|
<n-menu ref="menu" v-model:value="selectOption" :options @update:value="handleMenuClick" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<router-view v-slot="{ Component }">
|
<router-view v-slot="{ Component }">
|
||||||
<div id="user-page-content">
|
<div id="user-page-content">
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<component :is="Component"/>
|
<component :is="Component" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</div>
|
</div>
|
||||||
</router-view>
|
</router-view>
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {useRoute} from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import {onMounted, reactive, ref, useTemplateRef, watch} from 'vue'
|
import { onMounted, reactive, ref, useTemplateRef, watch } from 'vue'
|
||||||
import {api} from '@/tools/web.ts'
|
import { api } from '@/tools/web.ts'
|
||||||
import type {ReturnDto} from '@/types/response.ts'
|
import type { ReturnDto } from '@/types/response.ts'
|
||||||
import type {Chatroom} from '@/types/chatroom.ts'
|
import type { Chatroom } from '@/types/chatroom.ts'
|
||||||
import {useMessage} from 'naive-ui'
|
import { useMessage } from 'naive-ui'
|
||||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||||
import ChatTable from '@/components/chatroom/ChatTable.vue'
|
import ChatTable from '@/components/chatroom/ChatTable.vue'
|
||||||
import ChatControlPanel from '@/components/chatroom/ChatControlPanel.vue'
|
import ChatControlPanel from '@/components/chatroom/ChatControlPanel.vue'
|
||||||
import {fetchEventSource} from '@microsoft/fetch-event-source'
|
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||||
import type {AiiTokenInfo} from '@/types/aii.ts'
|
import type { AiiTokenInfo } from '@/types/aii.ts'
|
||||||
import {SEE_YOU_TOMORROW} from '@/types/syt.ts'
|
import { SEE_YOU_TOMORROW } from '@/types/syt.ts'
|
||||||
import {useHead} from '@unhead/vue'
|
import { useHead } from '@unhead/vue'
|
||||||
|
|
||||||
const pageHead = reactive({
|
const pageHead = reactive({
|
||||||
title: '正在加载聊天室...',
|
title: '正在加载聊天室...',
|
||||||
titleTemplate: '%s | 聊天室 | NyaHome'
|
titleTemplate: '%s | 聊天室 | NyaHome',
|
||||||
})
|
})
|
||||||
|
|
||||||
useHead(pageHead)
|
useHead(pageHead)
|
||||||
@@ -92,6 +92,7 @@ function chat() {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
Authorization: `Bearer ${localStorage.getItem('access-token')}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
message: inputMessage.value,
|
message: inputMessage.value,
|
||||||
@@ -200,7 +201,7 @@ function messageEdit(oldMessage: string, newMessage: string, change: 'aii' | 'us
|
|||||||
function messageDelete(message: string, change: 'aii' | 'user') {
|
function messageDelete(message: string, change: 'aii' | 'user') {
|
||||||
const id = Number(ROUTE.params.id)
|
const id = Number(ROUTE.params.id)
|
||||||
api
|
api
|
||||||
.post(`/chatroom/${id}/chat/delete/`, JSON.stringify({message, change}))
|
.post(`/chatroom/${id}/chat/delete/`, JSON.stringify({ message, change }))
|
||||||
.then((res) => res.data as ReturnDto)
|
.then((res) => res.data as ReturnDto)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@@ -264,7 +265,7 @@ function enableSidebar() {
|
|||||||
:on-message-edit="messageEdit"
|
:on-message-edit="messageEdit"
|
||||||
:on-message-delete="messageDelete"
|
:on-message-delete="messageDelete"
|
||||||
/>
|
/>
|
||||||
<div id="main-toggle" ref="main-toggle" @click="enableSidebar"/>
|
<div id="main-toggle" ref="main-toggle" @click="enableSidebar" />
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-column" ref="sidebar">
|
<div class="sidebar-column" ref="sidebar">
|
||||||
<chat-control-panel
|
<chat-control-panel
|
||||||
@@ -272,7 +273,7 @@ function enableSidebar() {
|
|||||||
v-model:quicker-prompt="quickerPrompt"
|
v-model:quicker-prompt="quickerPrompt"
|
||||||
v-model:select-model="selectedModel"
|
v-model:select-model="selectedModel"
|
||||||
/>
|
/>
|
||||||
<div id="sidebar-toggle" @click="disableSidebar"/>
|
<div id="sidebar-toggle" @click="disableSidebar" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -310,7 +311,8 @@ div.page-container {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
opacity: var(--opacity);
|
opacity: var(--opacity);
|
||||||
|
|
||||||
transition: background-color 0.8s,
|
transition:
|
||||||
|
background-color 0.8s,
|
||||||
transform 0.5s,
|
transform 0.5s,
|
||||||
opacity 1s,
|
opacity 1s,
|
||||||
height 0.5s,
|
height 0.5s,
|
||||||
@@ -339,7 +341,8 @@ div.page-container {
|
|||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
transition: transform 1s,
|
transition:
|
||||||
|
transform 1s,
|
||||||
opacity 1s,
|
opacity 1s,
|
||||||
flex-basis 1s;
|
flex-basis 1s;
|
||||||
transform: translateX(var(--transform-x));
|
transform: translateX(var(--transform-x));
|
||||||
@@ -356,7 +359,8 @@ div.page-container {
|
|||||||
background: rgb(0 0 0 / 0.1);
|
background: rgb(0 0 0 / 0.1);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
||||||
transition: background-color 0.8s,
|
transition:
|
||||||
|
background-color 0.8s,
|
||||||
transform 0.5s,
|
transform 0.5s,
|
||||||
height 0.5s,
|
height 0.5s,
|
||||||
width 0.5s,
|
width 0.5s,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||||
import {ref, watch} from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import {api} from '@/tools/web.ts'
|
import { api } from '@/tools/web.ts'
|
||||||
import type {ChatroomPublic} from '@/types/chatroom.ts'
|
import type { ChatroomPublic } from '@/types/chatroom.ts'
|
||||||
import type {ReturnDto} from '@/types/response.ts'
|
import type { ReturnDto } from '@/types/response.ts'
|
||||||
import ChatroomCreatorModal from '@/components/chatroom/ChatroomCreatorModal.vue'
|
import ChatroomCreatorModal from '@/components/chatroom/ChatroomCreatorModal.vue'
|
||||||
import {useNowUser} from '@/stores/now-user.ts'
|
import { useNowUser } from '@/stores/now-user.ts'
|
||||||
import {useHead} from "@unhead/vue";
|
import { useHead } from '@unhead/vue'
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: "聊天室列表",
|
title: '聊天室列表',
|
||||||
})
|
})
|
||||||
|
|
||||||
const NOWUSER = useNowUser()
|
const NOWUSER = useNowUser()
|
||||||
@@ -33,7 +33,7 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
load()
|
load()
|
||||||
},
|
},
|
||||||
{immediate: true},
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ watch(
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<chatroom-creator-modal v-model:show-modal="showModal"/>
|
<chatroom-creator-modal v-model:show-modal="showModal" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {useNowUser} from '@/stores/now-user.js'
|
import { useNowUser } from '@/stores/now-user.js'
|
||||||
import {ref, watch} from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import SelectFileModal from '@/components/file/SelectFileModal.vue'
|
import SelectFileModal from '@/components/file/SelectFileModal.vue'
|
||||||
import {api} from '@/tools/web.js'
|
import { api } from '@/tools/web.js'
|
||||||
import type {UploadFileDto, UserDto} from '@/types/user.js'
|
import type { UploadFileDto, UserDto } from '@/types/user.js'
|
||||||
import {useHead} from '@unhead/vue'
|
import { useHead } from '@unhead/vue'
|
||||||
import ChangeEmailModal from '@/components/admin/ChangeEmailModal.vue'
|
import ChangeEmailModal from '@/components/admin/ChangeEmailModal.vue'
|
||||||
import ChangePhoneModal from '@/components/admin/ChangePhoneModal.vue'
|
import ChangePhoneModal from '@/components/admin/ChangePhoneModal.vue'
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
reInitForm()
|
reInitForm()
|
||||||
},
|
},
|
||||||
{immediate: true},
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
@@ -91,14 +91,14 @@ async function save() {
|
|||||||
<div class="ui-content">
|
<div class="ui-content">
|
||||||
<n-form style="width: 450px" label-width="auto" label-placement="left" label-align="right">
|
<n-form style="width: 450px" label-width="auto" label-placement="left" label-align="right">
|
||||||
<n-form-item label="用户名">
|
<n-form-item label="用户名">
|
||||||
<n-input v-model:value="infoForm.name"/>
|
<n-input v-model:value="infoForm.name" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="展示名称">
|
<n-form-item label="展示名称">
|
||||||
<n-input v-model:value="infoForm.display_name"/>
|
<n-input v-model:value="infoForm.display_name" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="头像">
|
<n-form-item label="头像">
|
||||||
<n-flex>
|
<n-flex>
|
||||||
<n-avatar v-model:src="infoForm.avatar_url" :size="96" circle/>
|
<n-avatar v-model:src="infoForm.avatar_url" :size="96" circle />
|
||||||
<n-flex vertical>
|
<n-flex vertical>
|
||||||
<n-tag type="info">需在「内容-上传」中提前上传图像。</n-tag>
|
<n-tag type="info">需在「内容-上传」中提前上传图像。</n-tag>
|
||||||
<n-tag type="warning">使用方形图像以获得最佳效果。</n-tag>
|
<n-tag type="warning">使用方形图像以获得最佳效果。</n-tag>
|
||||||
@@ -116,7 +116,7 @@ async function save() {
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="个人背景">
|
<n-form-item label="个人背景">
|
||||||
<n-flex>
|
<n-flex>
|
||||||
<n-avatar v-model:src="infoForm.background_url" :size="96" object-fit="cover"/>
|
<n-avatar v-model:src="infoForm.background_url" :size="96" object-fit="cover" />
|
||||||
<n-flex vertical>
|
<n-flex vertical>
|
||||||
<n-tag type="info">需在「内容-上传」中提前上传图像。</n-tag>
|
<n-tag type="info">需在「内容-上传」中提前上传图像。</n-tag>
|
||||||
<n-flex>
|
<n-flex>
|
||||||
@@ -139,10 +139,10 @@ async function save() {
|
|||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="邮箱">
|
<n-form-item label="邮箱">
|
||||||
<n-input v-model:value="NOWUSER.email" disabled/>
|
<n-input v-model:value="NOWUSER.email" disabled />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="手机号">
|
<n-form-item label="手机号">
|
||||||
<n-input v-model:value="NOWUSER.phone" disabled/>
|
<n-input v-model:value="NOWUSER.phone" disabled />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-form>
|
</n-form>
|
||||||
<n-flex>
|
<n-flex>
|
||||||
@@ -171,8 +171,8 @@ async function save() {
|
|||||||
v-model:show-modal="showBackgroundModal"
|
v-model:show-modal="showBackgroundModal"
|
||||||
v-model:select-files="background_selectFiles"
|
v-model:select-files="background_selectFiles"
|
||||||
/>
|
/>
|
||||||
<change-email-modal v-model:show-modal="showChangeEmailModal"/>
|
<change-email-modal v-model:show-modal="showChangeEmailModal" />
|
||||||
<change-phone-modal v-model:show-modal="showChangePhoneModal"/>
|
<change-phone-modal v-model:show-modal="showChangePhoneModal" />
|
||||||
</n-card>
|
</n-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user