/* This code snippet is taken from from the 'gettingStarted' BajaScript tutorial. More information can be found by navigating to this ORD... module://docDeveloper/doc/jsdoc/bajaux-ux/tutorial-gettingStarted.html */ // Subscribe to a Ramp. When it changes, print out the results. require(['baja!'], function (baja) { "use strict"; // A Subscriber is used to listen to Component events in Niagara. var sub = new baja.Subscriber(); // This shows a dialog. The function passed into 'showOk' is used to generate the dialog // box's content. // dialogs.showOk(function (dlg, jq) { // jq.text("Loading..."); // The 'update' method is called whenever the text needs to be updated. function update(light) { // $(`#${light.$propInParent.$displayName}`).html(light.getOutDisplay()); $("#Ramp1").html(light.getOutDisplay()); } // Called whenever the Ramp changes. sub.attach('changed', function (prop) { if (prop.getName() === 'out') { update(this); } }); // https://127.0.0.1:8443/bajaux/webwidget/view:alarm:DatabaseView?theme=Zebra&formFactor=max&userLocalWbRc=true&attachAfterInit=false // 目前 OK local:|foxs:|alarm:|bql:select * from openAlarms // 目前 OK local:|foxs:|alarm:|bql:select * from ackPendingAlarms // 目前 OK 10.1.1.130:|foxs:|alarm:|bql:select * from ackPendingAlarms // 目前 OK alarm:|bql:select * from ackPendingAlarms // 沒資料 local:|foxs:|alarm:|view:alarm:AlarmDbView // local:|foxs:|station:|slot:/Services/OrionAlarmService // 應該有資料 欄位錯誤 service:alarmOrion:OrionAlarmService|slot:defaultAlarmClass1 // 應該有資料 service:alarm:AlarmService|slot:defaultAlarmClass // 終於有 acked local:|foxs:|alarm:|bql:select * from where ackState='acked // Alarm 表格 where uuid = 'eab7bdaa-c220-4724-bec7-7865824c5ba3' //ip:greencloud.fic.com.tw|foxs:|alarm:select * from where Timestamp order by desc var tableHtml = ""; baja.Ord.make("local:|foxs:|alarm:select * from where Timestamp order by desc ").get({ cursor: { before: function () { // This gets called before iteration starts through the table. // Therefore, this is where we create the headers tableHtml = "
序 | " + "Timestamp | " + "uuid | " + "Source State | " + "ackState | " + "ackRequired | " + "Source | " + "alarmClass | " + "priority | " + "normalTime | " + "ackTime | " + "user | " + "alarmData | " + "alarmTransition | " + "lastUpdate | " + "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" + (index+1) + " | " + "" + this.getDisplay("timestamp") + " | " + "" + this.getDisplay("uuid") + " | " + "" + this.getDisplay("sourceState") + " | " + "" + this.getDisplay("ackState") + " | " + "" + this.getDisplay("ackRequired") + " | " + "" + this.getDisplay("source") + " | " + "" + this.getDisplay("alarmClass") + " | " + "" + this.getDisplay("priority") + " | " + "" + this.getDisplay("normalTime") + " | " + "" + this.getDisplay("ackTime") + " | " + "" + this.getDisplay("user") + " | " + "" + this.getDisplay("alarmData") + " | " + "" + this.getDisplay("alarmTransition") + " | " + "" + this.getDisplay("lastUpdate") + " | " + "