Commit 00da056c authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: commits can be done throught webrunner git interface

parent 278d10ec
......@@ -137,8 +137,8 @@ def gitCommit(project, msg):
git.add(f)
#Commit all modified and untracked files
git.commit('-a', '-m', msg)
else:
code = 1
else:
json = "Nothing to be commited"
return jsonify(code=code, result=json)
......
......@@ -171,7 +171,7 @@ $(document).ready(function () {
});
$("#commitbutton").click(function () {
if ($("input#commitmsg").val() === "" ||
$("textarea#commitmsg").val() === "Enter message...") {
$("input#commitmsg").val() === "Enter message...") {
$("#error").Popup("Please Enter the commit message", {type: 'alert', duration: 3000});
return false;
}
......@@ -181,12 +181,12 @@ $(document).ready(function () {
send = true;
var project = $("#project").val();
$("#imgwaitting").fadeIn('normal');
//$("#commit").empty();
$("#commitbbutton").attr("value", "Wait...");
$("#commitmsg").empty();
$("#commitbutton").attr("value", "Wait...");
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/commitProjectFiles',
data: {project: $("input#workdir").val() + "/" + project, msg: $("textarea#commitmsg").val()},
data: {project: $("input#workdir").val() + "/" + project, msg: $("input#commitmsg").val()},
success: function (data) {
if (data.code === 1) {
if (data.result !== "") {
......
......@@ -111,12 +111,12 @@
<!--<img class="waitting" id="pullimgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />-->
</div>
</div>
<div id="push" style="margin-bottom:20px;">
<div id="commit" style="margin-bottom:20px;">
<h2>Commit All your changes (On active branch)</h2>
<div style="margin-left:15px;">
<label for='commitmsg'>Commit message: </label>
<input type="text" name="commitmsg" id="commitmsg" size='40' value="Enter message..." />
<input type="submit" name="commit" id ="commit" value="Commit" class="button"/>
<input type="submit" name="commit" id ="commitbutton" value="Commit" class="button"/>
<img class="waitting" id="imgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />
</div>
</div>
......
......@@ -403,6 +403,14 @@ def getProjectDiff():
result="Error: No such file or directory. PERMISSION DENIED!")
def commitProjectFiles():
path = realpath(app.config, request.form['project'])
if path:
return gitCommit(path, request.form['msg'])
else:
return jsonify(code=0, result="Can not read folder: Permission Denied")
def pushProjectFiles():
path = realpath(app.config, request.form['project'])
if path:
......@@ -787,6 +795,8 @@ app.add_url_rule("/slapgridResult", 'slapgridResult',
app.add_url_rule("/getmd5sum", 'getmd5sum', getmd5sum, methods=['POST'])
app.add_url_rule("/checkFileType", 'checkFileType', checkFileType,
methods=['POST'])
app.add_url_rule("/commitProjectFiles", 'commitProjectFiles', commitProjectFiles,
methods=['POST'])
app.add_url_rule("/pullProjectFiles", 'pullProjectFiles', pullProjectFiles,
methods=['POST'])
app.add_url_rule("/pushProjectFiles", 'pushProjectFiles', pushProjectFiles,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment