forked from circlecloud/tera
23 lines
544 B
TypeScript
23 lines
544 B
TypeScript
|
import { controller, httpGet } from '@cc-server/binding';
|
||
|
import { teraManager } from '../manager';
|
||
|
|
||
|
@controller('')
|
||
|
class TeraController {
|
||
|
@httpGet('/clients')
|
||
|
clients() {
|
||
|
let list = [];
|
||
|
let index = 0;
|
||
|
for (let id in teraManager.pows) {
|
||
|
const pow = teraManager.pows[id];
|
||
|
list.push({
|
||
|
id: pow.id,
|
||
|
index,
|
||
|
address: pow.conn.remoteAddress
|
||
|
})
|
||
|
index++
|
||
|
}
|
||
|
return list;
|
||
|
}
|
||
|
}
|
||
|
export default TeraController;
|