Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
willie68 committed Jul 4, 2021
2 parents edfa460 + 3ab955a commit 322d74a
Show file tree
Hide file tree
Showing 51 changed files with 2,024 additions and 868 deletions.
1,111 changes: 375 additions & 736 deletions README.md

Large diffs are not rendered by default.

1,303 changes: 1,303 additions & 0 deletions READMEwYAML.md

Large diffs are not rendered by default.

Binary file modified documentation/README.pdf
Binary file not shown.
Binary file added documentation/assets/counter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/cpu_load.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/daysremain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/assets/dice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/hm_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/ohm_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/philips_hue_config_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/wc_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/wc_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/wz_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion install/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define MyAppName "ReCoS"
;version number set by GoVersionSetter.
#define MyAppVersion "0.1.80"
#define MyAppVersion "0.3.90"
#define MyAppPublisher "MCS Media Computer Software"
#define MyAppURL "https://www.wk-music.de"
#define MyAppExeName "recos-service.exe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>sd_logo.ico</ApplicationIcon>
<Version>0.1.80</Version>
<Version>0.3.90</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
59 changes: 59 additions & 0 deletions service/api/routes/configapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package routes

import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"image"
"image/png"
"io"
"mime"
"net"
"net/http"
"os"
"path/filepath"
Expand All @@ -18,6 +20,7 @@ import (

"github.com/go-chi/chi"
"github.com/go-chi/render"
"github.com/skip2/go-qrcode"
"github.com/srwiley/oksvg"
"github.com/srwiley/rasterx"
"gopkg.in/yaml.v3"
Expand Down Expand Up @@ -51,6 +54,7 @@ func ConfigRoutes() *chi.Mux {
router.Get("/integrations", GetInteg)
router.With(handler.AuthCheck()).Post("/integrations/{integname}", PostInteg)
router.Get("/credits", GetCredits)
router.Get("/networks", GetNetworks)
initIconMapper()
return router
}
Expand Down Expand Up @@ -389,3 +393,58 @@ func GetCredits(response http.ResponseWriter, request *http.Request) {
io.Copy(response, r)
}
}

type IpName struct {
Name string
IP string
Local bool
URL string
QRCode string
}

func GetNetworks(response http.ResponseWriter, request *http.Request) {
ips := getNetworkList()
render.JSON(response, request, ips)
}

func startQRCode(url string) (string, error) {
bytes, err := qrcode.Encode(url, qrcode.Medium, 256)
if err != nil {
return "", err
}

return fmt.Sprintf("data:image/png;base64,%s", base64.StdEncoding.EncodeToString(bytes)), nil
}

func getNetworkList() []IpName {
ips := make([]IpName, 0)
ifaces, _ := net.Interfaces()
// handle err
for _, i := range ifaces {
addrs, _ := i.Addrs()
// handle err
for _, addr := range addrs {
var ip net.IP
switch v := addr.(type) {
case *net.IPNet:
ip = v.IP
case *net.IPAddr:
ip = v.IP
}
if strings.Contains(i.Flags.String(), "up") && ip.IsGlobalUnicast() && !ip.IsLoopback() {
url := fmt.Sprintf("http://%s:%d/webclient", ip, config.Get().Port)
qrcode, _ := startQRCode(url)
ipName := IpName{
Name: i.Name,
IP: ip.String(),
Local: ip.IsLoopback(),
URL: url,
QRCode: qrcode,
}
ips = append(ips, ipName)
}
}
}

return ips
}
2 changes: 1 addition & 1 deletion service/cmd/Service.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func onReady() {
}

createMenu()

go func() {
processMenu()
}()
Expand Down Expand Up @@ -466,7 +467,6 @@ func onReady() {
}
}()
}

clog.Logger.Infof("start web client: http://localhost:%d/webclient", serviceConfig.Port)
clog.Logger.Infof("start admin client: http://localhost:%d/webadmin", serviceConfig.Port)

Expand Down
5 changes: 2 additions & 3 deletions service/configs/serviceLocal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ extconfig:
updateperiod: 5
url: http://192.168.178.80
obs:
active: true
active: false
host: 127.0.0.1
password: "akteon00"
password: akteon00
port: 4444
openhardwaremonitor:
active: false
Expand All @@ -40,4 +40,3 @@ extconfig:
logging:
level: debug
filename: ./devdata/logging.log

