allow to store topic name in setting

This commit is contained in:
lxsang 2021-01-15 20:38:55 +01:00
parent d8f999749a
commit e45e8dd5b1
6 changed files with 21 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
"dependencies": [
"Antunnel@0.1.8-a"
],
"version":"0.1.5-a",
"version":"0.1.6-a",
"category":"Other",
"iconclass":"fa fa-android",
"mimes":["none"],

View File

@ -12,6 +12,9 @@ class SysmondService extends OS.application.BaseService
#]
@onmenuselect = (e) => @openApp()
setting: () ->
return @systemsetting.applications["SystemControl"]
init: () ->
checklib = () =>
if not Antunnel.tunnel
@ -21,8 +24,9 @@ class SysmondService extends OS.application.BaseService
@error e.toString(), e
@quit()
else
return unless @setting().topic
@tunnel = Antunnel.tunnel
@sub = new Antunnel.Subscriber("fbf070ddea3ea90d07f456540b405d302554ec82")
@sub = new Antunnel.Subscriber(@setting().topic)
@sub.onopen = () =>
#@sub.send Antunnel.Msg.DATA, new TextEncoder("utf-8").encode("Hello")
console.log("Subscribed to notification channel")
@ -44,6 +48,16 @@ class SysmondService extends OS.application.BaseService
@quit()
Antunnel.tunnel.subscribe @sub
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()

View File

@ -13,7 +13,7 @@
"dependencies": [
"Antunnel@0.1.8-a"
],
"version":"0.1.5-a",
"version":"0.1.6-a",
"category":"Other",
"iconclass":"fa fa-android",
"mimes":["none"],

View File

@ -235,8 +235,8 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/README.md",
"category": "Other",
"author": "",
"version": "0.1.5-a",
"dependencies": ["Antunnel@0.1.8-a"],"version":"0.1.5-a","category":"Other","iconclass":"fafa-android","mimes":["none"],
"version": "0.1.6-a",
"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"
},
{