Skip to content

Commit

Permalink
Merge pull request #111 from mStirner/dev
Browse files Browse the repository at this point in the history
Working on issues
  • Loading branch information
mStirner committed Dec 30, 2023
2 parents dfad506 + 50dd7cc commit cc02a15
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 254 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Docker nightly image

on:
push:
branches: [dev]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: github.repository == 'OpenHausIO/frontend'
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm ci
- run: npm run build

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: openhaus/frontend

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: openhaus/frontend:nightly
labels: ${{ steps.meta.outputs.labels }}
8 changes: 7 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@ export const settingsStore = defineStore("settings", {
showGradientBackground: true,
editDashboardWidgets: false,
showDashboardWidgets: true,
transparentDashboardWidgets: false,
transparentDashboardWidgets: true,
screensaverOverlayDelay: 30,
enableScreenSaverOverlay: false,
jumpToOnlyEndpointSet: true,
showParameterInCommands: true,
showCommandStatesCounter: true,
dashboardGrid: {
cols: 12,
rows: 30
},
urls: {
registry: "http://registry.open-haus.io",
adminUi: `/admin`
},
startpage: "/dashboard",
}
},
Expand Down
41 changes: 18 additions & 23 deletions src/views/Command-parameter.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import CommandParameter from "@/components/CommandParameter.vue";
import { useRoute } from "vue-router";
import { debounce } from "../helper";
import { debounce, request } from "../helper";
</script>

<script>
Expand Down Expand Up @@ -50,32 +50,27 @@ export default {
},
methods: {
...mapActions(itemStore, ["getRoomNameById", "getDeviceNameById"]),
debounce: debounce((param) => {
console.log(
"Trigger command",
param,
this.data.name,
this.data.params,
useRoute()
);
// NOTE:
// cant use `let $route = useRoute(); here`
// it allways returns undefine, thats the reason
// for this hacky "this.endpoint" thing
trigger: debounce(function (param) {
console.log("Aasdflaksdfleila", JSON.stringify([{
key: param.key,
value: param.value
}]))
request(`/api/endpoints/${this.endpoint._id}/commands/${this.data._id}`, {
method: "POST",
body: this.data,
}, (err, body) => {
console.log("Trigger response", err, body);
headers: {
"content-type": "application/json"
},
body: JSON.stringify([{
key: param.key,
value: param.value
}])
}, (err, result) => {
console.log(err, result);
});
}, 500),
trigger(param) {
console.log("trigger called", param);
this.debounce(param);
},
}, 10)
},
};
</script>
Expand Down Expand Up @@ -113,7 +108,7 @@ export default {
<div class="row display-flex text-center" v-bind:key="index" v-for="(param, index) in data.params">
<div class="p-0 col-6 col-md-3 col-xl-2">

<CommandParameter :param="param" @changed="trigger(data)"></CommandParameter>
<CommandParameter :param="param" @changed="trigger(param)"></CommandParameter>

</div>
</div>
Expand Down

0 comments on commit cc02a15

Please sign in to comment.