diff --git a/CHANGELOG.md b/CHANGELOG.md index 2854a58..f1e59e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +# [0.4.0](https://github.com/socketio/socket.io-admin-ui/compare/0.3.0...0.4.0) (2022-06-23) + + +### Bug Fixes + +* **ui:** properly set initial nav drawer state ([77ee068](https://github.com/socketio/socket.io-admin-ui/commit/77ee0683185aceababc4439a3a945e273d547944)) + + +### Features + +* add page displaying all events ([481ef22](https://github.com/socketio/socket.io-admin-ui/commit/481ef22b3aff37b40b142a29cb78e116d6d1e8e9)) +* add production mode ([e0d91ca](https://github.com/socketio/socket.io-admin-ui/commit/e0d91cadb11205c5f2c686c239a50cb2eef9795d)) +* display sent and received events ([8542601](https://github.com/socketio/socket.io-admin-ui/commit/8542601b55022f6ca00b677b7d7c7664a326526f)) +* **ui:** add support for relative links ([fdec2ce](https://github.com/socketio/socket.io-admin-ui/commit/fdec2ce17bf7cad77a04e8eef42a26104b6a05b8)) +* **ui:** separate the namespace from the server URL ([5a8a75e](https://github.com/socketio/socket.io-admin-ui/commit/3d4aed972f16dad3dd847d61f4db5e6f55978c4b)) + + + # [0.3.0](https://github.com/socketio/socket.io-admin-ui/compare/0.2.0...0.3.0) (2022-05-03) diff --git a/README.md b/README.md index 983e2ea..93fba1f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ - [`readonly`](#readonly) - [`serverId`](#serverid) - [`store`](#store) + - [`mode`](#mode) - [How it works](#how-it-works) - [License](#license) @@ -64,7 +65,7 @@ You should see the following modal: ![login modal screenshot](assets/login-modal.png) -Please enter the URL of your server, including the namespace (for example, `http://localhost:3000/admin` or `https://example.com/admin`) and the credentials, if applicable (see the `auth` option [below](#auth)). +Please enter the URL of your server (for example, `http://localhost:3000` or `https://example.com`) and the credentials, if applicable (see the `auth` option [below](#auth)). ### Available options @@ -173,6 +174,24 @@ instrument(io, { }); ``` +#### `mode` + +Default value: `development` + +In production mode, the server won't send all details about the socket instances and the rooms, thus reducing the memory footprint of the instrumentation. + +```js +instrument(io, { + mode: "production" +}); +``` + +The production mode can also be enabled with the NODE_ENV environment variable: + +``` +NODE_ENV=production node index.js +``` + ## How it works You can check the details of the implementation in the [lib/index.ts](lib/index.ts) file. diff --git a/package.json b/package.json index bd69200..1405d21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@socket.io/admin-ui", - "version": "0.3.0", + "version": "0.4.0", "description": "Admin UI for Socket.IO", "files": [ "dist/", diff --git a/ui/dist/css/app.4ba437f0.css b/ui/dist/css/app.4ba437f0.css deleted file mode 100644 index 7b92886..0000000 --- a/ui/dist/css/app.4ba437f0.css +++ /dev/null @@ -1 +0,0 @@ -.chart[data-v-58987bf8],.chart[data-v-d6482f56]{max-width:160px;margin:20px}.select-room[data-v-d014ee1e],.selector[data-v-2c330798]{max-width:200px}.key-column[data-v-8d2424e4],.key-column[data-v-41eb1dae],.key-column[data-v-18284f59]{width:30%} \ No newline at end of file diff --git a/ui/dist/css/app.6e3b9661.css b/ui/dist/css/app.6e3b9661.css new file mode 100644 index 0000000..a92d380 --- /dev/null +++ b/ui/dist/css/app.6e3b9661.css @@ -0,0 +1 @@ +.chart[data-v-0ad5cc14],.chart[data-v-68c0c5d5]{max-width:160px;margin:20px}.selector[data-v-2c330798]{max-width:200px}.row-pointer[data-v-1d29c60a] tbody>tr:hover{cursor:pointer}.select-room[data-v-5631eb89]{max-width:200px}.row-pointer[data-v-5631eb89] tbody>tr:hover{cursor:pointer}.key-column[data-v-3c0dcfcd]{width:30%}.link[data-v-3c0dcfcd]{color:inherit}.key-column[data-v-18284f59]{width:30%}.row-pointer[data-v-57b53591] tbody>tr:hover,.row-pointer[data-v-29992f63] tbody>tr:hover{cursor:pointer}.key-column[data-v-8d2424e4]{width:30%}.row-pointer[data-v-38772079] tbody>tr:hover,.row-pointer[data-v-c9425064] tbody>tr:hover{cursor:pointer}.link[data-v-2c2337d4]{color:inherit} \ No newline at end of file diff --git a/ui/dist/index.html b/ui/dist/index.html index 6b9c39c..5ef6852 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -1 +1 @@ -
{{ serverUrl }}
\n {{ serverUrl }}
\n {{ namespace.name }}
\n {{ socket.nsp }}
\n {{ JSON.stringify(socket.data, null, 2) }}
\n {{ value }}
\n \n\n \n {{ nsp }}
\n {{ item.eventName }}
\n \n \n {{ $t(\"events.reason\") }}{{ $t(\"separator\")\n }}{{ value }}
\n \n \n {{ $t(\"events.room\") }}{{ $t(\"separator\") }}{{ value }}
\n \n \n {{ value }}\n \n \n\n \n {{ item.args }}
\n {{ serverUrl }}
\n {{ serverUrl }}
\n {{ namespace.name }}
\n {{ socket.nsp }}
\n {{ JSON.stringify(socket.data, null, 2) }}
\n {{ value }}
\n \n\n \n {{ nsp }}
\n 0&&t.stroke()}}function _e(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xn&&0===t?0:t+e;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ve(t,e){return Object.assign(Object.create(t),e)}function ze(t,e,n){n=n||(n=>t[n]t-e))}return t._cache.$bar}function Wi(t){const e=t.iScale,n=Hi(e,t.type);let i,r,s,a,o=e._length;const c=()=>{32767!==s&&-32768!==s&&(I(a)&&(o=Math.min(o,Math.abs(s-a)||o)),a=s)};for(i=0,r=n.length;i0&&!isNaN(t)?R*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=Xn(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,s,a,o;if(!t)for(i=0,r=n.data.datasets.length;i{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,s;for(r=0,s=e.length;r{const i=n.split("."),r=i.pop(),s=[t].concat(i).join("."),a=e[n].split("."),o=a.pop(),c=a.join(".");pe.route(s,r,c,o)})}function Ns(t){return"id"in t&&"defaults"in t}class Fs{constructor(){this.controllers=new Ps(zi,"datasets",!0),this.elements=new Ps(fs,"elements"),this.plugins=new Ps(Object,"plugins"),this.scales=new Ps(Ls,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):x(e,e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)})})}_exec(t,e,n){const i=$(t);y(n["before"+i],[],n),e[t](n),y(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;ee.r&&(o=(i.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),r.start+t.value))}initOffsets(t){let e,n,i=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),r=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;i=ot(i,0,s),r=ot(r,0,s),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,s=r.unit||ic(r.minUnit,e,n,this._getLabelCapacity(e)),a=v(r.stepSize,1),o="week"===s&&r.isoWeekday,c=G(o)||!0===o,l={};let u,h,d=e;if(c&&(d=+t.startOf(d,"isoWeek",o)),d=+t.startOf(d,c?"day":s),t.diff(n,e,s)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+s);const f="data"===i.ticks.source&&this.getDataTimestamps();for(u=d,h=0;u>6),t.setUint8(e++,128|63&i)):i<55296||i>=57344?(t.setUint8(e++,224|i>>12),t.setUint8(e++,128|i>>6&63),t.setUint8(e++,128|63&i)):(r++,i=65536+((1023&i)<<10|1023&n.charCodeAt(r)),t.setUint8(e++,240|i>>18),t.setUint8(e++,128|i>>12&63),t.setUint8(e++,128|i>>6&63),t.setUint8(e++,128|63&i))}function r(t){for(var e=0,n=0,i=0,r=t.length;ie+a&&t.right(t)),Math.abs(t.offsetX)i+a&&t.down(t))};function s(t,e){var n=t.changedTouches[0];e.touchstartX=n.clientX,e.touchstartY=n.clientY,e.start&&e.start(Object.assign(t,e))}function a(t,e){var n=t.changedTouches[0];e.touchendX=n.clientX,e.touchendY=n.clientY,e.end&&e.end(Object.assign(t,e)),r(e)}function o(t,e){var n=t.changedTouches[0];e.touchmoveX=n.clientX,e.touchmoveY=n.clientY,e.move&&e.move(Object.assign(t,e))}function c(t){var e={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:t.left,right:t.right,up:t.up,down:t.down,start:t.start,move:t.move,end:t.end};return{touchstart:function(t){return s(t,e)},touchend:function(t){return a(t,e)},touchmove:function(t){return o(t,e)}}}function l(t,e,n){var r=e.value,s=r.parent?t.parentElement:t,a=r.options||{passive:!0};if(s){var o=c(e.value);s._touchHandlers=Object(s._touchHandlers),s._touchHandlers[n.context._uid]=o,Object(i["x"])(o).forEach((function(t){s.addEventListener(t,o[t],a)}))}}function u(t,e,n){var r=e.value.parent?t.parentElement:t;if(r&&r._touchHandlers){var s=r._touchHandlers[n.context._uid];Object(i["x"])(s).forEach((function(t){r.removeEventListener(t,s[t])})),delete r._touchHandlers[n.context._uid]}}var h={inserted:l,unbind:u};e["a"]=h},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var i=n("da84"),r=n("ce4e"),s="__core-js_shared__",a=i[s]||r(s,{});t.exports=a},c6eb:function(t,e,n){"use strict";(function(t){var i=n("5ea3"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===r,o=a&&i["a"].process,c=function(){try{var t=s&&s.require&&s.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(e){}}();e["a"]=c}).call(this,n("dd40")(t))},c740:function(t,e,n){"use strict";var i=n("23e7"),r=n("b727").findIndex,s=n("44d2"),a="findIndex",o=!0;a in[]&&Array(1)[a]((function(){o=!1})),i({target:"Array",proto:!0,forced:o},{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),s(a)},c7cd:function(t,e,n){"use strict";var i=n("23e7"),r=n("857a"),s=n("af03");i({target:"String",proto:!0,forced:s("fixed")},{fixed:function(){return r(this,"tt","","")}})},c8d2:function(t,e,n){var i=n("d039"),r=n("5899"),s="
";t.exports=function(t){return i((function(){return!!r[t]()||s[t]()!=s||r[t].name!==t}))}},c96a:function(t,e,n){"use strict";var i=n("23e7"),r=n("857a"),s=n("af03");i({target:"String",proto:!0,forced:s("small")},{small:function(){return r(this,"small","","")}})},c995:function(t,e,n){"use strict";var i=n("ade3"),r=(n("a9e3"),n("2b0e"));e["a"]=r["a"].extend({name:"elevatable",props:{elevation:[Number,String]},computed:{computedElevation:function(){return this.elevation},elevationClasses:function(){var t=this.computedElevation;return null==t||isNaN(parseInt(t))?{}:Object(i["a"])({},"elevation-".concat(this.elevation),!0)}}})},ca54:function(t,e,n){"use strict";var i=n("26ee"),r=i["a"].Symbol;e["a"]=r},ca84:function(t,e,n){var i=n("5135"),r=n("fc6a"),s=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,o=r(t),c=0,l=[];for(n in o)!i(a,n)&&i(o,n)&&l.push(n);while(e.length>c)i(o,n=e[c++])&&(~s(l,n)||l.push(n));return l}},caad:function(t,e,n){"use strict";var i=n("23e7"),r=n("4d64").includes,s=n("44d2");i({target:"Array",proto:!0},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},cb29:function(t,e,n){var i=n("23e7"),r=n("81d5"),s=n("44d2");i({target:"Array",proto:!0},{fill:r}),s("fill")},cc12:function(t,e,n){var i=n("da84"),r=n("861d"),s=i.document,a=r(s)&&r(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},cc20:function(t,e,n){"use strict";var i=n("3835"),r=n("5530"),s=(n("4de4"),n("8adc"),n("58df")),a=n("0789"),o=n("9d26"),c=n("a9ad"),l=n("4e82"),u=n("7560"),h=n("f2e7"),d=n("1c87"),f=n("af2b"),p=n("d9bd");e["a"]=Object(s["a"])(c["a"],f["a"],d["a"],u["a"],Object(l["a"])("chipGroup"),Object(h["b"])("inputValue")).extend({name:"v-chip",props:{active:{type:Boolean,default:!0},activeClass:{type:String,default:function(){return this.chipGroup?this.chipGroup.activeClass:""}},close:Boolean,closeIcon:{type:String,default:"$delete"},closeLabel:{type:String,default:"$vuetify.close"},disabled:Boolean,draggable:Boolean,filter:Boolean,filterIcon:{type:String,default:"$complete"},label:Boolean,link:Boolean,outlined:Boolean,pill:Boolean,tag:{type:String,default:"span"},textColor:String,value:null},data:function(){return{proxyClass:"v-chip--active"}},computed:{classes:function(){return Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])({"v-chip":!0},d["a"].options.computed.classes.call(this)),{},{"v-chip--clickable":this.isClickable,"v-chip--disabled":this.disabled,"v-chip--draggable":this.draggable,"v-chip--label":this.label,"v-chip--link":this.isLink,"v-chip--no-color":!this.color,"v-chip--outlined":this.outlined,"v-chip--pill":this.pill,"v-chip--removable":this.hasClose},this.themeClasses),this.sizeableClasses),this.groupClasses)},hasClose:function(){return Boolean(this.close)},isClickable:function(){return Boolean(d["a"].options.computed.isClickable.call(this)||this.chipGroup)}},created:function(){var t=this,e=[["outline","outlined"],["selected","input-value"],["value","active"],["@input","@active.sync"]];e.forEach((function(e){var n=Object(i["a"])(e,2),r=n[0],s=n[1];t.$attrs.hasOwnProperty(r)&&Object(p["a"])(r,s,t)}))},methods:{click:function(t){this.$emit("click",t),this.chipGroup&&this.toggle()},genFilter:function(){var t=[];return this.isActive&&t.push(this.$createElement(o["a"],{staticClass:"v-chip__filter",props:{left:!0}},this.filterIcon)),this.$createElement(a["b"],t)},genClose:function(){var t=this;return this.$createElement(o["a"],{staticClass:"v-chip__close",props:{right:!0,size:18},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:function(e){e.stopPropagation(),e.preventDefault(),t.$emit("click:close"),t.$emit("update:active",!1)}}},this.closeIcon)},genContent:function(){return this.$createElement("span",{staticClass:"v-chip__content"},[this.filter&&this.genFilter(),this.$slots.default,this.hasClose&&this.genClose()])}},render:function(t){var e=[this.genContent()],n=this.generateRouteLink(),i=n.tag,s=n.data;s.attrs=Object(r["a"])(Object(r["a"])({},s.attrs),{},{draggable:this.draggable?"true":void 0,tabindex:this.chipGroup&&!this.disabled?0:s.attrs.tabindex}),s.directives.push({name:"show",value:this.active}),s=this.setBackgroundColor(this.color,s);var a=this.textColor||this.outlined&&this.color;return t(i,this.setTextColor(a,s),e)}})},cca6:function(t,e,n){var i=n("23e7"),r=n("60da");i({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},cdf9:function(t,e,n){var i=n("825a"),r=n("861d"),s=n("f069");t.exports=function(t,e){if(i(t),r(e)&&e.constructor===t)return e;var n=s.f(t),a=n.resolve;return a(e),n.promise}},ce4e:function(t,e,n){var i=n("da84"),r=n("9112");t.exports=function(t,e){try{r(i,t,e)}catch(n){i[t]=e}return e}},ce7e:function(t,e,n){"use strict";var i=n("5530"),r=(n("8ce9"),n("7560"));e["a"]=r["a"].extend({name:"v-divider",props:{inset:Boolean,vertical:Boolean},render:function(t){var e;return this.$attrs.role&&"separator"!==this.$attrs.role||(e=this.vertical?"vertical":"horizontal"),t("hr",{class:Object(i["a"])({"v-divider":!0,"v-divider--inset":this.inset,"v-divider--vertical":this.vertical},this.themeClasses),attrs:Object(i["a"])({role:"separator","aria-orientation":e},this.$attrs),on:this.$listeners})}})},cf36:function(t,e,n){},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var i=n("428f"),r=n("da84"),s=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?s(i[t])||s(r[t]):i[t]&&i[t][e]||r[t]&&r[t][e]}},d10f:function(t,e,n){"use strict";var i=n("2b0e");e["a"]=i["a"].extend({name:"ssr-bootable",data:function(){return{isBooted:!1}},mounted:function(){var t=this;window.requestAnimationFrame((function(){t.$el.setAttribute("data-booted","true"),t.isBooted=!0}))}})},d191:function(t,e,n){},d1e7:function(t,e,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!i.call({1:2},1);e.f=s?function(t){var e=r(this,t);return!!e&&e.enumerable}:i},d28b:function(t,e,n){var i=n("746f");i("iterator")},d2bb:function(t,e,n){var i=n("825a"),r=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(s){}return function(n,s){return i(n),r(s),e?t.call(n,s):n.__proto__=s,n}}():void 0)},d3b7:function(t,e,n){var i=n("00ee"),r=n("6eeb"),s=n("b041");i||r(Object.prototype,"toString",s,{unsafe:!0})},d44e:function(t,e,n){var i=n("9bf2").f,r=n("5135"),s=n("b622"),a=s("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,a)&&i(t,a,{configurable:!0,value:e})}},d66c:function(t,e,n){"use strict";var i=n("b93d"),r=n("b703"),s=n("5132"),a=n("7f2c"),o=n("6999"),c=n("9a4b");function l(t,e){return t&&Object(o["a"])(t,e,c["a"])}var u=l,h=n("e56b");function d(t,e){return function(n,i){if(null==n)return n;if(!Object(h["a"])(n))return t(n,i);var r=n.length,s=e?r:-1,a=Object(n);while(e?s--:++sr?t=this.pageYOffset+(i.top-r):a&&!this.allowOverflow?t=n-r-12:t