4 changes: 2 additions & 2 deletions service/devdata/oldprofiles/1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ actions:
icon: ""
title: ""
parameters:
analog: true
graphical: true
args: []
color: ""
command: notepad.exe
Expand Down Expand Up @@ -183,7 +183,7 @@ actions:
icon: ""
title: ""
parameters:
analog: true
graphical: true
color: ff0022
dateformat: ""
design: digital
Expand Down
4 changes: 2 additions & 2 deletions service/devdata/oldprofiles/aaa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ actions:
icon: ""
title: ""
parameters:
analog: false
graphical: false
format: "15:04:05\r\n02 Jan 06"
actions: []
- type: DISPLAY
Expand All @@ -449,7 +449,7 @@ actions:
icon: ""
title: ""
parameters:
analog: true
graphical: true
format: "15:04:05\r\n02 Jan 06"
actions: []
- type: SINGLE
Expand Down
2 changes: 1 addition & 1 deletion service/devdata/oldprofiles/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ actions:
icon: ""
title: ""
parameters:
analog: true
graphical: true
format: "15:04:05\r\n02 Jan 06"
actions: []
- type: SINGLE
Expand Down
10 changes: 5 additions & 5 deletions service/devdata/oldprofiles/newClocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ actions:
title: ""
parameters:
format: "02-01"
analog: true
graphical: true
design: digital
showseconds: false
color: "#00ff00"
Expand All @@ -55,7 +55,7 @@ actions:
title: ""
parameters:
format: "02-01"
analog: true
graphical: true
design: digital
showseconds: true
color: "#ff0000"
Expand All @@ -78,7 +78,7 @@ actions:
title: ""
parameters:
format: "02-01"
analog: true
graphical: true
design: analog
showseconds: true
showdate: true
Expand All @@ -102,7 +102,7 @@ actions:
title: ""
parameters:
format: "02-01"
analog: true
graphical: true
design: berlin
showseconds: true
showdate: true
Expand All @@ -126,7 +126,7 @@ actions:
title: ""
parameters:
format: "02-01"
analog: true
graphical: true
design: roman
showseconds: true
showdate: true
Expand Down
2 changes: 1 addition & 1 deletion service/devdata/oldprofiles/williehome.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ actions:
name: clock
parameters:
format: "15:04:05\r\n02 Jan 06"
analog: true
graphical: true
34 changes: 27 additions & 7 deletions service/devdata/profiles/aaa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ pages:
- ""
- ""
- obsscene_0
- dice_1
- ""
- ""
- ""
- ""
- dice_1
- obsscene_1
- obsscene_2
- obsscene_3
Expand Down Expand Up @@ -198,7 +198,7 @@ actions:
actions: []
- type: SINGLE
name: obsscenecollection_0
title: ""
title: ' '
icon: backgrounds.svg
description: new OBSSCENECOLLECTION action created by ActionWizard
fontsize: 10
Expand Down Expand Up @@ -245,7 +245,7 @@ actions:
outlined: false
runone: true
commands:
- id: ""
- id: OBSSCENE_10
type: OBSSCENE
name: obsscene_1
description: new OBSSCENE command created by ActionWizard
Expand All @@ -265,7 +265,7 @@ actions:
outlined: false
runone: true
commands:
- id: ""
- id: OBSSCENE_11
type: OBSSCENE
name: obsscene_2
description: new OBSSCENE command created by ActionWizard
Expand All @@ -284,7 +284,7 @@ actions:
outlined: false
runone: true
commands:
- id: ""
- id: OBSSCENE_12
type: OBSSCENE
name: obsscene_3
description: new OBSSCENE command created by ActionWizard
Expand All @@ -303,7 +303,7 @@ actions:
outlined: false
runone: true
commands:
- id: ""
- id: OBSSCENE_13
type: OBSSCENE
name: obsscene_4
description: new OBSSCENE command created by ActionWizard
Expand All @@ -312,3 +312,23 @@ actions:
parameters:
scenecommand: previous
actions: []
- type: SINGLE
name: dice_1
title: ' '
icon: games_dice.svg
description: new DICE action created by ActionWizard
fontsize: 10
fontcolor: '#000000'
outlined: false
runone: true
commands:
- id: ""
type: DICE
name: dice_1
description: new DICE command created by ActionWizard
icon: ""
title: ""
parameters:
scenecommand: first
sides: 6
actions: []
2 changes: 1 addition & 1 deletion service/devdata/profiles/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ actions:
icon: ""
title: ""
parameters:
analog: true
graphical: true
format: "15:04:05\r\n02 Jan 06"
actions: []
- type: SINGLE
Expand Down
4 changes: 2 additions & 2 deletions service/devdata/profiles/streamdeck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ actions:
icon: ""
title: ""
parameters:
analog: true
graphical: true
format: "15:04:05\r\n02 Jan 06"
showseconds: true
actions: []
Expand Down Expand Up @@ -224,7 +224,7 @@ actions:
icon: ""
title: clock
parameters:
analog: true
graphical: true
design: berlin2
actions: []
- type: SINGLE
Expand Down
2 changes: 2 additions & 0 deletions service/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require (
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/onsi/gomega v1.10.1 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/pflag v1.0.5
github.com/sqweek/dialog v0.0.0-20200911184034-8a3d98e8211d
Expand All @@ -55,4 +56,5 @@ require (
)

replace github.com/amimof/huego v1.2.0 => ../../huego

replace github.com/muesli/go-obs-websocket v0.0.0-20200216195805-501318ebaadb => ../../../ext-git-sources/go-obs-websocket2
2 changes: 2 additions & 0 deletions service/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand Down
Loading

0 comments on commit 322d74a

Please sign in to comment.