Skip to content

Commit

Permalink
Merge pull request #20 from resolutionsystems/feature/addingOptionalS…
Browse files Browse the repository at this point in the history
…TSARN

Feature/adding optional stsarn
  • Loading branch information
Reggino committed May 29, 2017
2 parents 51ec1ba + c7d45b9 commit 1aac01c
Show file tree
Hide file tree
Showing 19 changed files with 157 additions and 635 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Expand Up @@ -19,7 +19,7 @@ module.exports = function(grunt) {
connect: {
server: {
options: {
port: 80,
port: 3080,
keepalive: true
}
}
Expand Down Expand Up @@ -67,4 +67,4 @@ module.exports = function(grunt) {
process.exit();
}, 1000);
});
};
};
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -45,8 +45,9 @@ Get a working local development version of the app
3. Install submodule (```git submodule init && git submodule update```)
4. Run ```npm install -g grunt-cli```
5. Run ```npm install```
6. Run ```grunt``` (or ```sudo grunt```)
7. Start your chrome with ```--disable-web-security``` and open http://localhost
6. Run ```./node_modules/.bin/bower install```
7. Run ```grunt``` (or ```sudo grunt```)
8. Start your chrome with ```--disable-web-security``` and open http://localhost:3080/

When something nice is created:

Expand Down
37 changes: 31 additions & 6 deletions app/SimpleDb.js
Expand Up @@ -4,6 +4,11 @@
Ext.define('SdbNavigator.SimpleDb', {
singleton: true,
boxUsage: 0.0,
signer: null,

resetConnection: function () {
this.signer = null;
},

getQueryParts: function (query) {
// select output_list from domain_name [where expression] [sort_instructions] [limit limit]
Expand Down Expand Up @@ -111,12 +116,20 @@ Ext.define('SdbNavigator.SimpleDb', {

doQuery: function (method, params, callback) {
var host, signer, self = this;
var _this = this;

host = Ext.getCmp('region').getValue();
signer = new AWSV2Signer(Ext.getCmp('awsAccessKey').getValue(), Ext.getCmp('awsSecretKey').getValue());

Ext.Ajax.request({
url: 'https://' + host,
params: signer.sign(Ext.merge(
if (this.signer == null) {
this.signer = new AWSV2Signer(
Ext.getCmp('awsAccessKey').getValue(),
Ext.getCmp('awsSecretKey').getValue(),
Ext.getCmp('awsStsArn').getValue()
);
}

this.signer.asyncSign(
Ext.merge(
params,
{
Version: '2009-04-15'
Expand All @@ -125,7 +138,19 @@ Ext.define('SdbNavigator.SimpleDb', {
"verb": method,
"host": host,
"uriPath": "/"
}),
},
function(signedParams) {
_this.doQuery2(method, params, callback, signedParams);
}
);
},

doQuery2: function(method, params, callback, signedParams) {
var self = this;
var host = Ext.getCmp('region').getValue();
Ext.Ajax.request({
url: 'https://' + host,
params: signedParams,
method: method,
success: function (response) {
var lastBoxUsage = parseFloat(Ext.DomQuery.selectValue('BoxUsage', response.responseXML));
Expand All @@ -150,4 +175,4 @@ Ext.define('SdbNavigator.SimpleDb', {
disableCaching: false
});
}
});
});
1 change: 1 addition & 0 deletions app/controller/Settings.js
Expand Up @@ -19,6 +19,7 @@ Ext.define('SdbNavigator.controller.Settings', {

'#settingsPanel #connectButton': {
click: function(button) {
SdbNavigator.SimpleDb.resetConnection();
this.listDomains(button.up('#settingsPanel'));
}
},
Expand Down
32 changes: 31 additions & 1 deletion app/view/SettingsPanel.js
Expand Up @@ -52,6 +52,7 @@ Ext.define('SdbNavigator.view.SettingsPanel', {
},
items: [
{
flex: 0.7,
items: [
{
xtype: 'label',
Expand All @@ -76,6 +77,7 @@ Ext.define('SdbNavigator.view.SettingsPanel', {
]
},
{
flex: 0.7,
items: [
{
xtype: 'label',
Expand All @@ -101,6 +103,32 @@ Ext.define('SdbNavigator.view.SettingsPanel', {
]
},
{
flex: 1.5,
items: [
{
xtype: 'label',
text: 'STS ARN (Optional)',
forId: 'awsStsArn'
},
{
id: 'awsStsArn',
xtype: 'textfield',
anchor: '100%',
allowBlank: true,
stateful: true,
stateId: 'awsStsArn',
stateEvents: ['change'],
applyState: function (state) {
this.setValue(state.value);
},
getState: function () {
return { value: this.getValue() };
}
}
]
},
{
flex: 0.6,
items: [
{
xtype: 'label',
Expand Down Expand Up @@ -136,6 +164,7 @@ Ext.define('SdbNavigator.view.SettingsPanel', {
]
},
{
flex: 0.5,
items: [
{
xtype: 'label',
Expand All @@ -152,6 +181,7 @@ Ext.define('SdbNavigator.view.SettingsPanel', {
]
},
{
flex: 0.35,
bodyPadding: '19 4',
items: [
{
Expand All @@ -163,4 +193,4 @@ Ext.define('SdbNavigator.view.SettingsPanel', {
]
}
]
});
});
2 changes: 0 additions & 2 deletions node_modules/wrench/.npmignore

This file was deleted.

21 changes: 0 additions & 21 deletions node_modules/wrench/LICENSE

This file was deleted.

0 comments on commit 1aac01c

Please sign in to comment.