@colyseus/monitor 0.15.0-preview.1 → 0.15.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api.js +7 -10
- package/build/index.d.ts +1 -1
- package/build/static/build/index.d.ts +1 -1
- package/build/static/bundle.js +7 -7
- package/build/static/bundle.js.map +1 -1
- package/package.json +3 -3
- package/build/api.js.map +0 -1
- package/build/api.mjs +0 -76
- package/build/api.mjs.map +0 -1
- package/build/ext/Room.js.map +0 -1
- package/build/ext/Room.mjs +0 -50
- package/build/ext/Room.mjs.map +0 -1
- package/build/frontend/services.d.ts +0 -3
- package/build/frontend/styles/index.d.ts +0 -8
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -18
- package/build/index.mjs.map +0 -1
- package/build/static/lib/api.d.ts +0 -2
- package/build/static/lib/ext/Room.d.ts +0 -1
- package/build/static/lib/frontend/App.d.ts +0 -2
- package/build/static/lib/frontend/components/CAppBar.d.ts +0 -8
- package/build/static/lib/frontend/components/RoomInspect.d.ts +0 -30
- package/build/static/lib/frontend/components/RoomList.d.ts +0 -26
- package/build/static/lib/frontend/index.d.ts +0 -1
- package/build/static/lib/frontend/services.d.ts +0 -5
- package/build/static/lib/index.d.ts +0 -11
package/build/api.js
CHANGED
|
@@ -17,24 +17,21 @@ const colyseus_1 = require("colyseus");
|
|
|
17
17
|
const express_1 = __importDefault(require("express"));
|
|
18
18
|
const node_os_utils_1 = __importDefault(require("node-os-utils"));
|
|
19
19
|
const UNAVAILABLE_ROOM_ERROR = "@colyseus/monitor: room $roomId is not available anymore.";
|
|
20
|
-
const DEFAULT_COLUMNS = [
|
|
21
|
-
'roomId',
|
|
22
|
-
'name',
|
|
23
|
-
'clients',
|
|
24
|
-
'maxClients',
|
|
25
|
-
'locked',
|
|
26
|
-
'elapsedTime',
|
|
27
|
-
];
|
|
28
20
|
function getAPI(opts) {
|
|
29
21
|
const api = express_1.default.Router();
|
|
30
22
|
api.get("/", (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
31
23
|
try {
|
|
32
24
|
const rooms = yield colyseus_1.matchMaker.query({});
|
|
25
|
+
const columns = opts.columns || ['roomId', 'name', 'clients', 'maxClients', 'locked', 'elapsedTime'];
|
|
26
|
+
// extend columns to expose "publicAddress", if present
|
|
27
|
+
if (rooms[0] && rooms[0].publicAddress !== undefined) {
|
|
28
|
+
columns.push("publicAddress");
|
|
29
|
+
}
|
|
33
30
|
let connections = 0;
|
|
34
31
|
res.json({
|
|
35
|
-
columns
|
|
32
|
+
columns,
|
|
36
33
|
rooms: rooms.map(room => {
|
|
37
|
-
const data =
|
|
34
|
+
const data = JSON.parse(JSON.stringify(room));
|
|
38
35
|
connections += room.clients;
|
|
39
36
|
// additional data
|
|
40
37
|
data.locked = room.locked || false;
|
package/build/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import './ext/Room';
|
|
|
3
3
|
export interface MonitorOptions {
|
|
4
4
|
columns: Array<'roomId' | 'name' | 'clients' | 'maxClients' | 'locked' | 'elapsedTime' | {
|
|
5
5
|
metadata: string;
|
|
6
|
-
}>;
|
|
6
|
+
} | "publicAddress">;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* TODO: expose the `router` instead on next major version.
|
|
@@ -3,7 +3,7 @@ import './ext/Room';
|
|
|
3
3
|
export interface MonitorOptions {
|
|
4
4
|
columns: Array<'roomId' | 'name' | 'clients' | 'maxClients' | 'locked' | 'elapsedTime' | {
|
|
5
5
|
metadata: string;
|
|
6
|
-
}>;
|
|
6
|
+
} | "publicAddress">;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* TODO: expose the `router` instead on next major version.
|