Добавил сервисную страницу, небольшой рефакторинг

This commit is contained in:
2018-08-14 20:24:20 +02:00
parent b6001e4e81
commit 76786176d2
6 changed files with 89 additions and 21 deletions

View File

@@ -37,8 +37,8 @@ QtObject {
_get(root.serviceUrl + '/static/channels.js', root.modelLoad)
}
function switchChannel(channelId) {
_get(root.serviceUrl + '/noolite/switch/%1'.arg(channelId), function (data) {
function sendCommand(command, channelId) {
_get(root.serviceUrl + '/noolite/%1/%2'.arg(command).arg(channelId), function (data) {
if (data.error) {
root.error(qsTr("Server error: %1").arg(data.error))
return