mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
ADD action cable for migrate project
This commit is contained in:
13
app/assets/javascripts/cable.js
Normal file
13
app/assets/javascripts/cable.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// Action Cable provides the framework to deal with WebSockets in Rails.
|
||||
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
||||
//
|
||||
//= require action_cable
|
||||
//= require_self
|
||||
//= require_tree ./channels
|
||||
|
||||
(function() {
|
||||
this.App || (this.App = {});
|
||||
|
||||
App.cable = ActionCable.createConsumer();
|
||||
|
||||
}).call(this);
|
||||
13
app/assets/javascripts/channels/mirror_project.js
Normal file
13
app/assets/javascripts/channels/mirror_project.js
Normal file
@@ -0,0 +1,13 @@
|
||||
App.mirror_project = App.cable.subscriptions.create("MirrorProjectChannel", {
|
||||
connected: function() {
|
||||
// Called when the subscription is ready for use on the server
|
||||
},
|
||||
|
||||
disconnected: function() {
|
||||
// Called when the subscription has been terminated by the server
|
||||
},
|
||||
|
||||
received: function(data) {
|
||||
// Called when there's incoming data on the websocket for this channel
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user