Allow channel admins to read channel logs

This commit is contained in:
calzoneman 2013-08-06 14:20:47 -04:00
parent 07249f3589
commit a371ff629d
6 changed files with 88 additions and 0 deletions

View file

@ -497,6 +497,19 @@ Callbacks = {
);
},
readChanLog: function (data) {
var log = $("#chanlog_contents");
if(log.length == 0)
return;
if(data.success) {
log.text(data.data);
} else {
log.text("Error reading channel log");
}
log.scrollTop(log.prop("scrollHeight"));
},
voteskip: function(data) {
if(data.count > 0) {
$("#voteskip").text("Voteskip ("+data.count+"/"+data.need+")");

View file

@ -45,6 +45,10 @@
$("#show_channelranks").click(function() {
socket.emit("requestChannelRanks");
});
clickHandler("#show_chanlog", "#chanlog");
$("#show_chanlog").click(function () {
socket.emit("readChanLog");
});
genPermissionsEditor();

View file

@ -812,6 +812,7 @@ function handleModPermissions() {
setVisible("#jsedit_tab", CLIENT.rank >= 3);
setVisible("#filteredit_tab", hasPermission("filteredit"));
setVisible("#channelranks_tab", CLIENT.rank >= 3);
setVisible("#chanlog_tab", CLIENT.rank >= 3);
setVisible("#chanopts_unregister_wrap", CLIENT.rank >= 10);
}

View file

@ -15,6 +15,7 @@
<li id="banlist_tab"><a href="javascript:void(0);" id="show_banlist">Ban List</a></li>
<li id="channelranks_tab"><a href="javascript:void(0);" id="show_channelranks">Channel Ranks</a></li>
<li id="loginhistory_tab"><a href="javascript:void(0);" id="show_loginhistory">Recent Connections</a></li>
<li id="chanlog_tab"><a href="javascript:void(0);" id="show_chanlog">Channel Log</a></li>
</ul>
</div>
<hr>
@ -223,3 +224,6 @@
</thead>
</table>
</div>
<div id="chanlog" class="span12">
<pre id="chanlog_contents" style="max-height: 400px; overflow-y: scroll"></pre>
</div>