mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-26 04:08:21 +01:00
allow to store topic name in setting
This commit is contained in:
parent
d8f999749a
commit
e45e8dd5b1
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
"Antunnel@0.1.8-a"
|
"Antunnel@0.1.8-a"
|
||||||
],
|
],
|
||||||
"version":"0.1.5-a",
|
"version":"0.1.6-a",
|
||||||
"category":"Other",
|
"category":"Other",
|
||||||
"iconclass":"fa fa-android",
|
"iconclass":"fa fa-android",
|
||||||
"mimes":["none"],
|
"mimes":["none"],
|
||||||
|
Binary file not shown.
@ -12,6 +12,9 @@ class SysmondService extends OS.application.BaseService
|
|||||||
#]
|
#]
|
||||||
@onmenuselect = (e) => @openApp()
|
@onmenuselect = (e) => @openApp()
|
||||||
|
|
||||||
|
setting: () ->
|
||||||
|
return @systemsetting.applications["SystemControl"]
|
||||||
|
|
||||||
init: () ->
|
init: () ->
|
||||||
checklib = () =>
|
checklib = () =>
|
||||||
if not Antunnel.tunnel
|
if not Antunnel.tunnel
|
||||||
@ -21,8 +24,9 @@ class SysmondService extends OS.application.BaseService
|
|||||||
@error e.toString(), e
|
@error e.toString(), e
|
||||||
@quit()
|
@quit()
|
||||||
else
|
else
|
||||||
|
return unless @setting().topic
|
||||||
@tunnel = Antunnel.tunnel
|
@tunnel = Antunnel.tunnel
|
||||||
@sub = new Antunnel.Subscriber("fbf070ddea3ea90d07f456540b405d302554ec82")
|
@sub = new Antunnel.Subscriber(@setting().topic)
|
||||||
@sub.onopen = () =>
|
@sub.onopen = () =>
|
||||||
#@sub.send Antunnel.Msg.DATA, new TextEncoder("utf-8").encode("Hello")
|
#@sub.send Antunnel.Msg.DATA, new TextEncoder("utf-8").encode("Hello")
|
||||||
console.log("Subscribed to notification channel")
|
console.log("Subscribed to notification channel")
|
||||||
@ -44,7 +48,17 @@ class SysmondService extends OS.application.BaseService
|
|||||||
@quit()
|
@quit()
|
||||||
Antunnel.tunnel.subscribe @sub
|
Antunnel.tunnel.subscribe @sub
|
||||||
|
|
||||||
checklib()
|
if not @setting().topic
|
||||||
|
console.log "Open dialog"
|
||||||
|
@_gui.openDialog("PromptDialog", {
|
||||||
|
title: __("Enter topic name"),
|
||||||
|
label: __("Please enter topic name")
|
||||||
|
})
|
||||||
|
.then (v) =>
|
||||||
|
@setting().topic = v
|
||||||
|
checklib()
|
||||||
|
else
|
||||||
|
checklib()
|
||||||
|
|
||||||
|
|
||||||
openApp: () ->
|
openApp: () ->
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
"Antunnel@0.1.8-a"
|
"Antunnel@0.1.8-a"
|
||||||
],
|
],
|
||||||
"version":"0.1.5-a",
|
"version":"0.1.6-a",
|
||||||
"category":"Other",
|
"category":"Other",
|
||||||
"iconclass":"fa fa-android",
|
"iconclass":"fa fa-android",
|
||||||
"mimes":["none"],
|
"mimes":["none"],
|
||||||
|
@ -235,8 +235,8 @@
|
|||||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/README.md",
|
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/README.md",
|
||||||
"category": "Other",
|
"category": "Other",
|
||||||
"author": "",
|
"author": "",
|
||||||
"version": "0.1.5-a",
|
"version": "0.1.6-a",
|
||||||
"dependencies": ["Antunnel@0.1.8-a"],"version":"0.1.5-a","category":"Other","iconclass":"fafa-android","mimes":["none"],
|
"dependencies": ["Antunnel@0.1.8-a"],"version":"0.1.6-a","category":"Other","iconclass":"fafa-android","mimes":["none"],
|
||||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/build/release/SystemControl.zip"
|
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/build/release/SystemControl.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user