- progress
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
<template name='configPage'>
|
||||
<div class='container'>
|
||||
<div class='row'>
|
||||
<h1>confighub.io</h1>
|
||||
<div class="page-header">
|
||||
<a href="/">
|
||||
<h1>confighub.io</h1>
|
||||
</a>
|
||||
</div>
|
||||
<div class='col-lg-12'>
|
||||
<h2>
|
||||
Configuration for {{ config.type }}
|
||||
@@ -12,11 +16,11 @@
|
||||
|
||||
<div class="col-lg-12">
|
||||
|
||||
Description <input type="text" value={{config.description}}>
|
||||
Description <input type="text" class='description' value={{config.description}}>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
|
||||
File path <input type="text" value={{config.filePath}}>
|
||||
File path <input type="text" class='file-path' value={{config.filePath}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -2,6 +2,8 @@ Template.configPage.events({
|
||||
"click .save-config-details-btn": function(event, template) {
|
||||
console.log('should save config!!!');
|
||||
var content = template.find('#config-content').value;
|
||||
var filePath = template.find('.file-path').value;
|
||||
var description = template.find('.description').value;
|
||||
// Machines.update({});
|
||||
var config = Template.instance().data.config;
|
||||
// var machine = Machines.findOne({ machineId: Template.instance().data.machine.machineId });
|
||||
@@ -15,11 +17,25 @@ Template.configPage.events({
|
||||
// }
|
||||
// }
|
||||
// Machines.update({
|
||||
// "configurations._id": Template.instance().data.config._id,
|
||||
// "machineId": Template.instance().data.machine.machineId
|
||||
// "configurations._id": Template.instance().data.config._id
|
||||
// }, {
|
||||
// content: content
|
||||
// });
|
||||
|
||||
Meteor.call('updateConfiguration',
|
||||
Template.instance().data.machine.machineId, config._id, {
|
||||
content: content,
|
||||
filePath: filePath,
|
||||
description: description
|
||||
}, function(error, result) {
|
||||
if (error) {
|
||||
// handle error
|
||||
console.log('error!!!!', error);
|
||||
} else {
|
||||
console.log(result);
|
||||
// examine result
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -27,12 +43,12 @@ Template.configPage.events({
|
||||
|
||||
Template.configPage.helpers({
|
||||
"editorOptions": function() {
|
||||
return {
|
||||
lineNumbers: true,
|
||||
mode: "javascript"
|
||||
}
|
||||
return {
|
||||
lineNumbers: true,
|
||||
mode: "javascript"
|
||||
}
|
||||
},
|
||||
"editorCode": function(a,template) {
|
||||
"editorCode": function(a, template) {
|
||||
return Template.instance().data.config.content;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user