mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 12:51:54 +05:30
feat: show battery energy rate
This commit is contained in:
@@ -7,6 +7,7 @@ export const Battery = () => {
|
|||||||
const percentage = createBinding(battery, "percentage");
|
const percentage = createBinding(battery, "percentage");
|
||||||
const charging = createBinding(battery, "charging");
|
const charging = createBinding(battery, "charging");
|
||||||
const state = createBinding(battery, "state");
|
const state = createBinding(battery, "state");
|
||||||
|
const energyRate = createBinding(battery, "energyRate");
|
||||||
|
|
||||||
const chargingIcon = createComputed(
|
const chargingIcon = createComputed(
|
||||||
[percentage, charging, state],
|
[percentage, charging, state],
|
||||||
@@ -29,6 +30,7 @@ export const Battery = () => {
|
|||||||
>
|
>
|
||||||
<image iconName={chargingIcon} />
|
<image iconName={chargingIcon} />
|
||||||
<label label={percentage((p) => `${Math.floor(p * 100)}%`)} />
|
<label label={percentage((p) => `${Math.floor(p * 100)}%`)} />
|
||||||
|
<label label={energyRate((v) => `${Math.floor(v * 10) / 10}W`)} />
|
||||||
</box>
|
</box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user