|
@@ -36,6 +36,8 @@ class WSPushService extends AdvancedBase {
|
|
this._on_upload_progress.bind(this));
|
|
this._on_upload_progress.bind(this));
|
|
this.svc_event.on('fs.storage.progress.*',
|
|
this.svc_event.on('fs.storage.progress.*',
|
|
this._on_upload_progress.bind(this));
|
|
this._on_upload_progress.bind(this));
|
|
|
|
+ this.svc_event.on('outer.gui.*',
|
|
|
|
+ this._on_outer_gui.bind(this));
|
|
}
|
|
}
|
|
|
|
|
|
async _on_fs_create (key, data) {
|
|
async _on_fs_create (key, data) {
|
|
@@ -70,6 +72,11 @@ class WSPushService extends AdvancedBase {
|
|
for ( const user_id of user_id_list ) {
|
|
for ( const user_id of user_id_list ) {
|
|
io.to(user_id).emit('item.added', response);
|
|
io.to(user_id).emit('item.added', response);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this.svc_event.emit('outer.gui.item.added', {
|
|
|
|
+ user_id_list,
|
|
|
|
+ response,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
async _on_fs_update (key, data) {
|
|
async _on_fs_update (key, data) {
|
|
@@ -104,6 +111,11 @@ class WSPushService extends AdvancedBase {
|
|
for ( const user_id of user_id_list ) {
|
|
for ( const user_id of user_id_list ) {
|
|
io.to(user_id).emit('item.updated', response);
|
|
io.to(user_id).emit('item.updated', response);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this.svc_event.emit('outer.gui.item.updated', {
|
|
|
|
+ user_id_list,
|
|
|
|
+ response,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
async _on_fs_move (key, data) {
|
|
async _on_fs_move (key, data) {
|
|
@@ -139,6 +151,11 @@ class WSPushService extends AdvancedBase {
|
|
for ( const user_id of user_id_list ) {
|
|
for ( const user_id of user_id_list ) {
|
|
io.to(user_id).emit('item.moved', response);
|
|
io.to(user_id).emit('item.moved', response);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this.svc_event.emit('outer.gui.item.moved', {
|
|
|
|
+ user_id_list,
|
|
|
|
+ response,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
async _on_fs_pending (key, data) {
|
|
async _on_fs_pending (key, data) {
|
|
@@ -172,6 +189,10 @@ class WSPushService extends AdvancedBase {
|
|
for ( const user_id of user_id_list ) {
|
|
for ( const user_id of user_id_list ) {
|
|
io.to(user_id).emit('item.pending', response);
|
|
io.to(user_id).emit('item.pending', response);
|
|
}
|
|
}
|
|
|
|
+ this.svc_event.emit('outer.gui.item.pending', {
|
|
|
|
+ user_id_list,
|
|
|
|
+ response,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
async _on_upload_progress (key, data) {
|
|
async _on_upload_progress (key, data) {
|
|
@@ -225,6 +246,19 @@ class WSPushService extends AdvancedBase {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ async _on_outer_gui (key, { user_id_list, response }, meta) {
|
|
|
|
+ if ( ! meta.from_outside ) return;
|
|
|
|
+
|
|
|
|
+ key = key.slice('outer.gui.'.length);
|
|
|
|
+
|
|
|
|
+ const { socketio } = this.modules;
|
|
|
|
+
|
|
|
|
+ const io = socketio.getio();
|
|
|
|
+ for ( const user_id of user_id_list ) {
|
|
|
|
+ io.to(user_id).emit(key, response);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
module.exports = {
|