fcf.module({
  name: "fcfManagement:templates/pages/system/system+body.receive.js",
  dependencies: [],
  module: function(){
    fcf.application.getEventChannel().on("fcfManagement_restart_node_processes", async ()=>{
      await fcf.application.getEventChannel().send("fcfserver_restart_processes", {}, {inner: true});
    });

    return class Handler {
      async receive (a_fields, a_files){
        if (a_fields.command == "restart"){
          await fcf.application.getEventChannel().send("fcfManagement_restart_node_processes", {}, {active: true, endpoints: [{server:"*", processPair: 0}]});
        }
      }
    }
  }
});
