9 lines
2.5 KiB
JavaScript
9 lines
2.5 KiB
JavaScript
/**
|
|
* skills-service-manager - Skills Services Manager
|
|
* @version v4.0.6
|
|
* @license Copyright (c) 2017, Jibo, Inc. All rights reserved.
|
|
* All use of the Jibo SDK is subject to the Jibo SDK End User License Agreement (EULA)
|
|
* distributed herewith. If you did not receive a copy of the EULA, you may view a
|
|
* copy at https://developers.jibo.com/license.
|
|
*/
|
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.index=e()}}(function(){return function e(t,n,r){function a(s,c){if(!n[s]){if(!t[s]){var o="function"==typeof require&&require;if(!c&&o)return o(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return a(n?n:e)},f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(e,t,n){var r=React.createClass({getInitialState:function(){var e=location.origin.replace("http://","ws://");return this.socket=new WebSocket(e),this.socket.addEventListener("message",this.onMessage),{entries:[]}},onMessage:function(e){var t=JSON.parse(e.data);this.startTime||(this.startTime=t.time),this.state.entries.push(t),this.setState({entries:this.state.entries})},format:function(e,t){for(var n=String(e);n.length<t;)n="0"+n;return n},render:function(){var e=this,t=[];return this.state.entries.forEach(function(n,r){var a=new Date(n.time),i=e.format(a.getHours(),2),s=e.format(a.getMinutes(),2),c=e.format(a.getSeconds(),2),o=e.format(a.getMilliseconds(),3),l=i+":"+s+":"+c+":"+o;t.push(React.createElement("tr",{key:r},React.createElement("td",{className:"time"},React.createElement("samp",null,l)),React.createElement("td",{className:"type"},React.createElement("code",null,n.type)),React.createElement("td",{className:"desc"},n.description)))}),React.createElement("table",{className:"table table-striped table-condensed"},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{className:"time"},"Time"),React.createElement("th",{className:"type"},"Type"),React.createElement("th",{className:"desc"},"Description"))),React.createElement("tbody",null,t))}});$(document).ready(function(){ReactDOM.render(React.createElement(r,null),document.getElementById("grid"))})},{}]},{},[1])(1)}); |