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
Boxiang Sun
slapos.toolbox
Commits
7c98e0a2
Commit
7c98e0a2
authored
Sep 10, 2013
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slaprunner : code added cleaned
parent
72b353f0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
16 deletions
+20
-16
slapos/runner/gittools.py
slapos/runner/gittools.py
+1
-3
slapos/runner/static/js/scripts/repo.js
slapos/runner/static/js/scripts/repo.js
+17
-11
slapos/runner/templates/layout.html
slapos/runner/templates/layout.html
+1
-1
slapos/runner/templates/manageProject.html
slapos/runner/templates/manageProject.html
+1
-1
No files found.
slapos/runner/gittools.py
View file @
7c98e0a2
...
...
@@ -122,7 +122,7 @@ def gitCommit(project, msg):
Args:
project: directory of the local repository
msg: commit message"""
code
=
0
code
=
1
json
=
""
repo
=
Repo
(
project
)
if
repo
.
is_dirty
:
...
...
@@ -134,7 +134,6 @@ def gitCommit(project, msg):
#Commit all modified and untracked files
git
.
commit
(
'-a'
,
'-m'
,
msg
)
else
:
code
=
1
json
=
"Nothing to be commited"
return
jsonify
(
code
=
code
,
result
=
json
)
...
...
@@ -145,7 +144,6 @@ def gitPush(project):
msg: commit message"""
code
=
0
json
=
""
import
pdb
;
pdb
.
set_trace
()
repo
=
Repo
(
project
)
try
:
git
=
repo
.
git
...
...
slapos/runner/static/js/scripts/repo.js
View file @
7c98e0a2
...
...
@@ -2,6 +2,13 @@
/*global $, document, $SCRIPT_ROOT */
/* vim: set et sts=4: */
$
.
valHooks
.
textarea
=
{
get
:
function
(
elem
)
{
"
use strict
"
;
return
elem
.
value
.
replace
(
/
\r?\n
/g
,
"
\r\n
"
);
}
};
$
(
document
).
ready
(
function
()
{
"
use strict
"
;
...
...
@@ -24,7 +31,6 @@ $(document).ready(function () {
$
(
"
#status
"
).
empty
();
$
(
"
#commit
"
).
hide
();
$
(
"
#push
"
).
hide
();
$
(
"
#flash
"
).
empty
();
if
(
project
===
""
)
{
$
(
"
#status
"
).
append
(
"
<h2>Please select one project...</h2><br/><br/>
"
);
...
...
@@ -47,7 +53,6 @@ $(document).ready(function () {
$
(
"
#status
"
).
append
(
"
<p>
"
+
message
+
"
</p>
"
);
if
(
data
.
dirty
)
{
$
(
"
#commit
"
).
show
();
$
(
"
#push
"
).
show
();
$
(
"
#status
"
).
append
(
"
<br/><h2>Display Diff for current Project</h2>
"
);
$
(
"
#status
"
).
append
(
"
<p style='font-size:15px;'>You have changes in your project.
"
+
"
<a href='
"
+
$SCRIPT_ROOT
+
"
/getProjectDiff/
"
...
...
@@ -121,9 +126,9 @@ $(document).ready(function () {
checkout
(
"
0
"
);
return
false
;
});
$
(
"
#commit
"
).
click
(
function
()
{
$
(
"
#commit
b
"
).
click
(
function
()
{
if
(
$
(
"
input#commitmsg
"
).
val
()
===
""
||
$
(
"
input
#commitmsg
"
).
val
()
===
"
Enter message...
"
)
{
$
(
"
textarea
#commitmsg
"
).
val
()
===
"
Enter message...
"
)
{
$
(
"
#error
"
).
Popup
(
"
Please Enter the commit message
"
,
{
type
:
'
alert
'
,
duration
:
3000
});
return
false
;
}
...
...
@@ -134,11 +139,11 @@ $(document).ready(function () {
var
project
=
$
(
"
#project
"
).
val
();
$
(
"
#imgwaitting
"
).
fadeIn
(
'
normal
'
);
//$("#commit").empty();
$
(
"
#commit
"
).
attr
(
"
value
"
,
"
Wait...
"
);
$
(
"
#commit
b
"
).
attr
(
"
value
"
,
"
Wait...
"
);
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/commitProjectFiles
'
,
data
:
{
project
:
$
(
"
input#workdir
"
).
val
()
+
"
/
"
+
project
,
msg
:
$
(
"
input
#commitmsg
"
).
val
()},
data
:
{
project
:
$
(
"
input#workdir
"
).
val
()
+
"
/
"
+
project
,
msg
:
$
(
"
textarea
#commitmsg
"
).
val
()},
success
:
function
(
data
)
{
if
(
data
.
code
===
1
)
{
if
(
data
.
result
!==
""
)
{
...
...
@@ -146,19 +151,20 @@ $(document).ready(function () {
}
else
{
$
(
"
#error
"
).
Popup
(
"
Commit done!
"
,
{
type
:
'
confirm
'
,
duration
:
3000
});
}
$
(
"
#commit
"
).
hide
();
gitStatus
();
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
});
}
$
(
"
#imgwaitting
"
).
hide
();
$
(
"
#commit
"
).
empty
();
$
(
"
#commit
"
).
attr
(
"
value
"
,
"
Commit
"
);
$
(
"
#commit
msg
"
).
empty
();
$
(
"
#commit
b
"
).
attr
(
"
value
"
,
"
Commit
"
);
send
=
false
;
}
});
return
false
;
});
$
(
"
#push
"
).
click
(
function
()
{
$
(
"
#push
"
).
click
(
function
()
{
if
(
send
)
{
return
false
;
}
...
...
@@ -168,7 +174,7 @@ $(document).ready(function () {
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/pushProjectFiles
'
,
data
:
{
project
:
$
(
"
input#workdir
"
).
val
()
+
"
/
"
+
project
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
1
)
{
if
(
data
.
result
!==
""
)
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
...
...
@@ -182,7 +188,7 @@ $(document).ready(function () {
$
(
"
#push
"
).
hide
();
send
=
false
;
}
});
});
return
false
;
});
/*
...
...
slapos/runner/templates/layout.html
View file @
7c98e0a2
...
...
@@ -66,7 +66,7 @@
</div>
<div
class=
"wmenu"
>
<ul>
<li><a
href=
"{{ url_for('editSoftwareProfile') }}"
>
Profiles
4
</a></li>
<li><a
href=
"{{ url_for('editSoftwareProfile') }}"
>
Profiles
</a></li>
<li><a
href=
"{{ url_for('browseWorkspace') }}"
>
Workspace
</a></li>
<li
class=
'sep'
></li>
<li><a
href=
"{{ url_for('runSoftwareProfile') }}"
id=
"softrun"
>
Run software
</a></li>
...
...
slapos/runner/templates/manageProject.html
View file @
7c98e0a2
...
...
@@ -46,7 +46,7 @@
<label
for=
'commitmsg'
>
Commit message:
</label>
<textarea
name=
"commitmsg"
id=
"commitmsg"
cols=
"40"
rows=
"3"
>
</textarea>
<input
type=
"submit"
name=
"commit"
id =
"commit"
value=
"Commit"
class=
"button"
/>
<input
type=
"submit"
name=
"commit"
id =
"commit
b
"
value=
"Commit"
class=
"button"
/>
<img
class=
"waitting"
id=
"imgwaitting"
src=
"{{ url_for('static', filename='images/waiting.gif') }}"
alt=
""
/>
</div>
</div>
...
...
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