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
Klaus Wölfel
slapos.toolbox
Commits
3928ec49
Commit
3928ec49
authored
Feb 03, 2012
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Webrunner: Add floating Popup for displaying error and info messages
parent
bbe5ee4f
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
164 additions
and
109 deletions
+164
-109
slapos/runner/static/css/styles.css
slapos/runner/static/css/styles.css
+54
-1
slapos/runner/static/images/alert.png
slapos/runner/static/images/alert.png
+0
-0
slapos/runner/static/images/close.png
slapos/runner/static/images/close.png
+0
-0
slapos/runner/static/images/close_hover.png
slapos/runner/static/images/close_hover.png
+0
-0
slapos/runner/static/images/confirm.png
slapos/runner/static/images/confirm.png
+0
-0
slapos/runner/static/images/exit.png
slapos/runner/static/images/exit.png
+0
-0
slapos/runner/static/images/info.png
slapos/runner/static/images/info.png
+0
-0
slapos/runner/static/js/jquery/popup.js
slapos/runner/static/js/jquery/popup.js
+49
-0
slapos/runner/static/js/scripts/editor.js
slapos/runner/static/js/scripts/editor.js
+4
-10
slapos/runner/static/js/scripts/folder.js
slapos/runner/static/js/scripts/folder.js
+8
-13
slapos/runner/static/js/scripts/inspectInstance.js
slapos/runner/static/js/scripts/inspectInstance.js
+12
-20
slapos/runner/static/js/scripts/inspectSoftware.js
slapos/runner/static/js/scripts/inspectSoftware.js
+6
-15
slapos/runner/static/js/scripts/project.js
slapos/runner/static/js/scripts/project.js
+6
-8
slapos/runner/static/js/scripts/repo.js
slapos/runner/static/js/scripts/repo.js
+8
-15
slapos/runner/static/js/scripts/softwareFolder.js
slapos/runner/static/js/scripts/softwareFolder.js
+6
-11
slapos/runner/templates/layout.html
slapos/runner/templates/layout.html
+11
-16
No files found.
slapos/runner/static/css/styles.css
View file @
3928ec49
...
@@ -583,4 +583,57 @@ a.lshare:focus{
...
@@ -583,4 +583,57 @@ a.lshare:focus{
a
.lshare
img
{
a
.lshare
img
{
margin
:
5px
;
margin
:
5px
;
}
}
\ No newline at end of file
#error
{
padding
:
0px
;
position
:
absolute
;
top
:
-2px
;
left
:
0
;
right
:
0
;
}
#error
>
div
{
background
:
none
repeat
scroll
0
0
#afcee4
;
border
:
1px
solid
#FFF
;
width
:
500px
;
margin
:
0
auto
;
border-top
:
none
;
border-radius
:
0
0
4px
4px
;
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.2
);
text-align
:
center
;
}
#error
table
{
background
:
none
;
width
:
100%
;
font-weight
:
normal
;
}
#error
table
,
#error
th
,
#error
tr
,
#error
td
{
border
:
none
;
padding
:
0
;
}
#error
td
{
margin
:
2px
;
}
#error
td
.logo
{
width
:
36px
;
height
:
26px
;
}
#error
td
.close
{
width
:
30px
;
height
:
22px
;
}
.alert_message
{
background
:
url(../images/alert.png)
center
no-repeat
;
height
:
26px
;}
.error_message
{
background
:
url(../images/exit.png)
center
no-repeat
;
height
:
26px
;}
.confirm_message
{
background
:
url(../images/confirm.png)
center
no-repeat
;
height
:
26px
;}
.info_message
{
background
:
url(../images/info.png)
center
no-repeat
;
height
:
26px
;}
#error
p
{
fon-size
:
13px
;
color
:
#000
;
}
#pClose
{
background
:
url(../images/close.png)
no-repeat
0px
0px
;
display
:
block
;
width
:
22px
;
height
:
22px
;
cursor
:
pointer
}
#pClose
:hover
{
background
:
url(../images/close_hover.png)
no-repeat
0px
0px
;}
slapos/runner/static/images/alert.png
0 → 100644
View file @
3928ec49
7.07 KB
slapos/runner/static/images/close.png
0 → 100644
View file @
3928ec49
1.31 KB
slapos/runner/static/images/close_hover.png
0 → 100644
View file @
3928ec49
1.28 KB
slapos/runner/static/images/confirm.png
0 → 100644
View file @
3928ec49
7.58 KB
slapos/runner/static/images/exit.png
0 → 100644
View file @
3928ec49
7.53 KB
slapos/runner/static/images/info.png
0 → 100644
View file @
3928ec49
7.51 KB
slapos/runner/static/js/jquery/popup.js
0 → 100644
View file @
3928ec49
// jQuery Message Popup
// Display a message on the top of page, with floating
//
(
function
(
$
,
document
,
window
)
{
$
.
extend
(
$
.
fn
,
{
Popup
:
function
(
msg
,
option
)
{
if
(
option
.
type
==
undefined
)
option
.
type
=
"
info
"
;
if
(
option
.
closebtn
==
undefined
)
option
.
closebtn
=
false
;
if
(
option
.
duration
==
undefined
)
option
.
duration
=
0
;
if
(
option
.
load
==
undefined
)
option
.
load
=
false
;
$box
=
$
(
this
);
$box
.
empty
();
$box
.
css
(
'
top
'
,
'
-1000px
'
);
$box
.
show
();
$box
.
append
(
'
<div><table id="bcontent"><tr>
'
+
'
<td valign="middle" class="logo
'
+
option
.
type
+
'
_message"></td>
'
+
'
<td valign="middle"><p>
'
+
msg
+
'
</p></td>
'
+
'
<td valign="middle" class="close"><span id="pClose"></span></td></tr></table></div>
'
);
$
(
window
).
scroll
(
function
(){
$box
.
animate
({
top
:
$
(
window
).
scrollTop
()
+
"
px
"
},{
queue
:
false
,
duration
:
350
});
});
var
h
=
$
(
"
#bcontent
"
).
height
()
+
5
;
$
(
"
#pClose
"
).
bind
(
"
click
"
,
function
()
{
close
();
});
if
(
option
.
load
){
$
(
window
).
load
(
function
(){
$box
.
css
(
'
top
'
,
+
(
$
(
window
).
scrollTop
()
-
h
)
+
'
px
'
);
$box
.
animate
({
top
:
"
+=
"
+
h
+
"
px
"
},
"
slow
"
);
});
}
else
{
$box
.
css
(
'
top
'
,
+
(
$
(
window
).
scrollTop
()
-
h
)
+
'
px
'
);
$box
.
animate
({
top
:
"
+=
"
+
h
+
"
px
"
},
"
slow
"
);
}
if
(
option
.
duration
!=
0
){
setTimeout
(
function
(){
close
();
},
option
.
duration
);
}
function
close
(){
$box
.
animate
({
top
:
"
-=
"
+
h
+
"
px
"
},
"
slow
"
,
function
(){
$box
.
fadeOut
(
"
normal
"
);
});
}
}
});
}(
jQuery
,
document
,
this
));
\ No newline at end of file
slapos/runner/static/js/scripts/editor.js
View file @
3928ec49
...
@@ -14,7 +14,7 @@ $(document).ready( function() {
...
@@ -14,7 +14,7 @@ $(document).ready( function() {
$
(
"
#save
"
).
click
(
function
(){
$
(
"
#save
"
).
click
(
function
(){
if
(
!
edit
){
if
(
!
edit
){
error
(
"
Error: Can not load your file, please make sure that you have selected a Software Release
"
);
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
return
false
;
return
false
;
}
}
send
=
false
;
send
=
false
;
...
@@ -24,10 +24,10 @@ $(document).ready( function() {
...
@@ -24,10 +24,10 @@ $(document).ready( function() {
data
:
{
file
:
file
,
content
:
editor
.
getSession
().
getValue
()},
data
:
{
file
:
file
,
content
:
editor
.
getSession
().
getValue
()},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
error
(
"
File Saved!
"
);
$
(
"
#error
"
).
Popup
(
"
File Saved!
"
,
{
type
:
'
confirm
'
,
duration
:
2000
}
);
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
send
=
false
;
send
=
false
;
}
}
...
@@ -35,12 +35,6 @@ $(document).ready( function() {
...
@@ -35,12 +35,6 @@ $(document).ready( function() {
return
false
;
return
false
;
});
});
function
error
(
msg
){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
$
(
"
#flash
"
).
append
(
"
<ul class='flashes'><li>
"
+
msg
+
"
</li></ul>
"
);
}
function
selectFile
(
file
){
function
selectFile
(
file
){
edit
=
false
;
edit
=
false
;
$
.
ajax
({
$
.
ajax
({
...
@@ -53,7 +47,7 @@ $(document).ready( function() {
...
@@ -53,7 +47,7 @@ $(document).ready( function() {
edit
=
true
;
edit
=
true
;
}
}
else
{
else
{
error
(
"
Error: Can not load your file, please make sure that you have selected a Software Release
"
);
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
});
});
...
...
slapos/runner/static/js/scripts/folder.js
View file @
3928ec49
...
@@ -12,30 +12,25 @@ $(document).ready( function() {
...
@@ -12,30 +12,25 @@ $(document).ready( function() {
$
(
"
#clone
"
).
append
(
"
Clone
"
);
$
(
"
#clone
"
).
append
(
"
Clone
"
);
send
=
false
;
send
=
false
;
return
;
return
;
}
}
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
var
repo_url
=
$
(
"
input#repo
"
).
val
();
var
repo_url
=
$
(
"
input#repo
"
).
val
();
var
email
=
""
;
var
email
=
""
;
var
name
=
""
var
name
=
""
/* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */
/* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */
if
(
$
(
"
input#repo
"
).
val
()
==
""
||
!
repo_url
.
match
(
/^
[\w\d\.\/
:~@_-
]
+$/
)){
if
(
$
(
"
input#repo
"
).
val
()
==
""
||
!
repo_url
.
match
(
/^
[\w\d\.\/
:~@_-
]
+$/
)){
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error: Invalid url for the repository</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Invalid url for the repository
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
if
(
$
(
"
input#name
"
).
val
()
==
""
||
!
$
(
"
input#name
"
).
val
().
match
(
/^
[\w\d\.
_-
]
+$/
)){
if
(
$
(
"
input#name
"
).
val
()
==
""
||
!
$
(
"
input#name
"
).
val
().
match
(
/^
[\w\d\.
_-
]
+$/
)){
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error: Invalid project name</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Invalid project name
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
if
(
$
(
"
input#user
"
).
val
()
!=
""
&&
$
(
"
input#user
"
).
val
()
!=
"
Enter your name...
"
){
if
(
$
(
"
input#user
"
).
val
()
!=
""
&&
$
(
"
input#user
"
).
val
()
!=
"
Enter your name...
"
){
//$("#flash").append("<ul class='flashes'><li>Error: Please enter your name!</li></ul>");
//return false;
name
=
$
(
"
input#user
"
).
val
();
name
=
$
(
"
input#user
"
).
val
();
}
}
if
(
$
(
"
input#email
"
).
val
()
!=
""
&&
$
(
"
input#email
"
).
val
()
!=
"
Enter your email adress...
"
){
if
(
$
(
"
input#email
"
).
val
()
!=
""
&&
$
(
"
input#email
"
).
val
()
!=
"
Enter your email adress...
"
){
if
(
!
$
(
"
input#email
"
).
val
().
match
(
/^
([
a-zA-Z0-9_
\.\-])
+
\@(([
a-zA-Z0-9
\-])
+
\.)
+
([
a-zA-Z0-9
]{2,4})
+$/
)){
if
(
!
$
(
"
input#email
"
).
val
().
match
(
/^
([
a-zA-Z0-9_
\.\-])
+
\@(([
a-zA-Z0-9
\-])
+
\.)
+
([
a-zA-Z0-9
]{2,4})
+$/
)){
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error: Please enter a valid email adress!</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Please enter a valid email adress!
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
email
=
$
(
"
input#email
"
).
val
();
email
=
$
(
"
input#email
"
).
val
();
...
@@ -52,7 +47,7 @@ $(document).ready( function() {
...
@@ -52,7 +47,7 @@ $(document).ready( function() {
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#file_navigation
"
).
fadeIn
(
'
normal
'
);
$
(
"
#file_navigation
"
).
fadeIn
(
'
normal
'
);
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Repository is cloned!</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Your repository is cloned!
"
,
{
type
:
'
confirm
'
,
duration
:
3000
}
);
$
(
"
input#repo
"
).
val
(
"
Enter the url of your repository...
"
);
$
(
"
input#repo
"
).
val
(
"
Enter the url of your repository...
"
);
$
(
"
input#name
"
).
val
(
"
Enter the project name...
"
);
$
(
"
input#name
"
).
val
(
"
Enter the project name...
"
);
$
(
'
#fileTree
'
).
fileTree
({
root
:
$
(
"
input#workdir
"
).
val
(),
script
:
$SCRIPT_ROOT
+
'
/readFolder
'
,
folderEvent
:
'
click
'
,
expandSpeed
:
750
,
collapseSpeed
:
750
,
multiFolder
:
false
},
function
(
file
)
{
$
(
'
#fileTree
'
).
fileTree
({
root
:
$
(
"
input#workdir
"
).
val
(),
script
:
$SCRIPT_ROOT
+
'
/readFolder
'
,
folderEvent
:
'
click
'
,
expandSpeed
:
750
,
collapseSpeed
:
750
,
multiFolder
:
false
},
function
(
file
)
{
...
@@ -60,9 +55,9 @@ $(document).ready( function() {
...
@@ -60,9 +55,9 @@ $(document).ready( function() {
});
});
}
}
else
{
else
{
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error:
"
+
data
.
result
+
"
</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
}
);
}
}
$
(
"
#imgwaitting
"
).
hide
()
$
(
"
#imgwaitting
"
).
hide
()
;
$
(
"
#clone
"
).
empty
();
$
(
"
#clone
"
).
empty
();
$
(
"
#clone
"
).
append
(
"
Clone
"
);
$
(
"
#clone
"
).
append
(
"
Clone
"
);
send
=
false
;
send
=
false
;
...
...
slapos/runner/static/js/scripts/inspectInstance.js
View file @
3928ec49
...
@@ -35,30 +35,29 @@ $(document).ready( function() {
...
@@ -35,30 +35,29 @@ $(document).ready( function() {
data
:
{
file
:
file
,
truncate
:
1500
},
data
:
{
file
:
file
,
truncate
:
1500
},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#flash
"
).
empty
();
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Software Content:
'
+
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Software Content:
'
+
filename
+
'
</h2>
'
);
filename
+
'
</h2>
'
);
$
(
"
#inline_content
"
).
append
(
'
<br/><div class="main_content"><pre id="editor"></pre></div>
'
);
$
(
"
#inline_content
"
).
append
(
'
<br/><div class="main_content"><pre id="editor"></pre></div>
'
);
setupEditor
();
setupEditor
();
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
847px
"
,
onComplete
:
function
(){
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
847px
"
,
onComplete
:
function
(){
editor
.
getSession
().
setValue
(
data
.
result
);
editor
.
getSession
().
setValue
(
data
.
result
);
}});
}});
$
(
"
.inline
"
).
click
();
$
(
"
.inline
"
).
click
();
}
}
else
{
else
{
error
(
"
Error: Can not load your file, please make sure that you have selected a Software Release
"
);
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
});
});
}
}
else
{
else
{
//Can not displays binary file
//Can not displays binary file
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
});
});
...
@@ -75,11 +74,4 @@ $(document).ready( function() {
...
@@ -75,11 +74,4 @@ $(document).ready( function() {
editor
.
renderer
.
setHScrollBarAlwaysVisible
(
false
);
editor
.
renderer
.
setHScrollBarAlwaysVisible
(
false
);
editor
.
setReadOnly
(
true
);
editor
.
setReadOnly
(
true
);
}
}
function
error
(
msg
){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
$
(
"
#flash
"
).
append
(
"
<ul class='flashes'><li>
"
+
msg
+
"
</li></ul>
"
);
}
});
});
\ No newline at end of file
slapos/runner/static/js/scripts/inspectSoftware.js
View file @
3928ec49
...
@@ -39,7 +39,7 @@ $(document).ready( function() {
...
@@ -39,7 +39,7 @@ $(document).ready( function() {
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
}
);
}
}
}
}
});
});
...
@@ -62,8 +62,6 @@ $(document).ready( function() {
...
@@ -62,8 +62,6 @@ $(document).ready( function() {
setupFileTree
(
runnerDir
);
setupFileTree
(
runnerDir
);
},
function
(
file
){
viewFile
(
file
)});
},
function
(
file
){
viewFile
(
file
)});
$
(
"
input#file
"
).
val
(
""
);
$
(
"
input#file
"
).
val
(
""
);
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#info
"
).
empty
();
$
(
"
#info
"
).
empty
();
$
(
"
#info
"
).
append
(
"
Please select your file or folder into the box...
"
);
$
(
"
#info
"
).
append
(
"
Please select your file or folder into the box...
"
);
$
(
"
#softwarelist
"
).
empty
();
$
(
"
#softwarelist
"
).
empty
();
...
@@ -72,9 +70,10 @@ $(document).ready( function() {
...
@@ -72,9 +70,10 @@ $(document).ready( function() {
'
" title="
'
+
data
.
result
[
i
][
"
title
"
]
+
'
" rel="
'
+
'
" title="
'
+
data
.
result
[
i
][
"
title
"
]
+
'
" rel="
'
+
data
.
result
[
i
][
"
path
"
]
+
'
">
'
+
data
.
result
[
i
][
"
title
"
]
+
'
</option>
'
);
data
.
result
[
i
][
"
path
"
]
+
'
">
'
+
data
.
result
[
i
][
"
title
"
]
+
'
</option>
'
);
}
}
$
(
"
#error
"
).
Popup
(
"
Operation complete, Selected Software Release has been delete!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
}
);
}
}
send
=
false
;
send
=
false
;
}
}
...
@@ -102,7 +101,6 @@ $(document).ready( function() {
...
@@ -102,7 +101,6 @@ $(document).ready( function() {
data
:
{
file
:
file
,
truncate
:
1500
},
data
:
{
file
:
file
,
truncate
:
1500
},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#flash
"
).
empty
();
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Software Content:
'
+
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Software Content:
'
+
filename
+
'
</h2>
'
);
filename
+
'
</h2>
'
);
...
@@ -114,18 +112,18 @@ $(document).ready( function() {
...
@@ -114,18 +112,18 @@ $(document).ready( function() {
$
(
"
.inline
"
).
click
();
$
(
"
.inline
"
).
click
();
}
}
else
{
else
{
error
(
"
Error: Can not load your file, please make sure that you have selected a Software Release
"
);
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
});
});
}
}
else
{
else
{
//Can not displays binary file
//Can not displays binary file
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
}
);
}
}
}
}
});
});
...
@@ -142,11 +140,4 @@ $(document).ready( function() {
...
@@ -142,11 +140,4 @@ $(document).ready( function() {
editor
.
renderer
.
setHScrollBarAlwaysVisible
(
false
);
editor
.
renderer
.
setHScrollBarAlwaysVisible
(
false
);
editor
.
setReadOnly
(
true
);
editor
.
setReadOnly
(
true
);
}
}
function
error
(
msg
){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
$
(
"
#flash
"
).
append
(
"
<ul class='flashes'><li>
"
+
msg
+
"
</li></ul>
"
);
}
});
});
\ No newline at end of file
slapos/runner/static/js/scripts/project.js
View file @
3928ec49
...
@@ -9,16 +9,13 @@ $(document).ready( function() {
...
@@ -9,16 +9,13 @@ $(document).ready( function() {
}
}
$
(
"
input#subfolder
"
).
val
(
""
);
$
(
"
input#subfolder
"
).
val
(
""
);
$
(
"
#create
"
).
click
(
function
(){
$
(
"
#create
"
).
click
(
function
(){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
repo_url
=
$
(
"
input#software
"
).
val
();
repo_url
=
$
(
"
input#software
"
).
val
();
if
(
$
(
"
input#software
"
).
val
()
==
""
||
!
$
(
"
input#software
"
).
val
().
match
(
/^
[\w\d
._-
]
+$/
)){
if
(
$
(
"
input#software
"
).
val
()
==
""
||
!
$
(
"
input#software
"
).
val
().
match
(
/^
[\w\d
._-
]
+$/
)){
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error: Invalid Software name</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Invalid Software name
"
,
{
type
:
'
alert
'
,
duration
:
3000
})
return
false
;
return
false
;
}
}
if
(
$
(
"
input#subfolder
"
).
val
()
==
""
){
if
(
$
(
"
input#subfolder
"
).
val
()
==
""
){
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error: Select the parent folder of your software!</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Select the parent folder of your software!
"
,
{
type
:
'
alert
'
,
duration
:
3000
})
return
false
;
return
false
;
}
}
$
.
ajax
({
$
.
ajax
({
...
@@ -30,7 +27,8 @@ $(document).ready( function() {
...
@@ -30,7 +27,8 @@ $(document).ready( function() {
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
}
}
else
{
else
{
$
(
"
#flash
"
).
append
(
"
<ul class='flashes'><li>Error:
"
+
data
.
result
+
"
</li></ul>
"
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
})
}
}
}
}
});
});
...
@@ -42,7 +40,7 @@ $(document).ready( function() {
...
@@ -42,7 +40,7 @@ $(document).ready( function() {
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
if
(
$
(
"
input#path
"
).
val
()
==
""
){
if
(
$
(
"
input#path
"
).
val
()
==
""
){
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error: Select a valid Software Release folder</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
"
Select a valid Software Release folder!
"
,
{
type
:
'
alert
'
,
duration
:
3000
})
return
false
;
return
false
;
}
}
$
.
ajax
({
$
.
ajax
({
...
@@ -54,7 +52,7 @@ $(document).ready( function() {
...
@@ -54,7 +52,7 @@ $(document).ready( function() {
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
}
}
else
{
else
{
$
(
"
#
flash
"
).
append
(
"
<ul class='flashes'><li>Error:
"
+
data
.
result
+
"
</li></ul>
"
);
$
(
"
#
error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
})
}
}
}
}
});
});
...
...
slapos/runner/static/js/scripts/repo.js
View file @
3928ec49
...
@@ -21,7 +21,7 @@ $(document).ready( function() {
...
@@ -21,7 +21,7 @@ $(document).ready( function() {
gitStatus
();
gitStatus
();
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
}
}
});
});
...
@@ -29,7 +29,7 @@ $(document).ready( function() {
...
@@ -29,7 +29,7 @@ $(document).ready( function() {
$
(
"
#addbranch
"
).
click
(
function
(){
$
(
"
#addbranch
"
).
click
(
function
(){
if
(
$
(
"
input#branchname
"
).
val
()
==
""
||
if
(
$
(
"
input#branchname
"
).
val
()
==
""
||
$
(
"
input#branchname
"
).
val
()
==
"
Enter the branch name...
"
){
$
(
"
input#branchname
"
).
val
()
==
"
Enter the branch name...
"
){
error
(
"
Error: Please Enter your branch name
"
);
$
(
"
#error
"
).
Popup
(
"
Please Enter your branch name
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
var
project
=
$
(
"
#project
"
).
val
();
var
project
=
$
(
"
#project
"
).
val
();
...
@@ -44,7 +44,7 @@ $(document).ready( function() {
...
@@ -44,7 +44,7 @@ $(document).ready( function() {
gitStatus
();
gitStatus
();
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
}
);
}
}
}
}
});
});
...
@@ -53,7 +53,7 @@ $(document).ready( function() {
...
@@ -53,7 +53,7 @@ $(document).ready( function() {
$
(
"
#commit
"
).
click
(
function
(){
$
(
"
#commit
"
).
click
(
function
(){
if
(
$
(
"
input#commitmsg
"
).
val
()
==
""
||
if
(
$
(
"
input#commitmsg
"
).
val
()
==
""
||
$
(
"
input#commitmsg
"
).
val
()
==
"
Enter message...
"
){
$
(
"
input#commitmsg
"
).
val
()
==
"
Enter message...
"
){
error
(
"
Error: Please Enter the commit message
"
);
$
(
"
#error
"
).
Popup
(
"
Please Enter the commit message
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
if
(
send
){
if
(
send
){
...
@@ -71,14 +71,14 @@ $(document).ready( function() {
...
@@ -71,14 +71,14 @@ $(document).ready( function() {
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
if
(
data
.
result
!=
""
){
if
(
data
.
result
!=
""
){
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
else
else
error
(
"
Commit done!
"
);
$
(
"
#error
"
).
Popup
(
"
Commit done!
"
,
{
type
:
'
confirm
'
,
duration
:
3000
}
);
gitStatus
();
gitStatus
();
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
$
(
"
#imgwaitting
"
).
hide
()
$
(
"
#imgwaitting
"
).
hide
()
$
(
"
#commit
"
).
empty
();
$
(
"
#commit
"
).
empty
();
...
@@ -155,7 +155,7 @@ $(document).ready( function() {
...
@@ -155,7 +155,7 @@ $(document).ready( function() {
loadBranch
(
data
.
branch
);
loadBranch
(
data
.
branch
);
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
send
=
false
;
send
=
false
;
}
}
...
@@ -169,11 +169,4 @@ $(document).ready( function() {
...
@@ -169,11 +169,4 @@ $(document).ready( function() {
"
'
"
+
selected
+
"
>
"
+
branch
[
i
]
+
"
</option>
"
);
"
'
"
+
selected
+
"
>
"
+
branch
[
i
]
+
"
</option>
"
);
}
}
}
}
function
error
(
msg
){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
$
(
"
#flash
"
).
append
(
"
<ul class='flashes'><li>
"
+
msg
+
"
</li></ul>
"
);
}
});
});
\ No newline at end of file
slapos/runner/static/js/scripts/softwareFolder.js
View file @
3928ec49
...
@@ -38,7 +38,7 @@ $(document).ready( function() {
...
@@ -38,7 +38,7 @@ $(document).ready( function() {
if
(
send
)
return
false
;
if
(
send
)
return
false
;
if
(
$
(
"
input#file
"
).
val
()
==
""
||
if
(
$
(
"
input#file
"
).
val
()
==
""
||
$
(
"
input#file
"
).
val
()
==
"
Enter name here...
"
){
$
(
"
input#file
"
).
val
()
==
"
Enter name here...
"
){
error
(
"
Error: Please enter your file or folder name
"
);
$
(
"
#error
"
).
Popup
(
"
Please enter your file or folder name
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
if
(
$
(
"
input#subfolder
"
).
val
()
!=
""
){
if
(
$
(
"
input#subfolder
"
).
val
()
!=
""
){
...
@@ -61,7 +61,7 @@ $(document).ready( function() {
...
@@ -61,7 +61,7 @@ $(document).ready( function() {
$
(
"
input#subfolder
"
).
val
(
""
);
$
(
"
input#subfolder
"
).
val
(
""
);
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
send
=
false
;
send
=
false
;
}
}
...
@@ -71,7 +71,7 @@ $(document).ready( function() {
...
@@ -71,7 +71,7 @@ $(document).ready( function() {
$
(
"
#save
"
).
click
(
function
(){
$
(
"
#save
"
).
click
(
function
(){
if
(
!
edit
){
if
(
!
edit
){
error
(
"
Please select the file to edit
"
);
$
(
"
#error
"
).
Popup
(
"
Please select the file to edit
"
,
{
type
:
'
alert
'
,
duration
:
3000
}
);
return
false
;
return
false
;
}
}
send
=
false
;
send
=
false
;
...
@@ -83,9 +83,10 @@ $(document).ready( function() {
...
@@ -83,9 +83,10 @@ $(document).ready( function() {
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
empty
();
$
(
"
#error
"
).
Popup
(
"
File saved succefuly!
"
,
{
type
:
'
confirm
'
,
duration
:
3000
});
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
send
=
false
;
send
=
false
;
}
}
...
@@ -143,12 +144,6 @@ $(document).ready( function() {
...
@@ -143,12 +144,6 @@ $(document).ready( function() {
}
}
}
}
function
error
(
msg
){
$
(
"
#flash
"
).
fadeOut
(
'
normal
'
);
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
fadeIn
(
'
normal
'
);
$
(
"
#flash
"
).
append
(
"
<ul class='flashes'><li>
"
+
msg
+
"
</li></ul>
"
);
}
function
selectFile
(
file
){
function
selectFile
(
file
){
relativeFile
=
file
.
replace
(
workdir
,
""
);
relativeFile
=
file
.
replace
(
workdir
,
""
);
$
(
"
#info
"
).
empty
();
$
(
"
#info
"
).
empty
();
...
@@ -175,7 +170,7 @@ $(document).ready( function() {
...
@@ -175,7 +170,7 @@ $(document).ready( function() {
edit
=
true
;
edit
=
true
;
}
}
else
{
else
{
error
(
data
.
result
);
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
}
);
}
}
send
=
false
;
send
=
false
;
}
}
...
...
slapos/runner/templates/layout.html
View file @
3928ec49
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
<meta
name=
"description"
content=
""
/>
<meta
name=
"description"
content=
""
/>
<link
href=
"{{ url_for('static', filename='css/styles.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"{{ url_for('static', filename='css/styles.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<script
src=
"{{ url_for('static', filename='js/jquery/jquery-1.6.2.min.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jquery-1.6.2.min.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/popup.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
type=
text/javascript
>
<script
type=
text/javascript
>
$SCRIPT_ROOT
=
{{
request
.
script_root
|
tojson
|
safe
}};
$SCRIPT_ROOT
=
{{
request
.
script_root
|
tojson
|
safe
}};
</script>
</script>
...
@@ -34,13 +35,18 @@
...
@@ -34,13 +35,18 @@
if
(
$
.
trim
(
this
.
value
)
==
''
){
if
(
$
.
trim
(
this
.
value
)
==
''
){
this
.
value
=
(
this
.
defaultValue
?
this
.
defaultValue
:
''
);
this
.
value
=
(
this
.
defaultValue
?
this
.
defaultValue
:
''
);
}
}
});
});
});
if
(
$
(
"
input#fmsg
"
).
val
()
!=
""
){
$
(
"
#error
"
).
Popup
(
$
(
"
input#fmsg
"
).
val
(),
{
type
:
'
info
'
,
duration
:
10000
,
load
:
true
});
}
});
</script>
</script>
{% endblock %}
{% endblock %}
</head>
</head>
<body>
<body>
<div
id=
"page"
>
<div
id=
"error"
></div>
<div
id=
"page"
>
<input
type=
"hidden"
name=
"fmsg"
value=
"{{ get_flashed_messages()[0] }}"
id=
"fmsg"
/>
<div
id=
"logo"
>
<div
id=
"logo"
>
<a
href=
"{{ url_for('home') }}"
><img
src=
"{{ url_for('static', filename='images/logo.png') }}"
alt=
""
/></a>
<a
href=
"{{ url_for('home') }}"
><img
src=
"{{ url_for('static', filename='images/logo.png') }}"
alt=
""
/></a>
</div>
</div>
...
@@ -72,18 +78,7 @@
...
@@ -72,18 +78,7 @@
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
<div
id=
"main"
>
<div
id=
"main"
>
<div
class=
"flash"
id=
"flash"
>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul
class=
"flashes"
>
{% for message in messages %}
<li>
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</div>
<div
{%
if
request.path =
=
'/'
%}
class=
"home_content"
{%
else
%}
id=
"content"
{%
endif
%}
>
<div
{%
if
request.path =
=
'/'
%}
class=
"home_content"
{%
else
%}
id=
"content"
{%
endif
%}
>
{% if request.path != '/' %}
{% if request.path != '/' %}
<div
class=
"main_head"
>
<div
class=
"main_head"
>
...
...
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