wip: conn list

This commit is contained in:
zhaoyupeng
2024-09-30 09:16:11 +08:00
parent b2c13508f4
commit bea30130f1
11 changed files with 155 additions and 15 deletions

View File

@ -48,3 +48,14 @@ div.body-connections-search-dismiss{
justify-content: center;
align-items: center;
}
div.body-connections-list-item {
height: 36px;
display: flex;
align-items: center;
font-size: 14px;
margin: 1px 0;
}
div.body-connections-list-item:first-child {
margin-top: 8px;
}

View File

@ -26,6 +26,18 @@ function Home() {
})
}, []);
async function handleConnect(item: Connection) {
console.log('[DEBUG] double clicked item =', item)
let res = await Dial<unknown>("/api/connection/connect", {id: item.id})
if (res.status === 200) {
connectionList.forEach((conn) => {
if (conn.id === item.id) {
conn.active = true
}
})
}
}
return (
<div className="container">
<div className="header">
@ -47,7 +59,18 @@ function Home() {
<DismissRegular/>
</div>
</div>
<div className="body-connections-list"></div>
<div className="body-connections-list">
{connectionList.map(item => {
return <div className="body-connections-list-item" key={item.id}>
<Button
onDoubleClick={() => {
handleConnect(item)
}}
appearance='transparent' style={{textIndent: '0px', justifyContent: 'left'}}
>{item.name}</Button>
</div>
})}
</div>
</div>
<div className="body-content"></div>
</div>

View File

@ -1,4 +1,7 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {context} from '../models';
export function Init(arg1:context.Context):Promise<void>;
export function Invoke(arg1:string,arg2:string):Promise<string>;

View File

@ -2,6 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Init(arg1) {
return window['go']['controller']['App']['Init'](arg1);
}
export function Invoke(arg1, arg2) {
return window['go']['controller']['App']['Invoke'](arg1, arg2);
}