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
Lu Xu
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):
...
@@ -137,8 +137,8 @@ def gitCommit(project, msg):
git
.
add
(
f
)
git
.
add
(
f
)
#Commit all modified and untracked files
#Commit all modified and untracked files
git
.
commit
(
'-a'
,
'-m'
,
msg
)
git
.
commit
(
'-a'
,
'-m'
,
msg
)
else
:
code
=
1
code
=
1
else
:
json
=
"Nothing to be commited"
json
=
"Nothing to be commited"
return
jsonify
(
code
=
code
,
result
=
json
)
return
jsonify
(
code
=
code
,
result
=
json
)
...
...
slapos/runner/static/js/scripts/repo.js
View file @
00da056c
...
@@ -171,7 +171,7 @@ $(document).ready(function () {
...
@@ -171,7 +171,7 @@ $(document).ready(function () {
});
});
$
(
"
#commitbutton
"
).
click
(
function
()
{
$
(
"
#commitbutton
"
).
click
(
function
()
{
if
(
$
(
"
input#commitmsg
"
).
val
()
===
""
||
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
});
$
(
"
#error
"
).
Popup
(
"
Please Enter the commit message
"
,
{
type
:
'
alert
'
,
duration
:
3000
});
return
false
;
return
false
;
}
}
...
@@ -181,12 +181,12 @@ $(document).ready(function () {
...
@@ -181,12 +181,12 @@ $(document).ready(function () {
send
=
true
;
send
=
true
;
var
project
=
$
(
"
#project
"
).
val
();
var
project
=
$
(
"
#project
"
).
val
();
$
(
"
#imgwaitting
"
).
fadeIn
(
'
normal
'
);
$
(
"
#imgwaitting
"
).
fadeIn
(
'
normal
'
);
//$("#commit
").empty();
$
(
"
#commitmsg
"
).
empty
();
$
(
"
#commitb
b
utton
"
).
attr
(
"
value
"
,
"
Wait...
"
);
$
(
"
#commitbutton
"
).
attr
(
"
value
"
,
"
Wait...
"
);
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/commitProjectFiles
'
,
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
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
1
)
{
if
(
data
.
code
===
1
)
{
if
(
data
.
result
!==
""
)
{
if
(
data
.
result
!==
""
)
{
...
...
slapos/runner/templates/manageRepository.html
View file @
00da056c
...
@@ -111,12 +111,12 @@
...
@@ -111,12 +111,12 @@
<!--<img class="waitting" id="pullimgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />-->
<!--<img class="waitting" id="pullimgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />-->
</div>
</div>
</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>
<h2>
Commit All your changes (On active branch)
</h2>
<div
style=
"margin-left:15px;"
>
<div
style=
"margin-left:15px;"
>
<label
for=
'commitmsg'
>
Commit message:
</label>
<label
for=
'commitmsg'
>
Commit message:
</label>
<input
type=
"text"
name=
"commitmsg"
id=
"commitmsg"
size=
'40'
value=
"Enter message..."
/>
<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=
""
/>
<img
class=
"waitting"
id=
"imgwaitting"
src=
"{{ url_for('static', filename='images/waiting.gif') }}"
alt=
""
/>
</div>
</div>
</div>
</div>
...
...
slapos/runner/views.py
View file @
00da056c
...
@@ -403,6 +403,14 @@ def getProjectDiff():
...
@@ -403,6 +403,14 @@ def getProjectDiff():
result
=
"Error: No such file or directory. PERMISSION DENIED!"
)
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
():
def
pushProjectFiles
():
path
=
realpath
(
app
.
config
,
request
.
form
[
'project'
])
path
=
realpath
(
app
.
config
,
request
.
form
[
'project'
])
if
path
:
if
path
:
...
@@ -787,6 +795,8 @@ app.add_url_rule("/slapgridResult", 'slapgridResult',
...
@@ -787,6 +795,8 @@ app.add_url_rule("/slapgridResult", 'slapgridResult',
app
.
add_url_rule
(
"/getmd5sum"
,
'getmd5sum'
,
getmd5sum
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/getmd5sum"
,
'getmd5sum'
,
getmd5sum
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/checkFileType"
,
'checkFileType'
,
checkFileType
,
app
.
add_url_rule
(
"/checkFileType"
,
'checkFileType'
,
checkFileType
,
methods
=
[
'POST'
])
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/commitProjectFiles"
,
'commitProjectFiles'
,
commitProjectFiles
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/pullProjectFiles"
,
'pullProjectFiles'
,
pullProjectFiles
,
app
.
add_url_rule
(
"/pullProjectFiles"
,
'pullProjectFiles'
,
pullProjectFiles
,
methods
=
[
'POST'
])
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/pushProjectFiles"
,
'pushProjectFiles'
,
pushProjectFiles
,
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