Skip to content

Commit

Permalink
fix(ui): overflow of tabs in mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 23, 2021
1 parent 9fcc8e0 commit 6806907
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
18 changes: 15 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ function setupSocket (server) {
err = error.message
}

const result = { success: !err, message: err || 'Success MQTT api call', result: res }
const result = {
success: !err,
message: err || 'Success MQTT api call',
result: res
}
result.api = data.api

socket.emit(socketEvents.api, result)
Expand Down Expand Up @@ -398,15 +402,23 @@ function setupSocket (server) {
res = gw.zwave.addDevice(data.device, data.nodeId)
break
case 'store':
res = await gw.zwave.storeDevices(data.devices, data.nodeId, data.remove)
res = await gw.zwave.storeDevices(
data.devices,
data.nodeId,
data.remove
)
break
}
} catch (error) {
logger.error('Error while calling HASS api', error)
err = error.message
}

const result = { success: !err, message: err || 'Success HASS api call', result: res }
const result = {
success: !err,
message: err || 'Success HASS api call',
result: res
}
result.api = data.apiName

socket.emit(socketEvents.api, result)
Expand Down
8 changes: 6 additions & 2 deletions lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,9 @@ Gateway.prototype.discoverValue = function (node, vId) {
Gateway.prototype.updateNodeTopics = function (nodeId) {
const node = this.zwave.nodes[nodeId]
if (node) {
const topics = Object.keys(this.topicValues).filter(k => this.topicValues[k].nodeId === node.id)
const topics = Object.keys(this.topicValues).filter(
k => this.topicValues[k].nodeId === node.id
)

for (const t of topics) {
const valueId = this.topicValues[t]
Expand All @@ -2145,7 +2147,9 @@ Gateway.prototype.updateNodeTopics = function (nodeId) {
Gateway.prototype.removeNodeRetained = function (nodeId) {
const node = this.zwave.nodes[nodeId]
if (node) {
const topics = Object.keys(node.values).map(v => this.valueTopic(node, node.values[v]))
const topics = Object.keys(node.values).map(v =>
this.valueTopic(node, node.values[v])
)

for (const t of topics) {
this.mqtt.publish(t, '', { retain: true })
Expand Down
4 changes: 2 additions & 2 deletions src/components/ValueId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
v-model.number="value.newValue.value"
></v-text-field>
<v-select
style="margin-left:10px;min-width:100px;width:135px"
style="margin-left:10px;min-width:105px;width:135px"
:items="durations"
v-model="value.newValue.unit"
:readonly="!value.writeable || disable_send"
Expand Down Expand Up @@ -104,7 +104,7 @@
></v-select>

<div v-if="value.type == 'boolean' && value.writeable && value.readable">
<v-btn-toggle v-model="value.newValue" rounded>
<v-btn-toggle class="mt-4" v-model="value.newValue" rounded>
<v-btn
outlined
height="40px"
Expand Down
2 changes: 1 addition & 1 deletion src/components/nodes-table/ExpandedNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<v-tab key="node">Node</v-tab>
<v-tab v-if="showHass" key="homeassistant">Home Assistant</v-tab>
<v-tab key="groups">Groups</v-tab>
<v-tab key="debug">Debug Info</v-tab>
<v-tab v-if="$vuetify.mdAndUp" key="debug">Debug Info</v-tab>

<!-- TABS -->
<v-tabs-items
Expand Down

0 comments on commit 6806907

Please sign in to comment.