Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (obj && obj.UserData) {
obj.UserData = new Buffer(JSON.stringify(obj.UserData)).toString('base64');
}
};
const decodeUserData = obj => {
if (obj && obj.UserData) {
obj.UserData = JSON.parse(new Buffer(obj.UserData, 'base64').toString());
}
};
/* eslint-enable no-param-reassign */
const WorkerTypeEditor = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://aws-provisioner.taskcluster.net/v1',
},
},
reloadOnProps: ['definition', 'workerType'],
}),
],
propTypes: {
// Callback to be called with workerType operated on as parameter
updated: React.PropTypes.func.isRequired,
// WorkerType to update, null of none
workerType: React.PropTypes.string,
definition: React.PropTypes.object.isRequired,
],
"regions": [
{
"region": "us-west-2",
"overwrites": {
"ImageId": "ami-abcdefg"
}
}
]
};
var WorkerTypeEdit = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://taskcluster-aws-provisioner2.herokuapp.com/v1'
}
}
}),
],
getInitialState: function() {
var worker = this.props.value || defaultWorkerType;
console.log(worker);
function decodeUD(str) {
return JSON.parse(new Buffer(str, 'base64').toString());
}
selectWorkerType={that.props.selectWorkerType}
reload={that.reload} />;
})
}
);
},
});
var WorkerTypeRow = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
queue: taskcluster.Queue,
awsProvisioner: taskcluster.AwsProvisioner
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://taskcluster-aws-provisioner2.herokuapp.com/v1'
}
}
}),
],
propTypes: {
workerType: React.PropTypes.string.isRequired,
awsState: React.PropTypes.shape({
running: React.PropTypes.arrayOf(React.PropTypes.object),
pending: React.PropTypes.arrayOf(React.PropTypes.object),
spotReq: React.PropTypes.arrayOf(React.PropTypes.object),
}).isRequired,
import React from 'react';
import {OverlayTrigger, ProgressBar, Tooltip, ButtonToolbar, Button, Glyphicon, Table} from 'react-bootstrap';
import * as utils from '../lib/utils';
import taskcluster from 'taskcluster-client';
import _ from 'lodash';
import WorkerTypeView from './workertypeview';
import WorkerTypeEditor from './workertypeeditor';
import './aws-provisioner.less';
const WorkerTypeRow = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
queue: taskcluster.Queue,
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://aws-provisioner.taskcluster.net/v1',
},
},
reloadOnProps: [
'provisionerId',
'workerType',
],
}),
],
propTypes: {
provisionerId: React.PropTypes.string.isRequired,
workerType: React.PropTypes.shape({
var bs = require('react-bootstrap');
var utils = require('../lib/utils');
var taskcluster = require('taskcluster-client');
var _ = require('lodash');
var format = require('../lib/format');
var ConfirmAction = require('../lib/ui/confirmaction');
var WorkerTypeEdit = require('./workertypeedit');
var WorkerTypeDetail = require('./workerdetail');
const PROVISIONER_ID = 'aws-provisioner-v1';
var WorkerTypeTable = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://taskcluster-aws-provisioner2.herokuapp.com/v1'
}
}
}),
],
propTypes: {
selectWorkerType: React.PropTypes.func.isRequired,
},
getInitialState: function() {
return {
workerTypes: [],
var React = require('react');
var bs = require('react-bootstrap');
var utils = require('../lib/utils');
var taskcluster = require('taskcluster-client');
var _ = require('lodash');
var format = require('../lib/format');
var WorkerTypeView = require('./workertypeview');
var WorkerTypeEditor = require('./workertypeeditor');
var WorkerTypeRow = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
queue: taskcluster.Queue,
awsProvisioner: taskcluster.AwsProvisioner
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://aws-provisioner.taskcluster.net/v1'
}
},
reloadOnProps: [
'provisionerId',
'workerType'
]
})
],
propTypes: {
provisionerId: React.PropTypes.string.isRequired,
workerType: React.PropTypes.shape({
}
],
"userData": {},
"launchSpec": {
},
"secrets": {},
"scopes": []
};
/** Table of workerTypes */
var WorkerTypeTable = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://aws-provisioner.taskcluster.net/v1'
}
},
reloadOnProps: [
'provisionerId'
]
}),
utils.createLocationHashMixin({
keys: ['selected'],
type: 'string'
})
],
{pending * instTypeDef.capacity} ({pending} instances)
{spotReq * instTypeDef.capacity} ({spotReq} instances)
);
},
});
const WorkerTypeView = React.createClass({
mixins: [
utils.createTaskClusterMixin({
clients: {
queue: taskcluster.Queue,
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://aws-provisioner.taskcluster.net/v1',
},
},
reloadOnProps: [
'workerType',
'provisionerId',
],
}),
utils.createLocationHashMixin({
keys: ['currentTab'],
type: 'string',
}),
],
},
],
userData: {},
launchSpec: {},
secrets: {},
scopes: [],
};
/** Table of workerTypes */
export default React.createClass({
displayName: 'WorkerTypeTable',
mixins: [
utils.createTaskClusterMixin({
clients: {
awsProvisioner: taskcluster.AwsProvisioner,
},
clientOpts: {
awsProvisioner: {
baseUrl: 'https://aws-provisioner.taskcluster.net/v1',
},
},
reloadOnProps: [
'provisionerId',
],
}),
utils.createLocationHashMixin({
keys: ['selected'],
type: 'string',
}),
],