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