mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
create user on Portal, experimental
This commit is contained in:
@@ -41,6 +41,17 @@ var App = Ember.Application.create({
|
||||
}
|
||||
});
|
||||
|
||||
App.ApplicationRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
// alert("setupController");
|
||||
},
|
||||
actions: {
|
||||
newUser: function() {
|
||||
return Bootstrap.ModalManager.show('newUserForm');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
App.CallsRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
// Set the IndexController's `title`
|
||||
@@ -196,6 +207,17 @@ App.UsersRoute = Ember.Route.extend({
|
||||
}
|
||||
});
|
||||
|
||||
App.newUserRoute = Ember.Route.extend({
|
||||
setupController: function(Controller) {
|
||||
alert("auto_update_calls");
|
||||
},
|
||||
actions: {
|
||||
show: function(controller) {
|
||||
App.newUserController.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
App.Router.map(function(){
|
||||
this.route("calls");
|
||||
this.route("channels");
|
||||
@@ -218,6 +240,7 @@ App.Router.map(function(){
|
||||
this.route("showLimits");
|
||||
this.route("show");
|
||||
this.route("users");
|
||||
this.route("newUser");
|
||||
this.route("about", { path: "/about" });
|
||||
});
|
||||
|
||||
@@ -243,6 +266,14 @@ App.Channel = Em.Object.extend({
|
||||
|
||||
});
|
||||
|
||||
App.ApplicationController = Ember.ObjectController.extend({
|
||||
actions: {
|
||||
newUser: function() {
|
||||
alert("ApplicationController");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
App.callsController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
init: function(){
|
||||
@@ -714,6 +745,39 @@ App.usersController = Ember.ArrayController.create({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
App.UsersController = Ember.ObjectController.extend({
|
||||
xnewUserButtons: [
|
||||
{title: 'Submit', clicked: "submit"},
|
||||
{title: 'Cancel', clicked: "cancel", dismiss: 'modal'}
|
||||
],
|
||||
|
||||
actions: {
|
||||
//Submit the modal
|
||||
submit: function() {
|
||||
$.post("/txtapi/lua?create_user.lua%20" + $("#user_id").val(), {
|
||||
data: "user_id=xxxx",
|
||||
success: function() { },
|
||||
error: function(e) { }
|
||||
});
|
||||
|
||||
// Bootstrap.NM.push('Successfully submitted modal', 'success');
|
||||
return Bootstrap.ModalManager.hide('newUserForm');
|
||||
},
|
||||
|
||||
//Cancel the modal, we don't need to hide the model manually because we set {..., dismiss: 'modal'} on the button meta data
|
||||
cancel: function() {
|
||||
Bootstrap.ModalManager.hide('newUserForm');
|
||||
return Bootstrap.NM.push('Modal was cancelled', 'info');
|
||||
},
|
||||
|
||||
//Show the modal
|
||||
newUser: function() {
|
||||
return Bootstrap.ModalManager.show('newUserForm');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// App.initialize();
|
||||
var global_debug_event = false;
|
||||
var global_background_job = false;
|
||||
|
Reference in New Issue
Block a user