mirror of https://gitee.com/bigwinds/arangodb
First draft of a create my own app template generator
This commit is contained in:
parent
0ad5395d53
commit
ca99f19d7d
|
@ -340,7 +340,7 @@ controller.get('/foxxes', function (req, res) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
controller.get('/foxxes/fishbowl', function (req, res) {
|
controller.get('/foxxes/fishbowl', function (req, res) {
|
||||||
FoxxManager.update();
|
// FoxxManager.update();
|
||||||
res.json(FoxxManager.availableJson());
|
res.json(FoxxManager.availableJson());
|
||||||
}).summary("List of all foxx apps submitted to the fishbowl store.")
|
}).summary("List of all foxx apps submitted to the fishbowl store.")
|
||||||
.notes("This function contacts the fishbowl and reports which apps are available for install");
|
.notes("This function contacts the fishbowl and reports which apps are available for install");
|
||||||
|
|
|
@ -1,19 +1,73 @@
|
||||||
<script id="modalApplicationMount.ejs" type="text/template">
|
<script id="modalApplicationMount.ejs" type="text/template">
|
||||||
<ul id="infoTab" class="nav nav-tabs">
|
<ul id="infoTab" class="nav nav-tabs">
|
||||||
<li class="active"><a href="#appstore" data-toggle="tab">App Store</a></li>
|
<li class="active"><a href="#newApp" data-toggle="tab">New App</a></li>
|
||||||
|
<li><a href="#appstore" data-toggle="tab">App Store</a></li>
|
||||||
<li><a href="#github" data-toggle="tab">Github</a></li>
|
<li><a href="#github" data-toggle="tab">Github</a></li>
|
||||||
<li><a href="#zip" data-toggle="tab">Zip</a></li>
|
<li><a href="#zip" data-toggle="tab">Zip</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content" id="tab-content-application-info">
|
<div class="tab-content" id="tab-content-application-info">
|
||||||
|
|
||||||
<div class="tab-pane active" id="appstore">
|
<div class="tab-pane active" id="newApp">
|
||||||
|
<table id="new-app-information">
|
||||||
|
<tr class="tableRow">
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
Author*:
|
||||||
|
</th>
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
<input type="text" id="author" value="" placeholder="Your Name">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="tableRow">
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
Name*:
|
||||||
|
</th>
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
<input type="text" id="name" value="" placeholder="Name of the App">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="tableRow">
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
Description*:
|
||||||
|
</th>
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
<input type="text" id="description" value="" placeholder="Please describe your App here">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="tableRow">
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
License*:
|
||||||
|
</th>
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
<input type="text" id="license" value="" placeholder="Apache 2"></input>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="tableRow">
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
Authentication*:
|
||||||
|
</th>
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
<input type="checkbox" id="authenticate" checked></input>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="tableRow">
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
Collections*:
|
||||||
|
</th>
|
||||||
|
<th class="collectionInfoTh">
|
||||||
|
<input type="hidden" id="new-app-collections" value="" placeholder="Collections"></input>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane" id="appstore">
|
||||||
<table id="appstore-content">
|
<table id="appstore-content">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane" id="github">
|
<div class="tab-pane" id="github">
|
||||||
<div>The repository has to be private. The version has to be a git tag LINKTOTAG.</div>
|
<div>The repository has to be public. The version has to be a git tag LINKTOTAG.</div>
|
||||||
<div>
|
<div>
|
||||||
<table>
|
<table>
|
||||||
<tr class="tableRow">
|
<tr class="tableRow">
|
||||||
|
|
|
@ -626,15 +626,58 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
generateNewFoxxApp: function() {
|
||||||
|
alert("GENERATOOOO!");
|
||||||
|
},
|
||||||
|
|
||||||
|
addAppAction: function() {
|
||||||
|
var openTab = $(".modal-body .tab-pane.active").attr("id");
|
||||||
|
switch (openTab) {
|
||||||
|
case "newApp":
|
||||||
|
this.generateNewFoxxApp();
|
||||||
|
break;
|
||||||
|
case "github":
|
||||||
|
this.installFoxxFromGithub();
|
||||||
|
break;
|
||||||
|
case "zip":
|
||||||
|
this.installFoxxFromZip();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
switchModalButton: function(event) {
|
||||||
|
var openTab = $(event.currentTarget).attr("href").substr(1);
|
||||||
|
var button = $("#modalButton1");
|
||||||
|
switch (openTab) {
|
||||||
|
case "newApp":
|
||||||
|
button.html("Generate");
|
||||||
|
button.prop("disabled", false);
|
||||||
|
break;
|
||||||
|
case "appstore":
|
||||||
|
button.html("Install");
|
||||||
|
button.prop("disabled", true);
|
||||||
|
break;
|
||||||
|
case "github":
|
||||||
|
case "zip":
|
||||||
|
button.html("Install");
|
||||||
|
button.prop("disabled", false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
createInstallModal: function(event) {
|
createInstallModal: function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var buttons = [];
|
var buttons = [];
|
||||||
var modalEvents = {
|
var modalEvents = {
|
||||||
"click #installGithub" : this.installFoxxFromGithub.bind(this),
|
"click #infoTab a": this.switchModalButton.bind(this),
|
||||||
"click #installZip" : this.installFoxxFromZip.bind(this),
|
|
||||||
"click .install-app" : this.installFoxxFromStore.bind(this),
|
"click .install-app" : this.installFoxxFromStore.bind(this),
|
||||||
"change #zip-file" : this.uploadSetup.bind(this)
|
"change #zip-file" : this.uploadSetup.bind(this)
|
||||||
};
|
};
|
||||||
|
buttons.push(
|
||||||
|
window.modalView.createSuccessButton("Generate", this.addAppAction.bind(this))
|
||||||
|
);
|
||||||
window.modalView.show(
|
window.modalView.show(
|
||||||
"modalApplicationMount.ejs",
|
"modalApplicationMount.ejs",
|
||||||
"Install Application",
|
"Install Application",
|
||||||
|
@ -643,6 +686,12 @@
|
||||||
undefined,
|
undefined,
|
||||||
modalEvents
|
modalEvents
|
||||||
);
|
);
|
||||||
|
$("#new-app-collections").select2({
|
||||||
|
tags: [],
|
||||||
|
showSearchBox: false,
|
||||||
|
minimumResultsForSearch: -1,
|
||||||
|
width: "336px"
|
||||||
|
});
|
||||||
var listTempl = this.appStoreTemplate;
|
var listTempl = this.appStoreTemplate;
|
||||||
$.get("foxxes/fishbowl", function(list) {
|
$.get("foxxes/fishbowl", function(list) {
|
||||||
var table = $("#appstore-content");
|
var table = $("#appstore-content");
|
||||||
|
|
Loading…
Reference in New Issue