Skip to content

Commit

Permalink
Send commit info to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
yazz committed Nov 17, 2023
1 parent a400f40 commit 460514d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ load_once_from_file(true)
return {
commit_pane_header: "",
commit_pane_description: "",
commitMessage: "",
commitErrorMessage: "",
releaseMessage: "",
releaseErrorMessage: "",

Expand Down Expand Up @@ -291,11 +293,14 @@ load_once_from_file(true)
<!-- ----------------------------------------------
Commit button
---------------------------------------------- -->
<div style='margin-top: 20px;padding-bottom: 40vh;'>
<div style='margin-top: 20px;;'>
<button type=button
class=' btn btn-info btn-lg'
v-on:click='choosePane_commitPressed()' >Commit</button>
</div>
<div style="margin-top: 20px;">{{commitMessage}}</div>
<div style="color:red">{{commitErrorMessage}}</div>
</div>
Expand Down Expand Up @@ -351,8 +356,23 @@ load_once_from_file(true)
choosePane_commitPressed: async function ( ) {
debugger
let mm = this
let header = mm.commit_pane_header
let desc = mm.commit_pane_description
showProgressBar()

let postAppUrl = "http" + (($HOSTPORT == 443)?"s":"") + "://" + $HOST + "/http_post_commit_code"
callAjaxPost(postAppUrl,
{
code_id: mm.codeId,
user_id: "xyz",
header: mm.commit_pane_header,
description: mm.commit_pane_description
}
,
async function(response){
let responseJson = JSON.parse(response)

mm.commitMessage = "Commit successful"
hideProgressBar()
})
},
releaseCodePressed: async function ( ) {
//----------------------------------------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -4470,6 +4470,21 @@ async function startServices ( ) {
));

});
app.post( "/http_post_commit_code" , async function (req, res) {
//
// get stuff
//
let ipfsHash = req.body.value.code_id;
let userId = req.body.value.user_id;
let header = req.body.value.header;
let description = req.body.value.description;


res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
res.end(JSON.stringify({
ipfsHash: ipfsHash,
}))
})
app.post( "/http_post_release_commit" , async function (req, res) {
//
// get stuff
Expand Down

0 comments on commit 460514d

Please sign in to comment.