Skip to content

Commit

Permalink
added ability to run Git Commands
Browse files Browse the repository at this point in the history
  • Loading branch information
DinisCruz committed Apr 10, 2012
1 parent 678646f commit ab79001
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,47 @@

executePull : function()
{
$("#result").html("...starting GitHub Pull");
var that = this;
$("#result").html("...starting GitHub Pull");
var params = {};
TM.WebServices.Helper.invoke_TM_WebService('GitHub_Pull_Origin',params, TM.ControlPanel.GitHubSync.showResult);
}
, executePush : function()
{
$("#result").html("...starting GitHub Push");
var that = this;
$("#result").html("...starting GitHub Push");
var params = {};
TM.WebServices.Helper.invoke_TM_WebService('GitHub_Push_Origin',params, TM.ControlPanel.GitHubSync.showResult);
}
}
, executeGitCommand : function()
{
var gitCommand = $("#gitCommand").val();
$("#result").html("...executing Git Command: " + gitCommand);
var params = { gitCommand : gitCommand };
TM.WebServices.Helper.invoke_TM_WebService('Git_Execute',params, TM.ControlPanel.GitHubSync.showResult);
}

, showResult : function(result)
{
result = result.replace(/\r\n/g, "<br/>");
$("#result").html(JSON.stringify(result));
}
, applyCss : function()
{
$("input:[type=text]").addClass("ui-widget-content ui-corner-all")
.absolute()
.left(100)
.width(200);
{
$("#pull").button().css('font-size',12)
.click(this.executePull);
$("#push").button().css('font-size',12)
.click(this.executePush);
$("#gitForm").height(100)

$("#gitCommand").addClass("ui-widget-content ui-corner-all")
.relative()
//.left(10)
.width(200);
$("#execute").button().css('font-size',12)
.click(this.executeGitCommand);

$("#gitCommand").val('status');

this.executeGitCommand();
//$("#gitForm").height(100)
}
}
$(function()
Expand All @@ -57,6 +70,11 @@ <h2>GitHub Sync...</h2>
<br />
<br />
<input type="button" id="push" value="Push"/> - Push local changes to GitHub
<br />
<br />
<input type="text" id="gitCommand">
<input type="button" id="execute" value="Execute Git Command"/>
<p>Common commands: remote -v, status, git add . , git add -A , git commit -m '{commit message}'</p>
</form>
</div>
<div>
Expand Down
Binary file modified Web Applications/TM_Website/bin/TeamMentor.CoreLib.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ public partial class TM_WebServices
[WebMethod(EnableSession = true)] public string RBAC_SessionCookie() { return HttpContext.Current.Request.Cookies["Session"].notNull()
? HttpContext.Current.Request.Cookies["Session"].Value : ""; }

[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string GitHub_Pull_Origin() { return UtilMethods.syncWithGitHub_Pull_Origin(); }
[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string GitHub_Push_Origin() { return UtilMethods.syncWithGitHub_Push_Origin(); }
[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string GitHub_Push_Commit() { return UtilMethods.syncWithGitHub_Commit(); }
[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string GitHub_Pull_Origin() { return UtilMethods.syncWithGitHub_Pull_Origin(); }
[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string GitHub_Push_Origin() { return UtilMethods.syncWithGitHub_Push_Origin(); }
[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string GitHub_Push_Commit() { return UtilMethods.syncWithGitHub_Commit(); }
[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string Git_Execute(string gitCommand) { return UtilMethods.executeGitCommand(gitCommand); }

[WebMethod(EnableSession = true)] [Admin(SecurityAction.Demand)] public string CreateWebEditorSecret()
{
Expand Down

0 comments on commit ab79001

Please sign in to comment.