Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Skye Yu
jensen
Commits
32ad41f9
Commit
32ad41f9
authored
Nov 10, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整测试页面
parent
5d3ca68c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
12 deletions
+85
-12
index.css
src/index.css
+72
-0
index.tsx
src/index.tsx
+13
-12
No files found.
src/index.css
View file @
32ad41f9
...
...
@@ -2,8 +2,80 @@
margin
:
0
;
padding
:
0
;
}
html
,
body
{
width
:
100%
;
height
:
100%
;
padding
:
0px
;
margin
:
0px
;
}
button
{
height
:
50px
;
font-size
:
14px
;
padding
:
0px
30px
;
border-radius
:
5px
;
outline
:
none
;
border
:
1px
solid
#ccc
;
}
#root
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
button
:hover
{
cursor
:
pointer
;
border
:
solid
1px
#999
;
}
.btn-container
{
display
:
flex
;
flex-direction
:
row
;
gap
:
16px
;
padding
:
16px
;
align-items
:
center
;
flex-wrap
:
wrap
;
/* 移除高度限制,保持自适应 */
}
/* 让#root成为flex容器,纵向排列,撑满body */
#root
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
}
/* result-container占据剩余空间 */
.result-container
{
display
:
flex
;
flex-direction
:
row
;
flex
:
1
1
0%
;
/* 占据剩余空间 */
width
:
100%
;
min-height
:
0
;
/* 防止溢出 */
padding
:
20px
;
box-sizing
:
border-box
;
}
.list-container
,
.log-container
{
height
:
100%
;
}
.list-container
{
width
:
50%
;
overflow
:
scroll
;
}
.log-container
{
width
:
50%
;
display
:
flex
;
flex-direction
:
column
;
}
.log-container
textarea
{
width
:
100%
;
height
:
100%
;
min-height
:
0
;
border
:
solid
1px
#ccc
;
border-radius
:
5px
;
outline
:
none
;
padding
:
5px
;
box-sizing
:
border-box
;
}
\ No newline at end of file
src/index.tsx
View file @
32ad41f9
...
...
@@ -124,17 +124,6 @@ export function Home() {
setDevices
(
devices
);
}
const
writeBluetoothDeviceList
=
async
()
=>
{
let
jensen
=
getJensen
();
if
(
jensen
==
null
)
return
;
let
macs
=
prompt
(
'Please Input the MACs (Separated by ","):'
,
'00:00:00:00:00:00'
);
if
(
macs
===
undefined
||
macs
===
null
)
return
;
let
macsList
=
macs
.
split
(
','
).
map
((
item
)
=>
item
.
trim
());
let
rst
=
await
jensen
.
writeBluetoothDeviceList
(
macsList
,
5
);
if
(
rst
==
null
||
rst
.
result
!=
'success'
)
return
alert
(
'write bluetooth device list failed.'
);
setGreeting
(
'write bluetooth device list success'
);
}
const
connect
=
async
()
=>
{
// await jensen.connect();
// alert(jensen.getModel() + ' connected')
...
...
@@ -439,6 +428,13 @@ export function Home() {
Logger
.
info
(
'jensen'
,
'settings'
,
'Get Settings: '
+
JSON
.
stringify
(
rst
));
}
const
getPairedDevices
=
async
()
=>
{
let
jensen
=
getJensen
();
if
(
jensen
==
null
)
return
;
let
devices
=
await
jensen
.
getPairedDevices
(
5
);
alert
(
JSON
.
stringify
(
devices
));
}
return
(
<>
<
div
className=
"btn-container"
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
...
...
@@ -452,7 +448,12 @@ export function Home() {
<
button
onClick=
{
bluetoothScan
}
>
Start Scan
</
button
>
<
button
onClick=
{
stopBluetoothScan
}
>
Stop Scan
</
button
>
<
button
onClick=
{
getScanResults
}
>
Scan Results
</
button
>
<
button
onClick=
{
writeBluetoothDeviceList
}
>
Write MACs
</
button
>
{
/*
<button onClick={getPairedDevices}>Paired Devices</button>
<button onClick={reconnectDevice}>Connect Device</button>
*/
}
<
button
onClick=
{
disconnectBTDevice
}
>
Disconnect
</
button
>
<
button
onClick=
{
updateDeviceTone
}
>
Update Tone
</
button
>
<
button
onClick=
{
updateUAC
}
>
Update UAC
</
button
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment