mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-08 06:28:29 +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": [
|
||||
"Antunnel@0.1.8-a"
|
||||
],
|
||||
"version":"0.1.5-a",
|
||||
"version":"0.1.6-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-android",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@ -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,7 +48,17 @@ class SysmondService extends OS.application.BaseService
|
||||
@quit()
|
||||
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: () ->
|
||||
|
@ -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"],
|
||||
|
@ -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"
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user