simple code to add a gateway

This commit is contained in:
Seven Du 2014-03-15 00:04:56 +08:00
parent 5b1ab59f00
commit af4a225b39
2 changed files with 29 additions and 16 deletions

View File

@ -851,9 +851,15 @@ App.SofiaStatusController = Ember.ObjectController.extend({
actions: {
//Submit the modal
submit: function() {
alert("Not implemented");
return false;
$.post("/txtapi/lua?create_gw.lua%20" + $("#gateway_name").val(), {
// alert("Not implemented");
// return false;
url = "/txtapi/lua?create_gateway.lua%20" +
$("#gateway_name").val() + "%20" +
$("#gateway_realm").val() + "%20" +
$("#gateway_username").val() + "%20" +
$("#gateway_password").val() + "%20" +
$("#gateway_register").is(":checked");
$.post(url, {
success: function() { },
error: function(e) { }
});

View File

@ -643,30 +643,37 @@
</div>
{{#bs-modal name="newUserForm" fade="true" footerButtonsBinding="addGatewayButtons" title="Add Gateway"}}
<div class="form-group form-horizontal">
<label class="control-label" for="gateway_name">Name</label>
<div class="controls">
<input type="text" name="gateway_name" value="">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-2 control-label" for="gateway_name">Name</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="gateway_name" placeholder="gw1">
</div>
</div>
<div class="form-group">
<label class="control-label" for="gateway_realm">Realm</label>
<div class="controls">
<input type="text" name="gateway_realm" value="">
<label class="col-sm-2 control-label" for="gateway_realm">Realm</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="gateway_realm" placeholder="example.com">
</div>
</div>
<div class="form-group">
<label class="control-label" for="gateway_name">Username</label>
<div class="controls">
<input type="text" name="gateway_username" value="">
<label class="col-sm-2 control-label" for="gateway_username">Username</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="gateway_username" placeholder="username">
</div>
</div>
<div class="form-group">
<label class="control-label" for="gateway_name">Password</label>
<div class="controls">
<input type="text" name="gateway_password" value="">
<label class="col-sm-2 control-label" for="gateway_password">Password</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="gateway_password" placeholder="password">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="gateway_register">Register?</label>
<input type="checkbox" checked id="gateway_register"/>
</div>
</form>
{{/bs-modal}}
<h1>Sofia Status</h1>