Line | |
---|
1 | /*
|
---|
2 | server status library for SWAT
|
---|
3 |
|
---|
4 | released under the GNU GPL Version 3 or later
|
---|
5 | */
|
---|
6 |
|
---|
7 |
|
---|
8 | // Format for a server status table
|
---|
9 | var s = [
|
---|
10 | { id : "server",
|
---|
11 | label : "Server",
|
---|
12 | content: "text",
|
---|
13 | defaultValue : "-",
|
---|
14 | width : 100
|
---|
15 | },
|
---|
16 |
|
---|
17 | { id : "status",
|
---|
18 | label : "Status",
|
---|
19 | content: "text",
|
---|
20 | defaultValue : "-",
|
---|
21 | width: 100
|
---|
22 | }
|
---|
23 | ];
|
---|
24 |
|
---|
25 | function __load_status_table(info, container)
|
---|
26 | {
|
---|
27 | var table = new QxListView(s);
|
---|
28 | var i;
|
---|
29 | for (i in info) {
|
---|
30 | table.addData( {server : i, status : info[i]} );
|
---|
31 | }
|
---|
32 | container.add(table);
|
---|
33 | container.setVisible(true);
|
---|
34 | }
|
---|
35 |
|
---|
36 | function getServerStatus(container)
|
---|
37 | {
|
---|
38 | server_call_url("/scripting/server/status.esp", 'serverInfo',
|
---|
39 | function(info) { __load_status_table(info, container); });
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.