From 63a101d1420af1575b75c9def596151a9f981b0b Mon Sep 17 00:00:00 2001 From: lxsang Date: Tue, 21 Sep 2021 10:22:46 +0200 Subject: [PATCH] update syslog client --- ServerLogClient/README.md | 1 + ServerLogClient/build/debug/README.md | 1 + ServerLogClient/build/debug/main.js | 2 +- ServerLogClient/build/debug/package.json | 2 +- .../build/release/ServerLogClient.zip | Bin 2984 -> 3015 bytes ServerLogClient/main.ts | 2 +- ServerLogClient/package.json | 2 +- packages.json | 2 +- 8 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ServerLogClient/README.md b/ServerLogClient/README.md index a3bd7e4..5948b8f 100644 --- a/ServerLogClient/README.md +++ b/ServerLogClient/README.md @@ -6,4 +6,5 @@ using Antunnel protocol. Features: * Recording last n log messages ## Change logs +* v0.1.1-b minor fix on dialog handling, fix incorrect package version * v0.1.0-b first beta version \ No newline at end of file diff --git a/ServerLogClient/build/debug/README.md b/ServerLogClient/build/debug/README.md index a3bd7e4..5948b8f 100644 --- a/ServerLogClient/build/debug/README.md +++ b/ServerLogClient/build/debug/README.md @@ -6,4 +6,5 @@ using Antunnel protocol. Features: * Recording last n log messages ## Change logs +* v0.1.1-b minor fix on dialog handling, fix incorrect package version * v0.1.0-b first beta version \ No newline at end of file diff --git a/ServerLogClient/build/debug/main.js b/ServerLogClient/build/debug/main.js index 0279a33..f08a561 100644 --- a/ServerLogClient/build/debug/main.js +++ b/ServerLogClient/build/debug/main.js @@ -1 +1 @@ -var OS;!function(t){let e;!function(t){class e extends t.BaseApplication{constructor(t){super("ServerLogClient",t)}check(t){return!(!this.filter.record||!this.filter[t.severity_label]||this.filter.pattern&&!t.message.match(this.filter.pattern))}log(t){if(this.check(t)){if(this.logs.length>=this.filter.max_log){let t=this.logs.shift();$(t.el).remove()}t.el=$("

").addClass(t.severity_label),t.el.text(t.message),$(this.log_container).append(t.el),this.log_container.scrollTop=this.log_container.scrollHeight,this.logs.push(t)}}openSession(){this.sub=new Antunnel.Subscriber(this.setting.topic),this.sub.onopen=()=>{console.log("Subscribed")},this.sub.onerror=t=>{this.error(__("Unable to connect to: syslog"),t),this.sub=void 0},this.sub.onmessage=t=>{if(t.data){let e=JSON.parse(new TextDecoder("utf-8").decode(t.data));e.priority&&(e.priority=parseInt(e.priority)),e.severity&&(e.severity=parseInt(e.severity)),e.facility&&(e.facility=parseInt(e.facility)),this.log(e)}},this.sub.onclose=()=>{this.sub=void 0,this.notify(__("Connection closed")),this.quit(!0)},this.tunnel.subscribe(this.sub)}cleanup(){this.sub&&this.sub.close()}checklib(){Antunnel.tunnel?(this.tunnel=Antunnel.tunnel,this.openSession()):this._gui.pushService("Antunnel/AntunnelService").then(t=>{let e=this.systemsetting.system.tunnel_uri;e||(this.error(__("Unable to connect to the tunnel")),this.quit(!0)),Antunnel.init(e).then(t=>{this.notify(__("Tunnel now connected to the server at: {0}",e)),this.tunnel=Antunnel.tunnel,this.openSession()}).catch(t=>{Antunnel.tunnel&&(Antunnel.tunnel.close(),this.error(__("Unable to connect to the tunnel: {0}",t.toString()),t),this.quit(!0))})}).catch(t=>{this.error(__("Unable to run Antunnel service: {0}",t.toString()),t),this.quit(!0)})}main(){if(!Antunnel)return this.error(__("Antunnel library is not available")),void this.quit(!0);this.log_container=this.find("log-container"),this.logs=[],$(this.log_container).css("overflow-y","auto"),this.find("menu-level").items=[{text:__("Default level"),nodes:[{text:__("Debug"),switch:!0,checked:!0,severity:"debug"},{text:__("Notice"),switch:!0,checked:!0,severity:"notice"},{text:__("Info"),switch:!0,checked:!0,severity:"info"},{text:__("Warning"),switch:!0,checked:!0,severity:"warning"},{text:__("Error"),switch:!0,checked:!0,severity:"err"},{text:__("Critical"),switch:!0,checked:!0,severity:"crit"},{text:__("Alert"),switch:!0,checked:!0,severity:"alert"},{text:__("Emergency"),switch:!0,checked:!0,severity:"emerg"}],onchildselect:t=>{let e=t.data.item.data;this.filter[e.severity]=e.checked}}],this.filter={max_log:500,err:!0,emerg:!0,debug:!0,info:!0,notice:!0,warning:!0,crit:!0,alert:!0,pattern:void 0,record:!0};let t=this.find("txt-n-log");t.value=this.filter.max_log.toString(),$(t).on("keyup",e=>{if("Enter"===e.key){let e=parseInt(t.value);if(!isNaN(e))for(this.filter.max_log=e;this.logs.length>e;)this.logs.shift().el.remove();t.value=this.filter.max_log.toString()}}),this.find("btn-clear").onbtclick=()=>{this.logs=[],$(this.log_container).empty()};let e=this.find("txt-reg");$(e).on("keyup",t=>{if("Enter"===t.key){if(""===e.value.trim())return this.filter.pattern=void 0;try{this.filter.pattern=new RegExp(e.value,"g")}catch(t){this.error(__("Invalid regular expression: {0}",t.toString()),t),this.filter.pattern=void 0,e.value=""}}}),this.find("sw-record").onswchange=t=>{this.filter.record=t.data},this.setting.topic?this.checklib():this._gui.openDialog("PromptDialog",{title:__("Enter topic name"),label:__("Please enter Antunnel topic name")}).then(t=>{this.setting.topic=t,this.checklib()})}}t.ServerLogClient=e,e.dependencies=["pkg://Antunnel/main.js"],e.singleton=!0}(e=t.application||(t.application={}))}(OS||(OS={})); \ No newline at end of file +var OS;!function(t){let e;!function(t){class e extends t.BaseApplication{constructor(t){super("ServerLogClient",t)}check(t){return!(!this.filter.record||!this.filter[t.severity_label]||this.filter.pattern&&!t.message.match(this.filter.pattern))}log(t){if(this.check(t)){if(this.logs.length>=this.filter.max_log){let t=this.logs.shift();$(t.el).remove()}t.el=$("

