Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
214 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* Copyright 2016-2017 LasLabs Inc. | ||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
*/ | ||
|
||
odoo.define('red_october.DialogVaultNew', function (require) { | ||
"use strict"; | ||
|
||
var core = require('web.core'); | ||
var Dialog = require('web.Dialog'); | ||
var mixins = require('red_october.mixins'); | ||
var Model = require('web.DataModel'); | ||
|
||
var _t = core._t; | ||
|
||
/* It allows a user to get their profile password. | ||
Attributes: | ||
*/ | ||
var DialogVaultNew = Dialog.extend( | ||
mixins.dialogMixin, | ||
mixins.formMixin, | ||
{ | ||
|
||
templateInner: 'red_october.FormVaultNew', | ||
|
||
options: { | ||
title: _t('Enter Vault Info'), | ||
buttons: [ | ||
{ | ||
text: _t('Submit'), | ||
classes: 'btn btn-primary', | ||
close: true, | ||
click: function(event){ | ||
this.$form.submit(); | ||
}, | ||
}, | ||
{ | ||
text: _t('Cancel'), | ||
classes: 'btn btn-default', | ||
close: true, | ||
click: function () { | ||
this.resetUI(); | ||
} | ||
}, | ||
], | ||
}, | ||
|
||
handleSubmit: function (event) { | ||
|
||
event.preventDefault(); | ||
|
||
var $target = $(event.target); | ||
var $parent = this.getParent(); | ||
var arrData = $target.serializeArray(); | ||
var objData = {}; | ||
var Vaults = new Model('red.october.vault'); | ||
|
||
_.each(arrData, function(data) { | ||
objData[data.name] = data.value; | ||
}) | ||
|
||
var vault = Vaults.call( | ||
'create', | ||
[{ | ||
'host': objData.host, | ||
'port': objData.port, | ||
'verify_cert': objData.verify_cert || false, | ||
}] | ||
); | ||
vault.done( | ||
this.proxy(function (record) { | ||
$parent.$el.trigger( | ||
'activateVault', | ||
record, | ||
objData.is_active | ||
); | ||
}) | ||
); | ||
return vault; | ||
}, | ||
|
||
} | ||
); | ||
|
||
return DialogVaultNew; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
Copyright 2016-2017 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
--> | ||
|
||
<template> | ||
|
||
<t t-name="red_october.FormVaultNew"> | ||
<form id="roVaultNewForm" | ||
method="POST" | ||
> | ||
<input type="hidden" | ||
name="csrf_token" | ||
t-att-value="csrf_token" /> | ||
<div class="form-group"> | ||
<label for="host"> | ||
Host | ||
</label> | ||
<input type="text" | ||
name="host" | ||
class="form-control" | ||
required="" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="port"> | ||
Port | ||
</label> | ||
<input type="number" | ||
name="port" | ||
class="form-control" | ||
value="8080" | ||
required="" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="verify_cert"> | ||
Verify Cert | ||
</label> | ||
<input type="checkbox" | ||
name="verify_cert" | ||
class="form-control" | ||
checked="" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="is_active"> | ||
Is Active | ||
</label> | ||
<input type="checkbox" | ||
name="is_active" | ||
class="form-control" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="password"> | ||
Password | ||
</label> | ||
<input type="password" | ||
name="password" | ||
class="form-control" | ||
required="" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="password"> | ||
Confirm Password | ||
</label> | ||
<input type="password" | ||
name="confirm_password" | ||
class="form-control" | ||
required="" /> | ||
</div> | ||
<div class="form_result text-center" /> | ||
</form> | ||
</t> | ||
|
||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters