Mercurial > prosody-modules
annotate mod_admin_web/admin_web/www_files/js/main.js @ 5537:4b9a7684ae02
mod_firewall: marks: Fix marking a user with no previous marks
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 08 Jun 2023 16:53:12 +0100 |
parents | 1630c6ed3814 |
children |
rev | line source |
---|---|
307
eeef1fa57f88
mod_admin_web: Specify only directory as bosh service, so it (normally) doesn't need changing (Thanks Zash)
Florian Zeitz <florob@babelmonkeys.de>
parents:
306
diff
changeset
|
1 var BOSH_SERVICE = '/http-bind/'; |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
2 var show_log = false; |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
3 |
317
4f78f5020aa9
mod_admin_web: Get rid of the mod_pubsub dependency
Florian Zeitz <florob@babelmonkeys.de>
parents:
308
diff
changeset
|
4 Strophe.addNamespace('C2SSTREAM', 'http://prosody.im/streams/c2s'); |
4f78f5020aa9
mod_admin_web: Get rid of the mod_pubsub dependency
Florian Zeitz <florob@babelmonkeys.de>
parents:
308
diff
changeset
|
5 Strophe.addNamespace('S2SSTREAM', 'http://prosody.im/streams/s2s'); |
4f78f5020aa9
mod_admin_web: Get rid of the mod_pubsub dependency
Florian Zeitz <florob@babelmonkeys.de>
parents:
308
diff
changeset
|
6 Strophe.addNamespace('ADMINSUB', 'http://prosody.im/adminsub'); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
7 Strophe.addNamespace('CAPS', 'http://jabber.org/protocol/caps'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
8 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
9 var localJID = null; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
10 var connection = null; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
11 |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
12 var adminsubHost = null; |
573
c9955858dc7e
mod_adhoc_web: Redesign adhoc command pane
Florian Zeitz <florob@babelmonkeys.de>
parents:
547
diff
changeset
|
13 var adhocControl = new Adhoc('#adhocDisplay', function() {}); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
14 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
15 function log(msg) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
16 var entry = $('<div></div>').append(document.createTextNode(msg)); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
17 $('#log').append(entry); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
18 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
19 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
20 function rawInput(data) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
21 log('RECV: ' + data); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
22 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
23 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
24 function rawOutput(data) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
25 log('SENT: ' + data); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
26 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
27 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
28 function _cbNewS2S(e) { |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
29 var items, item, entry, tmp, retract, id, jid, infos, info, metadata; |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
30 items = e.getElementsByTagName('item'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
31 for (i = 0; i < items.length; i++) { |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
32 item = items[i]; |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
33 id = item.attributes.getNamedItem('id').value; |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
34 jid = item.getElementsByTagName('session')[0].attributes.getNamedItem('jid').value; |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
35 infos = item.getElementsByTagName('info'); |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
36 |
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
37 entry = $('<li id="' + id + '">' + jid + '</li>'); |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
38 if (tmp = item.getElementsByTagName('encrypted')[0]) { |
396
8cb21ef24e5d
mod_admin_web: Show S2S certificate validity
Florian Zeitz <florob@babelmonkeys.de>
parents:
334
diff
changeset
|
39 if (tmp.getElementsByTagName('valid')[0]) { |
8cb21ef24e5d
mod_admin_web: Show S2S certificate validity
Florian Zeitz <florob@babelmonkeys.de>
parents:
334
diff
changeset
|
40 entry.append('<img src="images/secure.png" title="encrypted (certificate valid)" alt=" (secure) (encrypted)" />'); |
8cb21ef24e5d
mod_admin_web: Show S2S certificate validity
Florian Zeitz <florob@babelmonkeys.de>
parents:
334
diff
changeset
|
41 } else { |
8cb21ef24e5d
mod_admin_web: Show S2S certificate validity
Florian Zeitz <florob@babelmonkeys.de>
parents:
334
diff
changeset
|
42 entry.append('<img src="images/encrypted.png" title="encrypted (certificate invalid)" alt=" (encrypted)" />'); |
8cb21ef24e5d
mod_admin_web: Show S2S certificate validity
Florian Zeitz <florob@babelmonkeys.de>
parents:
334
diff
changeset
|
43 } |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
44 } |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
45 if (item.getElementsByTagName('compressed')[0]) { |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
46 entry.append('<img src="images/compressed.png" title="compressed" alt=" (compressed)" />'); |
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
47 } |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
48 metadata = $('<ul/>').css('display', 'none'); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
49 entry.on('click', function() { |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
50 $(this).find("ul").slideToggle(); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
51 }); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
52 metadata.appendTo(entry); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
53 for (j = 0; j < infos.length; j++) { |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
54 info = infos[j]; |
1189
1630c6ed3814
mod_admin_web: Use .textContent, instead of .innerHTML
Florian Zeitz <florob@babelmonkeys.de>
parents:
1117
diff
changeset
|
55 metadata.append('<li><b>' + info.attributes.getNamedItem('name').value + ':</b> ' + info.textContent + '</li>'); |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
56 } |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
57 if (infos.length == 0) |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
58 metadata.append('<li>No information available</li>'); |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
59 |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
60 if (items[i].getElementsByTagName('out')[0]) { |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
61 entry.appendTo('#s2sout'); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
62 } else { |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
63 entry.appendTo('#s2sin'); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
64 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
65 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
66 retract = e.getElementsByTagName('retract')[0]; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
67 if (retract) { |
614
40ab83736f6e
mod_admin_web: Correctly access items in NamedNodeMaps
Florian Zeitz <florob@babelmonkeys.de>
parents:
584
diff
changeset
|
68 id = retract.attributes.getNamedItem('id').value; |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
69 $('#' + id).remove(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
70 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
71 return true; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
72 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
73 |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
74 function _cbNewC2S(e) { |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
75 var items, item, entry, retract, id, jid, infos, info, metadata; |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
76 items = e.getElementsByTagName('item'); |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
77 for (i = 0; i < items.length; i++) { |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
78 item = items[i]; |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
79 id = item.attributes.getNamedItem('id').value; |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
80 jid = item.getElementsByTagName('session')[0].attributes.getNamedItem('jid').value; |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
81 infos = item.getElementsByTagName('info'); |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
82 entry = $('<li id="' + id + '">' + jid + '</li>'); |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
83 if (item.getElementsByTagName('encrypted')[0]) { |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
84 entry.append('<img src="images/encrypted.png" title="encrypted" alt=" (encrypted)" />'); |
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
85 } |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
86 if (item.getElementsByTagName('compressed')[0]) { |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
87 entry.append('<img src="images/compressed.png" title="compressed" alt=" (compressed)" />'); |
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
88 } |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
89 metadata = $('<ul/>').css('display', 'none'); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
90 entry.on('click', function() { |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
91 $(this).find("ul").slideToggle(); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
92 }); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
93 metadata.appendTo(entry); |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
94 for (j = 0; j < infos.length; j++) { |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
95 info = infos[j]; |
1189
1630c6ed3814
mod_admin_web: Use .textContent, instead of .innerHTML
Florian Zeitz <florob@babelmonkeys.de>
parents:
1117
diff
changeset
|
96 metadata.append('<li><b>' + info.attributes.getNamedItem('name').value + ':</b> ' + info.textContent + '</li>'); |
1117
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
97 } |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
98 if (infos.length == 0) |
d643c385d3f6
mod_admin_web: Provide some information about the TLS layer
Florian Zeitz <florob@babelmonkeys.de>
parents:
1023
diff
changeset
|
99 metadata.append('<li>No information available</li>'); |
306
c152ab024d1a
mod_admin_web: Show whether connection is encrypted/compressed
Florian Zeitz <florob@babelmonkeys.de>
parents:
302
diff
changeset
|
100 entry.appendTo('#c2s'); |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
101 } |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
102 retract = e.getElementsByTagName('retract')[0]; |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
103 if (retract) { |
614
40ab83736f6e
mod_admin_web: Correctly access items in NamedNodeMaps
Florian Zeitz <florob@babelmonkeys.de>
parents:
584
diff
changeset
|
104 id = retract.attributes.getNamedItem('id').value; |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
105 $('#' + id).remove(); |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
106 } |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
107 return true; |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
108 } |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
109 |
317
4f78f5020aa9
mod_admin_web: Get rid of the mod_pubsub dependency
Florian Zeitz <florob@babelmonkeys.de>
parents:
308
diff
changeset
|
110 function _cbAdminSub(e) { |
614
40ab83736f6e
mod_admin_web: Correctly access items in NamedNodeMaps
Florian Zeitz <florob@babelmonkeys.de>
parents:
584
diff
changeset
|
111 var node = e.getElementsByTagName('items')[0].attributes.getNamedItem('node').value; |
317
4f78f5020aa9
mod_admin_web: Get rid of the mod_pubsub dependency
Florian Zeitz <florob@babelmonkeys.de>
parents:
308
diff
changeset
|
112 if (node == Strophe.NS.C2SSTREAM) { |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
113 _cbNewC2S(e); |
317
4f78f5020aa9
mod_admin_web: Get rid of the mod_pubsub dependency
Florian Zeitz <florob@babelmonkeys.de>
parents:
308
diff
changeset
|
114 } else if (node == Strophe.NS.S2SSTREAM) { |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
115 _cbNewS2S(e); |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
116 } |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
117 |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
118 return true; |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
119 } |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
120 |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
121 function onConnect(status) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
122 if (status == Strophe.Status.CONNECTING) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
123 log('Strophe is connecting.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
124 } else if (status == Strophe.Status.CONNFAIL) { |
915
1d03dc7cf28f
mod_admin_web: Better error reporting
Florian Zeitz <florob@babelmonkeys.de>
parents:
914
diff
changeset
|
125 alert('Connection failed (Wrong host?)'); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
126 log('Strophe failed to connect.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
127 showConnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
128 } else if (status == Strophe.Status.DISCONNECTING) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
129 log('Strophe is disconnecting.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
130 } else if (status == Strophe.Status.DISCONNECTED) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
131 log('Strophe is disconnected.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
132 showConnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
133 } else if (status == Strophe.Status.AUTHFAIL) { |
915
1d03dc7cf28f
mod_admin_web: Better error reporting
Florian Zeitz <florob@babelmonkeys.de>
parents:
914
diff
changeset
|
134 alert('Wrong username and/or password'); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
135 log('Authentication failed'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
136 if (connection) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
137 connection.disconnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
138 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
139 } else if (status == Strophe.Status.CONNECTED) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
140 log('Strophe is connected.'); |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
141 connection.sendIQ($iq({to: connection.domain, type: 'get', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
142 .c('adminfor'), function(e) { |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
143 var items; |
1019
7cba8be42d9e
mod_admin_web: Update to new strophejs location, and jQuery 1.9.1
Florian Zeitz <florob@babelmonkeys.de>
parents:
915
diff
changeset
|
144 var domainpart = Strophe.getDomainFromJid(connection.jid); |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
145 items = e.getElementsByTagName('item'); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
146 if (items.length == 0) { |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
147 alert("You are not an administrator"); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
148 connection.disconnect(); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
149 return false; |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
150 } |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
151 for (i = 0; i < items.length; i++) { |
914
fa996cfec6da
mod_admin_web: Default the host selection to the administrators domainpart
Florian Zeitz <florob@babelmonkeys.de>
parents:
614
diff
changeset
|
152 var host = $(items[i]).text(); |
1019
7cba8be42d9e
mod_admin_web: Update to new strophejs location, and jQuery 1.9.1
Florian Zeitz <florob@babelmonkeys.de>
parents:
915
diff
changeset
|
153 $('<option/>').text(host).prop('selected', host == domainpart).appendTo('#host'); |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
154 } |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
155 showDisconnect(); |
1020
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
156 adminsubHost = $('#host').val(); |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
157 adhocControl.checkFeatures(adminsubHost, |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
158 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) }, |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
159 function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); }); |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
160 connection.addHandler(_cbAdminSub, Strophe.NS.ADMINSUB + '#event', 'message'); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
161 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
162 .c('subscribe', {node: Strophe.NS.C2SSTREAM})); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
163 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
164 .c('subscribe', {node: Strophe.NS.S2SSTREAM})); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
165 connection.sendIQ($iq({to: adminsubHost, type: 'get', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
166 .c('items', {node: Strophe.NS.S2SSTREAM}), _cbNewS2S); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
167 connection.sendIQ($iq({to: adminsubHost, type: 'get', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
168 .c('items', {node: Strophe.NS.C2SSTREAM}), _cbNewC2S); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
169 }); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
170 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
171 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
172 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
173 function showConnect() { |
539
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
174 $('#login').show(); |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
175 $('#menu').hide(); |
539
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
176 $('#main').hide(); |
302
50abf9922e6e
mod_admin_web: Don't delete the menu
Florian Zeitz <florob@babelmonkeys.de>
parents:
301
diff
changeset
|
177 $('#s2sin').empty(); |
50abf9922e6e
mod_admin_web: Don't delete the menu
Florian Zeitz <florob@babelmonkeys.de>
parents:
301
diff
changeset
|
178 $('#s2sout').empty(); |
50abf9922e6e
mod_admin_web: Don't delete the menu
Florian Zeitz <florob@babelmonkeys.de>
parents:
301
diff
changeset
|
179 $('#c2s').empty(); |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
180 $('#host').empty(); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
181 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
182 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
183 function showDisconnect() { |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
184 $('#s2sList').hide(); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
185 $('#c2sList').hide(); |
539
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
186 $('#login').hide(); |
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
187 |
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
188 $('#menu').show(); |
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
189 $('#main').show(); |
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
190 $('#adhoc').show(); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
191 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
192 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
193 $(document).ready(function () { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
194 connection = new Strophe.Connection(BOSH_SERVICE); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
195 if (show_log) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
196 $('#log_container').show(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
197 connection.rawInput = rawInput; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
198 connection.rawOutput = rawOutput; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
199 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
200 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
201 $("#log_toggle").click(function () { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
202 $("#log").toggle(); |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
203 }); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
204 |
1023
83f56d3a07f5
mod_admin_web: Update to JQuery 1.10.0
Florian Zeitz <florob@babelmonkeys.de>
parents:
1020
diff
changeset
|
205 $('#cred').on('submit', function (event) { |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
206 var button = $('#connect').get(0); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
207 var jid = $('#jid'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
208 var pass = $('#pass'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
209 localJID = jid.get(0).value; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
210 |
1020
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
211 $('#log').empty(); |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
212 connection.connect(localJID, pass.get(0).value, onConnect); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
213 event.preventDefault(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
214 }); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
215 |
539
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
216 $('#logout').click(function (event) { |
1020
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
217 connection.disconnect(); |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
218 event.preventDefault(); |
539
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
219 }); |
99465bbfa205
First pass of web-admin redesign
Florian Zeitz <florob@babelmonkeys.de>
parents:
396
diff
changeset
|
220 |
547
f0ef6e285d69
mod_adhoc_web: fade instead of scrolling
Florian Zeitz <florob@babelmonkeys.de>
parents:
539
diff
changeset
|
221 $('#adhocMenu, #serverMenu, #clientMenu').click(function (event) { |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
222 event.preventDefault(); |
1020
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
223 var tab = $(this).attr('href'); |
547
f0ef6e285d69
mod_adhoc_web: fade instead of scrolling
Florian Zeitz <florob@babelmonkeys.de>
parents:
539
diff
changeset
|
224 $('#main > div').hide(); |
f0ef6e285d69
mod_adhoc_web: fade instead of scrolling
Florian Zeitz <florob@babelmonkeys.de>
parents:
539
diff
changeset
|
225 $(tab).fadeIn('fast'); |
301
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
226 }); |
b241c79a0eb7
mod_admin_web: Add a live view for C2S connections
Florian Zeitz <florob@babelmonkeys.de>
parents:
297
diff
changeset
|
227 |
1023
83f56d3a07f5
mod_admin_web: Update to JQuery 1.10.0
Florian Zeitz <florob@babelmonkeys.de>
parents:
1020
diff
changeset
|
228 $('#host').on('change', function (event) { |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
229 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
230 .c('unsubscribe', {node: Strophe.NS.C2SSTREAM})); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
231 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
232 .c('unsubscribe', {node: Strophe.NS.S2SSTREAM})); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
233 adminsubHost = $(this).val(); |
1020
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
234 adhocControl.checkFeatures(adminsubHost, |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
235 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) }, |
9839198539c8
mod_admin_web: Fix indentation
Florian Zeitz <florob@babelmonkeys.de>
parents:
1019
diff
changeset
|
236 function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); }); |
319
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
237 $('#s2sin').empty(); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
238 $('#s2sout').empty(); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
239 $('#c2s').empty(); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
240 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
241 .c('subscribe', {node: Strophe.NS.C2SSTREAM})); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
242 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
243 .c('subscribe', {node: Strophe.NS.S2SSTREAM})); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
244 connection.sendIQ($iq({to: adminsubHost, type: 'get', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
245 .c('items', {node: Strophe.NS.S2SSTREAM}), _cbNewS2S); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
246 connection.sendIQ($iq({to: adminsubHost, type: 'get', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
247 .c('items', {node: Strophe.NS.C2SSTREAM}), _cbNewC2S); |
ba2e78661ea8
mod_admin_web: Make module global. Host to administrate is now chooseable
Florian Zeitz <florob@babelmonkeys.de>
parents:
317
diff
changeset
|
248 }); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
249 }); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
250 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
251 window.onunload = window.onbeforeunload = function() { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
252 if (connection) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
253 connection.disconnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
254 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
255 } |