").addClass(t.severity_label),t.el.text(t.message),$(this.log_container).append(t.el),this.log_container.scrollTop=this.log_container.scrollHeight,this.logs.push(t)}}openSession(){this.sub=new Antunnel.Subscriber(this.setting.topic),this.sub.onopen=()=>{console.log("Subscribed")},this.sub.onerror=t=>{this.error(__("Unable to connect to: syslog"),t),this.sub=void 0},this.sub.onmessage=t=>{if(t.data){let e=JSON.parse(new TextDecoder("utf-8").decode(t.data));e.priority&&(e.priority=parseInt(e.priority)),e.severity&&(e.severity=parseInt(e.severity)),e.facility&&(e.facility=parseInt(e.facility)),this.log(e)}},this.sub.onclose=()=>{this.sub=void 0,this.notify(__("Connection closed")),this.quit(!0)},this.tunnel.subscribe(this.sub)}cleanup(){this.sub&&this.sub.close()}checklib(){Antunnel.tunnel?(this.tunnel=Antunnel.tunnel,this.openSession()):this._gui.pushService("Antunnel/AntunnelService").then(t=>{let e=this.systemsetting.system.tunnel_uri;e||(this.error(__("Unable to connect to the tunnel")),this.quit(!0)),Antunnel.init(e).then(t=>{this.notify(__("Tunnel now connected to the server at: {0}",e)),this.tunnel=Antunnel.tunnel,this.openSession()}).catch(t=>{Antunnel.tunnel&&(Antunnel.tunnel.close(),this.error(__("Unable to connect to the tunnel: {0}",t.toString()),t),this.quit(!0))})}).catch(t=>{this.error(__("Unable to run Antunnel service: {0}",t.toString()),t),this.quit(!0)})}main(){if(!Antunnel)return this.error(__("Antunnel library is not available")),void this.quit(!0);this.log_container=this.find("log-container"),this.logs=[],$(this.log_container).css("overflow-y","auto"),this.find("menu-level").items=[{text:__("Default level"),nodes:[{text:__("Debug"),switch:!0,checked:!0,severity:"debug"},{text:__("Notice"),switch:!0,checked:!0,severity:"notice"},{text:__("Info"),switch:!0,checked:!0,severity:"info"},{text:__("Warning"),switch:!0,checked:!0,severity:"warning"},{text:__("Error"),switch:!0,checked:!0,severity:"err"},{text:__("Critical"),switch:!0,checked:!0,severity:"crit"},{text:__("Alert"),switch:!0,checked:!0,severity:"alert"},{text:__("Emergency"),switch:!0,checked:!0,severity:"emerg"}],onchildselect:t=>{let e=t.data.item.data;this.filter[e.severity]=e.checked}}],this.filter={max_log:500,err:!0,emerg:!0,debug:!0,info:!0,notice:!0,warning:!0,crit:!0,alert:!0,pattern:void 0,record:!0};let t=this.find("txt-n-log");t.value=this.filter.max_log.toString(),$(t).on("keyup",e=>{if("Enter"===e.key){let e=parseInt(t.value);if(!isNaN(e))for(this.filter.max_log=e;this.logs.length>e;)this.logs.shift().el.remove();t.value=this.filter.max_log.toString()}}),this.find("btn-clear").onbtclick=()=>{this.logs=[],$(this.log_container).empty()};let e=this.find("txt-reg");$(e).on("keyup",t=>{if("Enter"===t.key){if(""===e.value.trim())return this.filter.pattern=void 0;try{this.filter.pattern=new RegExp(e.value,"g")}catch(t){this.error(__("Invalid regular expression: {0}",t.toString()),t),this.filter.pattern=void 0,e.value=""}}}),this.find("sw-record").onswchange=t=>{this.filter.record=t.data},this.setting.topic?this.checklib():this.openDialog("PromptDialog",{title:__("Enter topic name"),label:__("Please enter Antunnel topic name")}).then(t=>{this.setting.topic=t,this.checklib()})}}t.ServerLogClient=e,e.dependencies=["pkg://Antunnel/main.js"],e.singleton=!0}(e=t.application||(t.application={}))}(OS||(OS={})); \ No newline at end of file diff --git a/ServerLogClient/build/debug/package.json b/ServerLogClient/build/debug/package.json index 3981372..ae8535d 100644 --- a/ServerLogClient/build/debug/package.json +++ b/ServerLogClient/build/debug/package.json @@ -7,7 +7,7 @@ "author": "", "email": "" }, - "version":"0.0.1-b", + "version":"0.1.1-b", "category":"System", "iconclass":"bi bi-receipt-cutoff", "mimes":["none"], diff --git a/ServerLogClient/build/release/ServerLogClient.zip b/ServerLogClient/build/release/ServerLogClient.zip index c40036911a81c5b60fe9767237b69395fcf1f7e5..92f741b4aaa4d93044d44b7f9480f10dba428227 100644 GIT binary patch delta 916 zcmZ1>eq5Y4z?+$ci-CcGgJF@A=|rM&meuhjW&xp1HV>_*GFEe0Eo@rTzr*<3f&+ZRwKwC3-wbl#GMPcEwc zW#d;W&D@a4*SNE&^Tsrp?XTrw0l^9miOqtXd5oe+K@+S|=zp@Bm4Tst^Atud*80u+ zSnH=8;@=nVwDaV{^esL0a^IoOno&O2Cw(SMR2kT|6HozHaHV|2KYIJGOcvl!u9tB?8&;V$ z)inB;2D4gv71tfb154!563RkpQyU1QpPdT+uNX(X9(EEwevF#$0Ryr=3mukIs`XR$5 z^Y6@dG(T;{y8Obr!=+~VFJoj+pXxuH@Ub9gSJdiIro)Lb3y#k?u=iW0T5f1h1N^#i3lGw_9UfeZ&1JY)TvAxlg1o=1M;sdF_I>2-- z69YqWaz<)ys$ND(ZVtLec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Client/main.ts index e6d41aa..337e024 100644 --- a/ServerLogClient/main.ts +++ b/ServerLogClient/main.ts @@ -310,7 +310,7 @@ namespace OS { } if(!this.setting.topic) { - this._gui.openDialog("PromptDialog", { + this.openDialog("PromptDialog", { title: __("Enter topic name"), label: __("Please enter Antunnel topic name") }) diff --git a/ServerLogClient/package.json b/ServerLogClient/package.json index 3981372..ae8535d 100644 --- a/ServerLogClient/package.json +++ b/ServerLogClient/package.json @@ -7,7 +7,7 @@ "author": "", "email": "" }, - "version":"0.0.1-b", + "version":"0.1.1-b", "category":"System", "iconclass":"bi bi-receipt-cutoff", "mimes":["none"], diff --git a/packages.json b/packages.json index e2d172f..70c9515 100644 --- a/packages.json +++ b/packages.json @@ -335,7 +335,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ServerLogClient/README.md", "category": "System", "author": "", - "version": "0.0.1-b", + "version": "0.1.1-b", "dependencies": ["Antunnel@0.1.8-a"], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ServerLogClient/build/release/ServerLogClient.zip" },