mirror of
https://github.com/koush/scrypted.git
synced 2026-04-26 18:00:21 +01:00
32 lines
753 B
Vue
32 lines
753 B
Vue
<template>
|
|
<span>
|
|
<font-awesome-icon class="white--text mr-1 mr-1" size="sm" :icon="batteryIcon" color="#a9afbb" />
|
|
<span class="caption mr-1">{{ lazyValue.batteryLevel }}%</span>
|
|
</span>
|
|
</template>
|
|
|
|
<script>
|
|
import RPCInterface from "./RPCInterface.vue";
|
|
|
|
export default {
|
|
mixins: [RPCInterface],
|
|
computed: {
|
|
batteryIcon() {
|
|
if (this.lazyValue.batteryLevel > 80) {
|
|
return "battery-full";
|
|
}
|
|
if (this.lazyValue.batteryLevel > 60) {
|
|
return "battery-three-quarters";
|
|
}
|
|
if (this.lazyValue.batteryLevel > 40) {
|
|
return "battery-half";
|
|
}
|
|
if (this.lazyValue.batteryLevel > 20) {
|
|
return "battery-quarter";
|
|
}
|
|
return "battery-empty";
|
|
}
|
|
}
|
|
};
|
|
</script>
|