Update acp.js to be compatible with new actionlog
This commit is contained in:
parent
b342be50a3
commit
e7b22997c7
9
acp.js
9
acp.js
|
|
@ -10,10 +10,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Auth = require("./auth");
|
var Auth = require("./auth");
|
||||||
var ActionLog = require("./actionlog");
|
|
||||||
|
|
||||||
module.exports = function (Server) {
|
module.exports = function (Server) {
|
||||||
var db = Server.db;
|
var db = Server.db;
|
||||||
|
var ActionLog = require("./actionlog")(Server);
|
||||||
return {
|
return {
|
||||||
init: function(user) {
|
init: function(user) {
|
||||||
ActionLog.record(user.ip, user.name, "acp-init");
|
ActionLog.record(user.ip, user.name, "acp-init");
|
||||||
|
|
@ -143,9 +143,10 @@ module.exports = function (Server) {
|
||||||
});
|
});
|
||||||
|
|
||||||
user.socket.on("acp-actionlog-list", function () {
|
user.socket.on("acp-actionlog-list", function () {
|
||||||
user.socket.emit("acp-actionlog-list",
|
ActionLog.listActionTypes(function (err, types) {
|
||||||
ActionLog.getLogTypes()
|
if(!err)
|
||||||
);
|
user.socket.emit("acp-actionlog-list", types);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
user.socket.on("acp-actionlog-clear", function(data) {
|
user.socket.on("acp-actionlog-clear", function(data) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue