wip: conn list
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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>
|
||||
|
3
frontend/wailsjs/go/controller/App.d.ts
vendored
3
frontend/wailsjs/go/controller/App.d.ts
vendored
@ -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>;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user