Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tristan Cavelier
slapos.toolbox
Commits
00da056c
Commit
00da056c
authored
Aug 18, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: commits can be done throught webrunner git interface
parent
278d10ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
slapos/runner/gittools.py
slapos/runner/gittools.py
+1
-1
slapos/runner/static/js/scripts/repo.js
slapos/runner/static/js/scripts/repo.js
+4
-4
slapos/runner/templates/manageRepository.html
slapos/runner/templates/manageRepository.html
+2
-2
slapos/runner/views.py
slapos/runner/views.py
+10
-0
No files found.
slapos/runner/gittools.py
View file @
00da056c
...
...
@@ -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
)
...
...
slapos/runner/static/js/scripts/repo.js
View file @
00da056c
...
...
@@ -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();
$
(
"
#commitb
b
utton
"
).
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
!==
""
)
{
...
...
slapos/runner/templates/manageRepository.html
View file @
00da056c
...
...
@@ -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 =
"commit
button
"
value=
"Commit"
class=
"button"
/>
<img
class=
"waitting"
id=
"imgwaitting"
src=
"{{ url_for('static', filename='images/waiting.gif') }}"
alt=
""
/>
</div>
</div>
...
...
slapos/runner/views.py
View file @
00da056c
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment