bunch of functionlity
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<template name='newConfigurationDialog'>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
|
||||
Configuration type
|
||||
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
|
||||
<select name="configurationTypes" class='config-type'>
|
||||
|
||||
<option value="apache">Apache</option>
|
||||
<option value="nginx">Nginx</option>
|
||||
<option value="elasticsearch">Elasticsearch</option>
|
||||
<option value="unicorn">Unicorn</option>
|
||||
<option value="passenger">Passenger</option>
|
||||
<option value="hosts">HOSTS file</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="colg-lg-3">
|
||||
<input type="text" class='configuration-description form-control' placeholder="Description" />
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<button class="save-config-btn">Save</button>
|
||||
<button class="cancel-save-config-btn">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,36 @@
|
||||
Template.newConfigurationDialog.events({
|
||||
"click .save-config-btn": function(event, template) {
|
||||
// console.log(template.data.machineId);
|
||||
// var text = template.find('.machine-name').value; //vent.target.machineName.value;
|
||||
var machine = Machines.findOne({
|
||||
machineId: template.data.machineId
|
||||
});
|
||||
|
||||
var configDescription = template.find('.configuration-description').value;
|
||||
var configType = template.find('.config-type').value;
|
||||
|
||||
if (machine) {
|
||||
Machines.update({
|
||||
_id: machine._id
|
||||
}, {
|
||||
$push: {
|
||||
configurations: {
|
||||
machineId: machine.machineId,
|
||||
_id: (new Mongo.ObjectID()).toHexString(),
|
||||
description: configDescription,
|
||||
type: configType
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// db.students.update(
|
||||
// { _id: 1 },
|
||||
// { $push: { scores: 89 } }
|
||||
// )
|
||||
}
|
||||
Session.set('newConfigurationRequested', false);
|
||||
},
|
||||
"click .cancel-save-config-btn": function(event, template) {
|
||||
Session.set('newConfigurationRequested', false);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user