|
@@ -2,6 +2,7 @@
|
|
|
import {createApp, defineComponent, h, ref} from 'vue'
|
|
import {createApp, defineComponent, h, ref} from 'vue'
|
|
|
import {createPinia} from 'pinia'
|
|
import {createPinia} from 'pinia'
|
|
|
import BotSettingsDialog from '@/components/workspace/BotSettingsDialog.vue'
|
|
import BotSettingsDialog from '@/components/workspace/BotSettingsDialog.vue'
|
|
|
|
|
+import BotProfileDialog from '@/components/workspace/BotProfileDialog.vue'
|
|
|
import SettingsCenterDialog from '@/components/app/SettingsCenterDialog.vue'
|
|
import SettingsCenterDialog from '@/components/app/SettingsCenterDialog.vue'
|
|
|
import {useAuthStore} from '@/stores/auth'
|
|
import {useAuthStore} from '@/stores/auth'
|
|
|
import '@/styles/tokens.css'
|
|
import '@/styles/tokens.css'
|
|
@@ -9,7 +10,7 @@ import '@/styles/global.css'
|
|
|
|
|
|
|
|
const query=new URLSearchParams(location.search)
|
|
const query=new URLSearchParams(location.search)
|
|
|
const names=['测试2','竹儿','测试','瑶儿']
|
|
const names=['测试2','竹儿','测试','瑶儿']
|
|
|
-const agents=names.map((name,i)=>({id:`00000000-0000-4000-8000-00000000000${i+1}`,name,profile:'default',nodeId:'local',archived:false}))
|
|
|
|
|
|
|
+const agents=names.map((name,i)=>({id:`00000000-0000-4000-8000-00000000000${i+1}`,name,profile:'default',nodeId:'local',archived:false,avatar:'',instructions:'协助整理项目资料,检查问题并给出清晰、简洁的建议。',execution:'computer',canManageTeam:false,canCollaborate:true,memoryEnabled:true,createdAt:1,updatedAt:1}))
|
|
|
const conversations=[{id:'group-a',name:'方案分析团队',kind:'group',memberIds:agents.map(a=>a.id),archived:false},{id:'group-b',name:'内容运营组',kind:'group',memberIds:agents.slice(0,3).map(a=>a.id),archived:false}]
|
|
const conversations=[{id:'group-a',name:'方案分析团队',kind:'group',memberIds:agents.map(a=>a.id),archived:false},{id:'group-b',name:'内容运营组',kind:'group',memberIds:agents.slice(0,3).map(a=>a.id),archived:false}]
|
|
|
const projects=query.has('empty')?[]:[
|
|
const projects=query.has('empty')?[]:[
|
|
|
{id:'project-a',name:'夭夭产品开发',description:'',memberIds:agents.map(a=>a.id),groupIds:['group-a','group-b'],revision:1,archived:false,createdAt:1,updatedAt:1},
|
|
{id:'project-a',name:'夭夭产品开发',description:'',memberIds:agents.map(a=>a.id),groupIds:['group-a','group-b'],revision:1,archived:false,createdAt:1,updatedAt:1},
|
|
@@ -26,6 +27,9 @@ window.fetch=async(input,init)=>{
|
|
|
else if(url.pathname==='/api/app/bootstrap')data={csrfToken:'fixture-only',userId:'fixture-user',authRequired:true}
|
|
else if(url.pathname==='/api/app/bootstrap')data={csrfToken:'fixture-only',userId:'fixture-user',authRequired:true}
|
|
|
else if(url.pathname==='/api/app/agents')data={agents}
|
|
else if(url.pathname==='/api/app/agents')data={agents}
|
|
|
else if(url.pathname==='/api/app/conversations')data={conversations}
|
|
else if(url.pathname==='/api/app/conversations')data={conversations}
|
|
|
|
|
+ else if(url.pathname==='/api/app/models')data={provider:'custom',model:'GPT-5.6-terra',providers:[{slug:'custom',name:'Custom endpoint',models:['GPT-5.6-terra'],is_current:true}]}
|
|
|
|
|
+ else if(url.pathname==='/api/app/admin/legacy-model-services')data={items:[]}
|
|
|
|
|
+ else if(url.pathname.startsWith('/api/app/admin/model-services'))data={endpoints:[],services:[],current:{provider:'custom',model:'GPT-5.6-terra',base_url:''}}
|
|
|
else if(url.pathname==='/api/app/workspace/projects'){
|
|
else if(url.pathname==='/api/app/workspace/projects'){
|
|
|
if(init?.method==='POST'){
|
|
if(init?.method==='POST'){
|
|
|
const previous=projects.find(p=>p.id===body.id)
|
|
const previous=projects.find(p=>p.id===body.id)
|
|
@@ -48,12 +52,13 @@ const App=defineComponent({setup(){
|
|
|
const auth=useAuthStore()
|
|
const auth=useAuthStore()
|
|
|
auth.user={id:'fixture-user',username:'samien',role:query.has('member')?'member':'admin'} as never
|
|
auth.user={id:'fixture-user',username:'samien',role:query.has('member')?'member':'admin'} as never
|
|
|
auth.status='authenticated';auth.serverIdentity=identity
|
|
auth.status='authenticated';auth.serverIdentity=identity
|
|
|
- const opened=ref<'bot'|'personal'|null>(query.get('view')==='appearance'||query.get('view')==='profile'?'personal':'bot')
|
|
|
|
|
|
|
+ const opened=ref<'bot'|'personal'|'editor'|null>(query.get('view')==='editor'?'editor':query.get('view')==='appearance'||query.get('view')==='profile'?'personal':'bot')
|
|
|
return()=>h('main',{style:'min-height:100dvh;background:var(--settings-panel);padding:18px;box-sizing:border-box'},[
|
|
return()=>h('main',{style:'min-height:100dvh;background:var(--settings-panel);padding:18px;box-sizing:border-box'},[
|
|
|
h('div',{style:'display:flex;gap:12px;align-items:center;font:13px var(--font-ui)'},[
|
|
h('div',{style:'display:flex;gap:12px;align-items:center;font:13px var(--font-ui)'},[
|
|
|
- h('span','界面验证 · 示例数据'),h('button',{onClick:()=>opened.value='bot'},'Bot 设置'),h('button',{onClick:()=>opened.value='personal'},'我的设置'),
|
|
|
|
|
|
|
+ h('span','界面验证 · 示例数据'),h('button',{onClick:()=>opened.value='bot'},'Bot 设置'),h('button',{onClick:()=>opened.value='personal'},'我的设置'),h('button',{onClick:()=>opened.value='editor'},'编辑资料'),
|
|
|
]),
|
|
]),
|
|
|
opened.value==='bot'?h(BotSettingsDialog,{isAdmin:!query.has('member'),onClose:()=>opened.value=null}):null,
|
|
opened.value==='bot'?h(BotSettingsDialog,{isAdmin:!query.has('member'),onClose:()=>opened.value=null}):null,
|
|
|
|
|
+ opened.value==='editor'?h(BotProfileDialog,{agent:agents[0],draft:{...agents[0],source:'["local","default"]'},sources:[{nodeId:'local',profile:'default',name:'丫头'}],profiles:[{name:'default',agentName:'丫头',isDefault:true}],agents,conversations,conversationId:'fixture-chat',isAdmin:!query.has('member'),knowledgeEnabled:true,onClose:()=>opened.value=null,onSave:()=>opened.value=null} as never):null,
|
|
|
h(SettingsCenterDialog,{open:opened.value==='personal',initialPage:query.get('view')==='profile'?'account-profile':'appearance',isAdmin:!query.has('member'),botMode:true,userName:'samien',theme:theme.value==='dark'?'dark':'light',themePreference:theme.value,profiles:[{name:'default',agentName:'默认机器人',isDefault:true}],activeProfile:{name:'default',agentName:'默认机器人',isDefault:true},onClose:()=>opened.value=null,'onSet-theme':setTheme}),
|
|
h(SettingsCenterDialog,{open:opened.value==='personal',initialPage:query.get('view')==='profile'?'account-profile':'appearance',isAdmin:!query.has('member'),botMode:true,userName:'samien',theme:theme.value==='dark'?'dark':'light',themePreference:theme.value,profiles:[{name:'default',agentName:'默认机器人',isDefault:true}],activeProfile:{name:'default',agentName:'默认机器人',isDefault:true},onClose:()=>opened.value=null,'onSet-theme':setTheme}),
|
|
|
])
|
|
])
|
|
|
}})
|
|
}})
|