- progress
This commit is contained in:
@@ -1 +1,9 @@
|
||||
/* CSS declarations go here */
|
||||
.thumbnail {
|
||||
border: 0 none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.main-header {
|
||||
background-color: rebeccapurple;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
<template name='home'>
|
||||
<div class="navbar main-header">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="navbar-header">
|
||||
<a href="/">
|
||||
<h1>confighub.io</h1>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class='container'>
|
||||
<div class='row'>
|
||||
<h1>confighub.io</h1>
|
||||
<div class='col-lg-12'>
|
||||
<h2>
|
||||
Your machines
|
||||
@@ -13,7 +24,7 @@
|
||||
{{#unless newMachineRequested}}
|
||||
<div class="row">
|
||||
<div class='col-lg-12'>
|
||||
<button type='button' class='add-new-machine-btn'>Add new machine</button>
|
||||
<button type='button' class='btn add-new-machine-btn'>Add new machine</button>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}} {{#if newMachineRequested}} {{> newMachine }} {{/if}}
|
||||
|
||||
@@ -50,6 +50,10 @@ Template.newMachine.helpers({
|
||||
});
|
||||
|
||||
Template.newMachine.events({
|
||||
"click .new-machine-cancel-btn": function() {
|
||||
Session.set('newMachineJustAdded', false);
|
||||
Session.set('newMachineRequested', false);
|
||||
},
|
||||
"click .close-new-machine-btn": function() {
|
||||
Session.set('newMachineJustAdded', false);
|
||||
Session.set('newMachineRequested', false);
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<template name='machinePage'>
|
||||
<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>
|
||||
Machine details: {{ name }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template name="machineDetails">
|
||||
<div class="col-lg-4" style="text-align: center;">
|
||||
<div class="col-lg-4 thumbnail" style="text-align: center;">
|
||||
<a href=machine/{{ machineId }}>
|
||||
<img src='https://d13yacurqjgara.cloudfront.net/users/595800/screenshots/1702094/linux_1x.png' style="width: 200px; 130px;" />
|
||||
<br />
|
||||
@@ -8,8 +8,9 @@
|
||||
</div>
|
||||
|
||||
</a>
|
||||
<div style="text-align: center;" class="machine-status">
|
||||
status: {{status}}
|
||||
</div>
|
||||
<span class="text-center label label-warning">
|
||||
{{status}}
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
<template name="newMachine">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<h3>Add new machine</h3>
|
||||
<form class="new-machine">
|
||||
<input type="text" name="machineName" class='machine-name' placeholder="Machine Name" />
|
||||
<button type='button' name='btnAddNewMachine' class='new-machine-save-btn'>Add new machine</button>
|
||||
<input type="text" name="machineName" class='form-control machine-name' placeholder="Machine Name" />
|
||||
<button type='button' name='btnAddNewMachine' class='btn btn-default new-machine-save-btn'>Save</button>
|
||||
<button type='button' class='btn btn-default new-machine-cancel-btn'>Cancel</button>
|
||||
|
||||
{{#if newMachineAdded}}
|
||||
<div>You have successfully added a new machine. Please run <b>'chub init {{newMachineAdded}}'</b> on your computer. </div>
|
||||
<button type='button' class='close-new-machine-btn'>Ok! Got It.</button>
|
||||
<div>You have successfully added a new machine. Please run <pre>'chub init {{newMachineAdded}}'</pre> on your computer. </div>
|
||||
<button type='button' class='btn btn-default close-new-machine-btn'>Ok, Got It!</button>
|
||||
{{/if}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user