mirror of
https://github.com/Febbweiss/ProjectDeployer.git
synced 2026-03-04 22:25:38 +00:00
Feature: add routes
This commit is contained in:
@@ -19,3 +19,5 @@ ecmascript # Enable ECMAScript2015+ syntax in app code
|
|||||||
insecure # Allow all DB writes from clients (for prototyping)
|
insecure # Allow all DB writes from clients (for prototyping)
|
||||||
twbs:bootstrap-noglyph
|
twbs:bootstrap-noglyph
|
||||||
fortawesome:fontawesome
|
fortawesome:fontawesome
|
||||||
|
iron:router
|
||||||
|
zenorocha:clipboard
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ htmljs@1.0.5
|
|||||||
http@1.1.1
|
http@1.1.1
|
||||||
id-map@1.0.4
|
id-map@1.0.4
|
||||||
insecure@1.0.4
|
insecure@1.0.4
|
||||||
|
iron:controller@1.0.12
|
||||||
|
iron:core@1.0.11
|
||||||
|
iron:dynamic-template@1.0.12
|
||||||
|
iron:layout@1.0.12
|
||||||
|
iron:location@1.0.11
|
||||||
|
iron:middleware-stack@1.0.11
|
||||||
|
iron:router@1.0.12
|
||||||
|
iron:url@1.0.11
|
||||||
jquery@1.11.4
|
jquery@1.11.4
|
||||||
launch-screen@1.0.4
|
launch-screen@1.0.4
|
||||||
livedata@1.0.15
|
livedata@1.0.15
|
||||||
@@ -65,3 +73,4 @@ underscore@1.0.4
|
|||||||
url@1.0.5
|
url@1.0.5
|
||||||
webapp@1.2.2
|
webapp@1.2.2
|
||||||
webapp-hashing@1.0.5
|
webapp-hashing@1.0.5
|
||||||
|
zenorocha:clipboard@1.4.2
|
||||||
|
|||||||
@@ -2,37 +2,57 @@
|
|||||||
<title>project-deployer</title>
|
<title>project-deployer</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<template name="layout">
|
||||||
|
{{> nav}}
|
||||||
|
<div class="container-fluid">
|
||||||
|
{{> yield }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="nav">
|
||||||
<nav class="navbar navbar-default">
|
<nav class="navbar navbar-default">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<a class="navbar-brand" href="#">
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
||||||
Project deployer
|
<span class="sr-only">Toggle navigation</span>
|
||||||
</a>
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="/">Project deployer</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<header>
|
|
||||||
|
|
||||||
</header>
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
<div class="row">
|
<li class="active">
|
||||||
<div class="col-sm-6">
|
<a href="/management">Projects <span class="sr-only">(current)</span></a>
|
||||||
<h2>Register or edit a project</h2>
|
</li>
|
||||||
{{> projectForm}}
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<h2>Your projects</h2>
|
|
||||||
<ul>
|
|
||||||
{{#each projects}}
|
|
||||||
{{> project}}
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</nav>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="home">
|
||||||
|
<h1>Welcome to Project deployer</h1>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="management">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h2>Register or edit a project</h2>
|
||||||
|
{{> projectForm}}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h2>Your projects</h2>
|
||||||
|
<ul>
|
||||||
|
{{#each projects}}
|
||||||
|
{{> project}}
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</template>
|
||||||
|
|
||||||
<template name="projectForm">
|
<template name="projectForm">
|
||||||
<form class="new-project form-horizontal">
|
<form class="new-project form-horizontal">
|
||||||
@@ -84,16 +104,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{#with project}}
|
{{#with project}}
|
||||||
<div class="form-group">
|
<div class="form-group ">
|
||||||
<label class="col-sm-2 control-label">
|
<label class="col-sm-2 control-label">
|
||||||
<i class="fa fa-fw fa-cog fa-2x" title="Link to provide to CI (Travis)"></i>
|
<i class="fa fa-fw fa-cog fa-2x" title="Link to provide to CI (Travis)"></i>
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" disabled value="{{deployLink}}"/>
|
<input type="text" id="deployLink" class="form-control" readonly="readonly" title="{{deployLink}}" value="{{deployLink}}"/>
|
||||||
<div class="input-group-addon">
|
<span class="input-group-btn">
|
||||||
<i class="fa fa-fw fa-clipboard copy"></i>
|
<a class="btn btn-default clipboard" data-clipboard-target="#deployLink">
|
||||||
</div>
|
<i class="fa fa-fw fa-clipboard copy"></i>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,16 +3,21 @@ Projects = new Mongo.Collection('projects');
|
|||||||
if (Meteor.isClient) {
|
if (Meteor.isClient) {
|
||||||
Meteor.subscribe('projects');
|
Meteor.subscribe('projects');
|
||||||
|
|
||||||
Template.body.helpers({
|
Template.management.helpers({
|
||||||
projects: function () {
|
projects: function () {
|
||||||
return Projects.find({}, {sort: {label: 1}});
|
return Projects.find({}, {sort: {label: 1}});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.projectForm.onRendered(function() {
|
||||||
|
new Clipboard('.btn.clipboard');
|
||||||
|
});
|
||||||
|
|
||||||
Template.projectForm.events({
|
Template.projectForm.events({
|
||||||
'submit .new-project': function (event) {
|
'submit .new-project': function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var form = event.target;
|
var form = event.target;
|
||||||
|
console.log('handled', form.id.value);
|
||||||
if( form.id.value ) {
|
if( form.id.value ) {
|
||||||
Meteor.call('editProject',form.id.value, form.label.value, form.git_url.value, form.public_url.value, form.commands.value);
|
Meteor.call('editProject',form.id.value, form.label.value, form.git_url.value, form.public_url.value, form.commands.value);
|
||||||
form.id.value = '';
|
form.id.value = '';
|
||||||
@@ -51,7 +56,7 @@ if (Meteor.isClient) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
deployLink: function() {
|
deployLink: function() {
|
||||||
return Meteor.absoluteUrl('/deploy?token=XXXX&project_id=' + Session.get('projectToEdit')._id);
|
return Meteor.absoluteUrl('deploy?token=XXXX&project_id=' + Session.get('projectToEdit')._id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -82,15 +87,17 @@ Meteor.methods({
|
|||||||
},
|
},
|
||||||
|
|
||||||
addProject: function(label, git_url, public_url ,commands) {
|
addProject: function(label, git_url, public_url ,commands) {
|
||||||
|
console.log('addProjects', arguments);
|
||||||
Projects.insert({
|
Projects.insert({
|
||||||
label: label,
|
label: label,
|
||||||
git_url: git_url,
|
git_url: git_url,
|
||||||
public_url: public_url,
|
public_url: public_url,
|
||||||
commands: commands
|
commands: commands
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
editProject: function(id, label, git_url, public_url ,commands) {
|
editProject: function(id, label, git_url, public_url ,commands) {
|
||||||
|
console.log('editProjects', arguments);
|
||||||
Projects.update(
|
Projects.update(
|
||||||
id,
|
id,
|
||||||
{ $set: {
|
{ $set: {
|
||||||
|
|||||||
Reference in New Issue
Block a user