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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.toolbox
Commits
21e50956
Commit
21e50956
authored
Oct 22, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update slaprunner editor and repository layout
parent
1a3a0773
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
247 additions
and
204 deletions
+247
-204
slapos/runner/static/css/jqueryTabs.css
slapos/runner/static/css/jqueryTabs.css
+1
-1
slapos/runner/static/css/styles.css
slapos/runner/static/css/styles.css
+28
-28
slapos/runner/static/css/superfish.css
slapos/runner/static/css/superfish.css
+23
-2
slapos/runner/static/images/gnome-session-switch.png
slapos/runner/static/images/gnome-session-switch.png
+0
-0
slapos/runner/static/images/icon_save.png
slapos/runner/static/images/icon_save.png
+0
-0
slapos/runner/static/js/scripts/cloneRepo.js
slapos/runner/static/js/scripts/cloneRepo.js
+31
-5
slapos/runner/static/js/scripts/project.js
slapos/runner/static/js/scripts/project.js
+27
-3
slapos/runner/static/js/scripts/repo.js
slapos/runner/static/js/scripts/repo.js
+3
-1
slapos/runner/static/js/scripts/softwareFolder.js
slapos/runner/static/js/scripts/softwareFolder.js
+21
-18
slapos/runner/templates/account.html
slapos/runner/templates/account.html
+4
-4
slapos/runner/templates/index.html
slapos/runner/templates/index.html
+2
-2
slapos/runner/templates/instanceInspect.html
slapos/runner/templates/instanceInspect.html
+3
-3
slapos/runner/templates/layout.html
slapos/runner/templates/layout.html
+9
-19
slapos/runner/templates/manageProject.html
slapos/runner/templates/manageProject.html
+0
-1
slapos/runner/templates/manageRepository.html
slapos/runner/templates/manageRepository.html
+54
-4
slapos/runner/templates/projectFolder.html
slapos/runner/templates/projectFolder.html
+2
-2
slapos/runner/templates/softwareFolder.html
slapos/runner/templates/softwareFolder.html
+17
-12
slapos/runner/utils.py
slapos/runner/utils.py
+11
-83
slapos/runner/views.py
slapos/runner/views.py
+11
-16
No files found.
slapos/runner/static/css/jqueryTabs.css
View file @
21e50956
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
overflow
:
hidden
;
overflow
:
hidden
;
height
:
34px
;
height
:
34px
;
position
:
absolute
;
position
:
absolute
;
z-index
:
10
0
;
z-index
:
8
0
;
}
}
#tabContaier
>
ul
>
li
{
#tabContaier
>
ul
>
li
{
float
:
left
;
float
:
left
;
...
...
slapos/runner/static/css/styles.css
View file @
21e50956
...
@@ -110,7 +110,7 @@ body {
...
@@ -110,7 +110,7 @@ body {
height
:
22px
;
height
:
22px
;
text-align
:
center
;
text-align
:
center
;
color
:
#4c6172
;
color
:
#4c6172
;
text-shadow
:
0
1px
1px
#
fff
;
text-shadow
:
0
1px
1px
#
F1F1F1
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
#header
.line
{
#header
.line
{
...
@@ -145,25 +145,6 @@ body {
...
@@ -145,25 +145,6 @@ body {
margin-left
:
28px
;
margin-left
:
28px
;
}
}
#wmenu
a
.slapos_run
{
background
:
url(../images/run_button.png)
center
no-repeat
;
}
#wmenu
a
.slapos_run
:hover
{
background
:
#c2c2c2
url(../images/run_button2.png)
center
no-repeat
;
}
#wmenu
a
.slapos_stop
{
background
:
url(../images/stop_button.png)
center
no-repeat
;
}
#wmenu
a
.slapos_stop
:hover
{
background
:
#c2c2c2
url(../images/stop_button2.png)
center
no-repeat
;
}
#wmenu
a
.main_menu
{
background
:
url(../images/main_menu.png)
center
no-repeat
;
}
#wmenu
a
.main_menu
:hover
{
background
:
#c2c2c2
url(../images/main_menu_hover.png)
center
no-repeat
;
}
#main
#main
{
{
background
:
url(../images/main_bg_all.png)
repeat-y
;
background
:
url(../images/main_bg_all.png)
repeat-y
;
...
@@ -174,9 +155,9 @@ body {
...
@@ -174,9 +155,9 @@ body {
.main_content
{
.main_content
{
position
:
relative
;
position
:
relative
;
width
:
99.6%
;
/*width: 99.6%;*/
height
:
430px
;
height
:
430px
;
margin-top
:
10
px
;
margin-top
:
2
px
;
border
:
1px
solid
#4c6172
;
border
:
1px
solid
#4c6172
;
overflow
:
auto
;
overflow
:
auto
;
}
}
...
@@ -191,8 +172,8 @@ body {
...
@@ -191,8 +172,8 @@ body {
background
:
url(../images/content.png)
repeat-y
;
background
:
url(../images/content.png)
repeat-y
;
width
:
936px
;
width
:
936px
;
padding
:
15px
;
padding
:
15px
;
padding-top
:
0
;
padding-top
:
1px
;
padding-bottom
:
0
;
padding-bottom
:
2px
;
min-height
:
400px
;
min-height
:
400px
;
}
}
...
@@ -430,7 +411,7 @@ padding: 10px;height: 80px;padding-bottom:15px;}
...
@@ -430,7 +411,7 @@ padding: 10px;height: 80px;padding-bottom:15px;}
.software_details
{
float
:
left
;}
.software_details
{
float
:
left
;}
#details_box
{
#details_box
{
display
:
block
;
display
:
block
;
margin-top
:
10
px
;
margin-top
:
2
px
;
}
}
#code
{
#code
{
float
:
right
;
float
:
right
;
...
@@ -439,7 +420,7 @@ padding: 10px;height: 80px;padding-bottom:15px;}
...
@@ -439,7 +420,7 @@ padding: 10px;height: 80px;padding-bottom:15px;}
#details_head
{
margin-bottom
:
10px
;}
#details_head
{
margin-bottom
:
10px
;}
#contentInfo
{
#contentInfo
{
width
:
926
px
;
width
:
882
px
;
border
:
solid
1px
#678dad
;
border
:
solid
1px
#678dad
;
background
:
#fff
;
background
:
#fff
;
overflow
:
auto
;
overflow
:
auto
;
...
@@ -595,7 +576,6 @@ h2.hight:hover{
...
@@ -595,7 +576,6 @@ h2.hight:hover{
color
:
#737373
;
color
:
#737373
;
font-weight
:
bold
;
font-weight
:
bold
;
text-shadow
:
0px
1px
#FFF
;
text-shadow
:
0px
1px
#FFF
;
margin-bottom
:
9px
;
font-size
:
14px
;
font-size
:
14px
;
cursor
:
default
;
cursor
:
default
;
word-wrap
:
break-word
word-wrap
:
break-word
...
@@ -647,7 +627,8 @@ select {
...
@@ -647,7 +627,8 @@ select {
overflow
:
hidden
;
overflow
:
hidden
;
padding
:
4px
;
padding
:
4px
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;}
white-space
:
nowrap
;
min-width
:
80px
;}
a
.lshare
{
a
.lshare
{
background
:
#fff
;
background
:
#fff
;
...
@@ -675,6 +656,25 @@ a.no-right-border:focus{border-right:none}
...
@@ -675,6 +656,25 @@ a.no-right-border:focus{border-right:none}
a
.lshare
img
{
a
.lshare
img
{
margin
:
5px
;
margin
:
5px
;
}
}
.box_header
{
background
:
#E4E4E4
;
width
:
100%
;
height
:
30px
;
padding-top
:
2px
;
text-indent
:
5px
;
color
:
#737373
;
text-shadow
:
0px
1px
#F1F1F1
;
border-bottom
:
3px
solid
#6DB9DD
;
}
.box_header
li
{
float
:
left
;
border
:
1px
solid
#AAB8C2
;
padding
:
1px
5px
1px
0
;
margin-left
:
5px
;}
.box_header
li
:last-child
{
border
:
none
}
.box_header
li
h2
{
padding-top
:
2px
;}
.box_header
li
>
span
{
cursor
:
pointer
;
height
:
22px
;
display
:
block
;
line-height
:
22px
;
font-weight
:
bold
;
padding
:
1px
;}
.box_header
li
:hover
{
border
:
1px
solid
#57A1D6
;
background
:
#C7C7C7
;}
.box_header
li
:last-child:hover
{
background
:
none
;
border
:
none
}
.box_header
li
>
a
{
font-weight
:
bold
;
font-size
:
15px
;
display
:
block
;
padding
:
2px
;}
.save_btn
{
background
:
url(../images/icon_save.png)
center
right
no-repeat
;
width
:
60px
;}
.swith_btn
{
background
:
url(../images/gnome-session-switch.png)
center
right
no-repeat
;
width
:
105px
;}
#error
{
#error
{
padding
:
0px
;
padding
:
0px
;
...
...
slapos/runner/static/css/superfish.css
View file @
21e50956
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
}
}
.sf-menu
ul
{
.sf-menu
ul
{
box-shadow
:
2px
2px
6px
rgba
(
0
,
0
,
0
,
.2
);
box-shadow
:
2px
2px
6px
rgba
(
0
,
0
,
0
,
.2
);
min-width
:
1
4
em
;
/* allow long menu items to determine submenu width */
min-width
:
1
6
em
;
/* allow long menu items to determine submenu width */
*
width
:
1
4
em
;
/* no auto sub width for IE7, see white-space comment below */
*
width
:
1
6
em
;
/* no auto sub width for IE7, see white-space comment below */
border
:
1px
solid
#C2C2C2
;
border
:
1px
solid
#C2C2C2
;
background
:
#E4E4E4
;
background
:
#E4E4E4
;
border-left
:
none
;
border-left
:
none
;
...
@@ -70,6 +70,15 @@
...
@@ -70,6 +70,15 @@
width
:
35px
;
width
:
35px
;
padding
:
7px
;
padding
:
7px
;
}
}
.sf-menu
li
.main_menu
{
background
:
url(../images/main_menu.png)
center
no-repeat
;
}
.sf-menu
li
.slapos_run
{
background
:
url(../images/run_button.png)
center
no-repeat
;
}
.sf-menu
li
.slapos_stop
{
background
:
url(../images/stop_button.png)
center
no-repeat
;
}
.sf-menu
li
:hover
,
.sf-menu
li
:hover
,
.sf-menu
li
.sfHover
{
.sf-menu
li
.sfHover
{
color
:
#fff
;
/*#0271BF;*/
color
:
#fff
;
/*#0271BF;*/
...
@@ -78,6 +87,18 @@
...
@@ -78,6 +87,18 @@
-webkit-transition
:
none
;
-webkit-transition
:
none
;
transition
:
none
;
transition
:
none
;
}
}
.sf-menu
li
.main_menu
:hover
,
.sf-menu
li
.main_menu.sfHover
{
background
:
#c2c2c2
url(../images/main_menu_hover.png)
center
no-repeat
;
}
.sf-menu
li
.slapos_stop
:hover
,
.sf-menu
li
.slapos_stop.sfHover
{
background
:
#c2c2c2
url(../images/stop_button2.png)
center
no-repeat
;
}
.sf-menu
li
.slapos_run
:hover
,
.sf-menu
li
.slapos_run.sfHover
{
background
:
#c2c2c2
url(../images/run_button2.png)
center
no-repeat
;
}
.sf-menu
li
a
:hover
{
.sf-menu
li
a
:hover
{
color
:
#fff
;
color
:
#fff
;
}
}
...
...
slapos/runner/static/images/gnome-session-switch.png
0 → 100644
View file @
21e50956
619 Bytes
slapos/runner/static/images/icon_save.png
0 → 100644
View file @
21e50956
876 Bytes
slapos/runner/static/js/scripts/
folder
.js
→
slapos/runner/static/js/scripts/
cloneRepo
.js
View file @
21e50956
...
@@ -25,6 +25,29 @@ $(document).ready(function () {
...
@@ -25,6 +25,29 @@ $(document).ready(function () {
});
});
}
}
function
fetchRepo
(){
$
(
"
#project
"
).
empty
();
$
.
post
(
$SCRIPT_ROOT
+
"
/listDirectory
"
,
{
name
:
'
workspace
'
},
function
(
data
)
{
var
result
=
data
.
result
,
i
;
if
(
result
.
length
>
0
){
$
(
"
#repoEmpty
"
).
hide
();
$
(
"
#repoContent
"
).
show
();
for
(
i
=
0
;
i
<
result
.
length
;
i
+=
1
)
{
$
(
"
#project
"
).
append
(
"
<option value='
"
+
result
[
i
]
+
"
'>
"
+
result
[
i
]
+
"
</option>
"
)
}
$
(
"
#project
"
).
change
();
}
else
{
$
(
"
#repoEmpty
"
).
show
();
$
(
"
#repoContent
"
).
hide
();
}
})
.
error
(
function
()
{
$
(
"
#error
"
).
Popup
(
"
unable to fetch your project list, please check your project folder
"
,
{
type
:
'
error
'
,
duration
:
5000
});
})
.
complete
(
function
()
{});
}
var
send
=
false
,
var
send
=
false
,
cloneRequest
;
cloneRequest
;
...
@@ -39,6 +62,9 @@ $(document).ready(function () {
...
@@ -39,6 +62,9 @@ $(document).ready(function () {
$
(
"
input#https
"
).
change
(
function
()
{
$
(
"
input#https
"
).
change
(
function
()
{
configRadio
();
configRadio
();
});
});
$
(
"
a#switchtoclone
"
).
click
(
function
(){
$
(
"
#cloneTab
"
).
click
();
});
$
(
"
#clone
"
).
click
(
function
()
{
$
(
"
#clone
"
).
click
(
function
()
{
if
(
send
)
{
if
(
send
)
{
cloneRequest
.
abort
();
cloneRequest
.
abort
();
...
@@ -130,9 +156,9 @@ $(document).ready(function () {
...
@@ -130,9 +156,9 @@ $(document).ready(function () {
});
});
return
false
;
return
false
;
});
});
$
(
"
#gitTab
"
).
click
(
function
(){
function
selectFile
(
file
)
{
if
(
!
$
(
this
).
hasClass
(
'
active
'
)){
//nothing
fetchRepo
();
return
;
}
}
});
});
});
slapos/runner/static/js/scripts/project.js
View file @
21e50956
...
@@ -42,11 +42,35 @@ $(document).ready(function () {
...
@@ -42,11 +42,35 @@ $(document).ready(function () {
return
;
return
;
}
}
if
(
method
!==
"
file
"
)
{
function
initTree
(
tree
,
path
,
key
){
$
(
'
#fileTree
'
).
fileTree
({
root
:
workdir
,
script
:
$SCRIPT_ROOT
+
'
/openFolder
'
,
folderEvent
:
'
click
'
,
expandSpeed
:
750
,
collapseSpeed
:
750
,
multiFolder
:
false
,
selectFolder
:
true
},
function
(
file
)
{
if
(
!
key
){
selectFile
(
file
);
key
=
'
0
'
;
}
$
(
tree
).
fancytree
({
activate
:
function
(
event
,
data
)
{
var
node
=
data
.
node
;
},
click
:
function
(
event
,
data
)
{
selectFile
(
data
.
node
.
data
.
path
+
"
/
"
);
},
source
:
{
url
:
$SCRIPT_ROOT
+
"
/fileBrowser
"
,
data
:{
opt
:
20
,
dir
:
path
,
key
:
key
,
listfiles
:
''
},
cache
:
false
},
lazyload
:
function
(
event
,
data
)
{
var
node
=
data
.
node
;
data
.
result
=
{
url
:
$SCRIPT_ROOT
+
"
/fileBrowser
"
,
data
:
{
opt
:
20
,
dir
:
node
.
data
.
path
,
key
:
node
.
key
,
listfiles
:
''
}
}
},
});
});
}
}
if
(
method
!==
"
file
"
)
{
initTree
(
'
#fileTree
'
,
workdir
);
}
$
(
"
input#subfolder
"
).
val
(
""
);
$
(
"
input#subfolder
"
).
val
(
""
);
$
(
"
#create
"
).
click
(
function
()
{
$
(
"
#create
"
).
click
(
function
()
{
if
(
$
(
"
input#software
"
).
val
()
===
""
||
!
$
(
"
input#software
"
).
val
().
match
(
/^
[\w\d
._
\-]
+$/
))
{
if
(
$
(
"
input#software
"
).
val
()
===
""
||
!
$
(
"
input#software
"
).
val
().
match
(
/^
[\w\d
._
\-]
+$/
))
{
...
...
slapos/runner/static/js/scripts/repo.js
View file @
21e50956
...
@@ -21,7 +21,6 @@ $(document).ready(function () {
...
@@ -21,7 +21,6 @@ $(document).ready(function () {
function
gitStatus
()
{
function
gitStatus
()
{
var
project
=
$
(
"
#project
"
).
val
(),
var
project
=
$
(
"
#project
"
).
val
(),
urldata
=
$
(
"
input#workdir
"
).
val
()
+
"
/
"
+
project
;
urldata
=
$
(
"
input#workdir
"
).
val
()
+
"
/
"
+
project
;
$
(
"
#status
"
).
empty
();
$
(
"
#status
"
).
empty
();
$
(
"
#push
"
).
hide
();
$
(
"
#push
"
).
hide
();
$
(
"
#flash
"
).
empty
();
$
(
"
#flash
"
).
empty
();
...
@@ -30,6 +29,9 @@ $(document).ready(function () {
...
@@ -30,6 +29,9 @@ $(document).ready(function () {
$
(
"
#branchlist
"
).
hide
();
$
(
"
#branchlist
"
).
hide
();
return
;
return
;
}
}
else
if
(
project
===
undefined
||
project
===
null
){
return
;
}
send
=
true
;
send
=
true
;
getStatus
=
$
.
ajax
({
getStatus
=
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
...
...
slapos/runner/static/js/scripts/softwareFolder.js
View file @
21e50956
...
@@ -23,7 +23,7 @@ $(document).ready(function () {
...
@@ -23,7 +23,7 @@ $(document).ready(function () {
selection
=
""
,
selection
=
""
,
edit_status
=
""
,
edit_status
=
""
,
base_path
=
function
()
{
base_path
=
function
()
{
return
softwareDisplay
?
projectDir
:
currentProject
;
return
softwareDisplay
?
currentProject
:
'
workspace/
'
;
};
};
...
@@ -55,9 +55,9 @@ $(document).ready(function () {
...
@@ -55,9 +55,9 @@ $(document).ready(function () {
if
(
data
.
code
===
1
)
{
if
(
data
.
code
===
1
)
{
$
(
"
#edit_info
"
).
empty
();
$
(
"
#edit_info
"
).
empty
();
name
=
file
.
split
(
'
/
'
);
name
=
file
.
split
(
'
/
'
);
if
(
file
.
length
>
6
0
)
{
if
(
file
.
length
>
8
0
)
{
//substring title.
//substring title.
start
=
file
.
length
-
6
0
;
start
=
file
.
length
-
8
0
;
path
=
"
...
"
+
file
.
substring
(
file
.
indexOf
(
"
/
"
,
(
start
+
1
)));
path
=
"
...
"
+
file
.
substring
(
file
.
indexOf
(
"
/
"
,
(
start
+
1
)));
}
}
$
(
"
#edit_info
"
).
append
(
"
"
+
path
);
$
(
"
#edit_info
"
).
append
(
"
"
+
path
);
...
@@ -105,19 +105,21 @@ $(document).ready(function () {
...
@@ -105,19 +105,21 @@ $(document).ready(function () {
function
switchContent
()
{
function
switchContent
()
{
if
(
!
softwareDisplay
)
{
if
(
!
softwareDisplay
)
{
$
(
"
#switch
"
).
empty
();
$
(
"
span.swith_btn
"
).
empty
();
$
(
"
#switch
"
).
append
(
"
Switch to Profile
"
);
$
(
"
span.swith_btn
"
).
append
(
"
This project
"
);
$
(
'
#fileTreeFull
'
).
show
();
$
(
'
#fileTreeFull
'
).
show
();
$
(
'
#fileTree
'
).
hide
();
$
(
'
#fileTree
'
).
hide
();
}
else
{
}
else
{
$
(
"
#switch
"
).
empty
();
$
(
"
span.swith_btn
"
).
empty
();
$
(
"
#switch
"
).
append
(
"
Switch to Project
"
);
$
(
"
span.swith_btn
"
).
append
(
"
Workspace
"
);
$
(
'
#fileTree
'
).
show
();
$
(
'
#fileTree
'
).
show
();
$
(
'
#fileTreeFull
'
).
hide
();
$
(
'
#fileTreeFull
'
).
hide
();
}
}
$
(
"
#info
"
).
empty
();
$
(
"
#info
"
).
empty
();
$
(
"
#info
"
).
append
(
"
Current work tree:
"
+
base_path
());
$
(
"
#info
"
).
append
(
"
Current work tree:
"
+
base_path
());
selection
=
""
;
selection
=
""
;
clipboardNode
=
null
;
pasteMode
=
null
;
}
}
function
getmd5sum
(
path
)
{
function
getmd5sum
(
path
)
{
...
@@ -256,7 +258,7 @@ $(document).ready(function () {
...
@@ -256,7 +258,7 @@ $(document).ready(function () {
if
(
data
.
indexOf
(
'
1
'
)
===
-
1
)
{
if
(
data
.
indexOf
(
'
1
'
)
===
-
1
)
{
$
(
"
#error
"
).
Popup
(
"
Error:
"
+
data
,
{
type
:
'
error
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
"
Error:
"
+
data
,
{
type
:
'
error
'
,
duration
:
5000
});
}
else
{
}
else
{
$
(
"
#error
"
).
Popup
(
"
Operation complete!
"
,
{
type
:
'
info
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
"
Operation complete!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
}
}
},
},
error
:
function
(
jqXHR
,
exception
)
{
error
:
function
(
jqXHR
,
exception
)
{
...
@@ -488,16 +490,9 @@ $(document).ready(function () {
...
@@ -488,16 +490,9 @@ $(document).ready(function () {
new
Mode
(
"
python
"
,
"
Python
"
,
require
(
"
ace/mode/python
"
).
Mode
,
[
"
py
"
]),
new
Mode
(
"
python
"
,
"
Python
"
,
require
(
"
ace/mode/python
"
).
Mode
,
[
"
py
"
]),
new
Mode
(
"
buildout
"
,
"
Python Buildout config
"
,
require
(
"
ace/mode/buildout
"
).
Mode
,
[
"
cfg
"
])
new
Mode
(
"
buildout
"
,
"
Python Buildout config
"
,
require
(
"
ace/mode/buildout
"
).
Mode
,
[
"
cfg
"
])
];
];
/*
$('#fileTree').fileTree({ root: projectDir, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function (file) {
initTree
(
'
#fileTree
'
,
currentProject
,
'
pfolder
'
);
selectFile(file);
initTree
(
'
#fileTreeFull
'
,
'
workspace
'
);
}, function (file) { openFile(file); });*/
/*$("#fileTree").fancytree();*/
/*$('#fileTreeFull').fileTree({ root: currentProject, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function (file) {
selectFile(file);
}, function (file) { openFile(file); });*/
initTree
(
'
#fileTree
'
,
projectDir
,
'
pfolder
'
);
initTree
(
'
#fileTreeFull
'
,
currentProject
);
$
(
"
#info
"
).
append
(
"
Current work tree:
"
+
base_path
());
$
(
"
#info
"
).
append
(
"
Current work tree:
"
+
base_path
());
/*setDetailBox();*/
/*setDetailBox();*/
...
@@ -506,6 +501,14 @@ $(document).ready(function () {
...
@@ -506,6 +501,14 @@ $(document).ready(function () {
$
(
"
span#edit_status
"
).
html
(
"
*
"
);
$
(
"
span#edit_status
"
).
html
(
"
*
"
);
}
}
});
});
editor
.
commands
.
addCommand
({
name
:
'
myCommand
'
,
bindKey
:
{
win
:
'
Ctrl-S
'
,
mac
:
'
Command-S
'
},
exec
:
function
(
editor
)
{
$
(
"
#save
"
).
click
();
},
readOnly
:
false
// false if this command should not apply in readOnly mode
});
$
(
"
#save
"
).
click
(
function
()
{
$
(
"
#save
"
).
click
(
function
()
{
if
(
!
edit
)
{
if
(
!
edit
)
{
...
...
slapos/runner/templates/account.html
View file @
21e50956
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
<script
src=
"{{ url_for('static', filename='js/jquery/jqueryTabs.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jqueryTabs.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
{% endblock %}
{% endblock %}
{% block body %}
{% block body %}
<h2>
SlapOS w
eb runner parameters
</h2><br/>
<h2>
W
eb runner parameters
</h2><br/>
<div
id=
"tabContaier"
>
<div
id=
"tabContaier"
>
<ul>
<ul>
<li><a
href=
"#tab1"
class=
"active"
>
Your personal information
</a></li>
<li><a
href=
"#tab1"
class=
"active"
>
Your personal information
</a></li>
<
li><a
href=
"#tab2"
>
Configurations
</a></li
>
<
!--<li><a href="#tab2">Configurations</a></li>--
>
</ul>
<!-- //Tab buttons -->
</ul>
<!-- //Tab buttons -->
<div
class=
"tabDetails"
>
<div
class=
"tabDetails"
>
<div
id=
"tab1"
class=
"tabContents"
>
<div
id=
"tab1"
class=
"tabContents"
>
...
@@ -45,8 +45,8 @@
...
@@ -45,8 +45,8 @@
<input
type=
"hidden"
name=
"hasAccount"
id=
"hasAccount"
value=
"{{name}}"
/>
<input
type=
"hidden"
name=
"hasAccount"
id=
"hasAccount"
value=
"{{name}}"
/>
</form>
</form>
</div>
</div>
<div
id=
"tab2"
class=
"tabContents"
>
<
!--<
div id="tab2" class="tabContents">
</div>
</div>
-->
</div>
</div>
</div>
</div>
{% if username %}
<div
id=
"file_info"
class=
"file_info"
>
leave passwords blank to preserve your current password...
{% if username %}
<div
id=
"file_info"
class=
"file_info"
>
leave passwords blank to preserve your current password...
...
...
slapos/runner/templates/index.html
View file @
21e50956
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
id=
"home_box"
>
<div
id=
"home_box"
>
<div
class=
"inner_box"
>
<div
class=
"inner_box"
>
<div
class=
"lmenu"
>
<div
class=
"lmenu"
>
<h2><a
href=
"{{ url_for('
configRepo')}}
"
>
Clone a Repository into your local Workspace
</a></h2>
<h2><a
href=
"{{ url_for('
manageRepository')}}#tab1
"
>
Clone a Repository into your local Workspace
</a></h2>
<p>
Your repository will be cloned into your project folder, you will need the url of the repository.
<p>
Your repository will be cloned into your project folder, you will need the url of the repository.
This allows you to open and edit your local project copy and synchronize content with online repository.
This allows you to open and edit your local project copy and synchronize content with online repository.
</p>
</p>
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
<div
class=
"sright_menu"
>
<div
class=
"sright_menu"
>
<h2><a
href=
"{{ url_for('manage
Project')}}
"
>
Manage Repositories
</a></h2>
<h2><a
href=
"{{ url_for('manage
Repository')}}#tab2
"
>
Manage Repositories
</a></h2>
<p>
You can view details of all repositories and commit your Software Release here.
</p>
<p>
You can view details of all repositories and commit your Software Release here.
</p>
<img
src=
"{{ url_for('static', filename='images/manage_repo.png') }}"
/>
<img
src=
"{{ url_for('static', filename='images/manage_repo.png') }}"
/>
</div>
</div>
...
...
slapos/runner/templates/instanceInspect.html
View file @
21e50956
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
<h2>
Instance inspection
</h2><br/>
<h2>
Instance inspection
</h2><br/>
<div
id=
"tabContaier"
>
<div
id=
"tabContaier"
>
<ul>
<ul>
<li><a
href=
"#tab1"
class=
"active"
>
Slapgrid Supervisor
</a></li>
<li><a
href=
"#tab1"
class=
"active"
>
Process
</a></li>
<li><a
href=
"#tab2"
>
SLAP Response
</a></li>
<li><a
href=
"#tab2"
>
Connection Information
</a></li>
<li><a
href=
"#tab3"
id=
"parameterTab"
>
SLAP
Parameters
</a></li>
<li><a
href=
"#tab3"
id=
"parameterTab"
>
Parameters
</a></li>
<li><a
href=
"#tab4"
id=
"instancetabfiles"
>
Partitions Content
</a></li>
<li><a
href=
"#tab4"
id=
"instancetabfiles"
>
Partitions Content
</a></li>
</ul>
<!-- //Tab buttons -->
</ul>
<!-- //Tab buttons -->
<div
class=
"tabDetails"
>
<div
class=
"tabDetails"
>
...
...
slapos/runner/templates/layout.html
View file @
21e50956
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
{% if request.path != '/login' %}
{% if request.path != '/login' %}
<div
id=
"header"
>
<div
id=
"header"
>
<div
class=
"block_header"
>
<div
class=
"block_header"
>
<a
href=
"{{ url_for('home') }}"
style=
"float:left;"
id=
"home"
{%
if
request
.
path
!=
'/'
%}
rel=
"tooltip"
{%
endif
%}
title=
"Home"
><img
alt=
""
src=
"{{ url_for('static', filename='images/home.png') }}"
/></a>
<a
href=
"{{ url_for('home') }}"
style=
"float:left;"
id=
"home"
title=
"Home"
><img
alt=
""
src=
"{{ url_for('static', filename='images/home.png') }}"
/></a>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
<a
href=
"{{ url_for('dologout') }}"
style=
"float:left"
title=
"Close your session"
><img
alt=
""
src=
"{{ url_for('static', filename='images/logout.png') }}"
/></a>
<a
href=
"{{ url_for('dologout') }}"
style=
"float:left"
title=
"Close your session"
><img
alt=
""
src=
"{{ url_for('static', filename='images/logout.png') }}"
/></a>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
...
@@ -78,16 +78,16 @@
...
@@ -78,16 +78,16 @@
<div
id=
"wmenu"
>
<div
id=
"wmenu"
>
<ul
class=
"sf-menu"
>
<ul
class=
"sf-menu"
>
<li><a
href=
"{{ url_for('editCurrentProject') }}"
>
Editor
</a></li>
<li><a
href=
"{{ url_for('editCurrentProject') }}"
>
Editor
</a></li>
<li><a
href=
"{{ url_for('
browseWorkspa
ce') }}"
>
Services
</a></li>
<li><a
href=
"{{ url_for('
inspectInstan
ce') }}"
>
Services
</a></li>
<li><a
href=
"{{ url_for('
runSoftwareProfile') }}"
id=
"softrun
"
>
Logs
</a></li>
<li><a
href=
"{{ url_for('
viewInstanceLog') }}
"
>
Logs
</a></li>
<li><a
href=
"{{ url_for('viewSoftwareLog') }}"
>
Terminal
</a></li>
<li><a
href=
"{{ url_for('viewSoftwareLog') }}"
>
Terminal
</a></li>
<li><a
href=
"{{ url_for('
inspectSoftware') }}
"
>
Git
</a></li>
<li><a
href=
"{{ url_for('
manageRepository')}}#tab2
"
>
Git
</a></li>
<li
class=
'right_menu
'
><a
class=
"main_menu"
href=
"{{ url_for('viewInstanceLog') }}
"
></a>
<li
class=
'right_menu
main_menu'
><a
href=
"#
"
></a>
<ul>
<ul>
<li><a
href=
"{{ url_for('myAccount')}}"
>
Parameters
</a></li>
<li><a
href=
"{{ url_for('myAccount')}}"
>
Parameters
</a></li>
<li
class=
'sep'
></li>
<li
class=
'sep'
></li>
<li><a
href=
"
#
"
>
Open Software Release
</a></li>
<li><a
href=
"
{{ url_for('openProject', method='open')}}
"
>
Open Software Release
</a></li>
<li><a
href=
"
#
"
>
Create Software Release
</a></li>
<li><a
href=
"
{{ url_for('openProject', method='new')}}
"
>
Create Software Release
</a></li>
<li
class=
'sep'
></li>
<li
class=
'sep'
></li>
<li><a
href=
"{{ url_for('browseWorkspace') }}"
>
Browse Workspace
</a></li>
<li><a
href=
"{{ url_for('browseWorkspace') }}"
>
Browse Workspace
</a></li>
<li><a
href=
"{{ url_for('inspectSoftware') }}"
>
My Softwares Releases
</a></li>
<li><a
href=
"{{ url_for('inspectSoftware') }}"
>
My Softwares Releases
</a></li>
...
@@ -95,7 +95,8 @@
...
@@ -95,7 +95,8 @@
<li><a
href=
"{{ url_for('dologout') }}"
>
Log out
</a></li>
<li><a
href=
"{{ url_for('dologout') }}"
>
Log out
</a></li>
</ul>
</ul>
</li>
</li>
<li
class=
'right_menu'
><a
class=
"slapos_run"
href=
"{{ url_for('runInstanceProfile') }}"
id=
"instrun"
></a>
<li
class=
'right_menu slapos_run'
><a
href=
"{{ url_for('runInstanceProfile') }}"
id=
"instrun"
></a>
<!--<li><a href="{{ url_for('viewInstanceLog') }}" id="softrun">Logs</a></li>-->
</li>
</li>
</ul>
</ul>
</div>
</div>
...
@@ -140,16 +141,5 @@
...
@@ -140,16 +141,5 @@
</tr>
</tr>
</tbody></table>
</tbody></table>
</div>
</div>
<div
id=
"tooltip-home"
style=
"display:none"
>
<span
style=
"font-weight:bold"
>
QUICK ACCESS TO MENU
</span><br/><br/>
<div
style=
"margin-top:3px;border-bottom: 1px dashed #666666; heigth:1px"
></div>
<ul
class=
"menu"
>
<li><a
href=
"{{ url_for('manageProject')}}"
>
Manage Repositories
</a></li>
<li><a
href=
"{{ url_for('configRepo')}}"
>
Clone your repository
</a></li>
<li><a
href=
"{{ url_for('openProject', method='open')}}"
>
Open Software Release
</a></li>
<li><a
href=
"{{ url_for('openProject', method='new')}}"
>
Create Software Release
</a></li>
<li
style=
"heigth:1px"
></li>
</ul>
</div>
</body>
</body>
</html>
</html>
slapos/runner/templates/manageProject.html
View file @
21e50956
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
{% block title %}Manage your Project{% endblock %}
{% block title %}Manage your Project{% endblock %}
{% block head %}
{% block head %}
{{ super() }}
{{ super() }}
<script
src=
"{{ url_for('static', filename='js/jquery/jqueryFileTree.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/repo.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/repo.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
{% endblock %}
{% endblock %}
{% block body %}
{% block body %}
...
...
slapos/runner/templates/
clon
eRepository.html
→
slapos/runner/templates/
manag
eRepository.html
View file @
21e50956
...
@@ -6,17 +6,18 @@
...
@@ -6,17 +6,18 @@
<link
href=
"{{ url_for('static', filename='css/jqueryTabs.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"{{ url_for('static', filename='css/jqueryTabs.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"{{ url_for('static', filename='css/colorbox.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"{{ url_for('static', filename='css/colorbox.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<script
src=
"{{ url_for('static', filename='js/jquery/gsFileManager.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/gsFileManager.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/folder.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/cloneRepo.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/repo.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jqueryTabs.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jqueryTabs.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jquery.colorbox-min.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jquery.colorbox-min.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/ace/ace.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/ace/ace.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
{% endblock %}
{% endblock %}
{% block body %}
{% block body %}
<h2>
Clone a project repository into your workspace
</h2><br/>
<div
id=
"tabContaier"
>
<div
id=
"tabContaier"
>
<ul>
<ul>
<li><a
href=
"#tab1"
class=
"active"
>
Clone your repository
</a></li>
<li><a
href=
"#tab1"
class=
"active"
id=
"cloneTab"
>
Clone repository
</a></li>
<li><a
href=
"#tab2"
>
Manage your project folder
</a></li>
<li><a
href=
"#tab2"
id=
"gitTab"
>
Manage (GIT)
</a></li>
<li><a
href=
"#tab3"
>
Browse
</a></li>
</ul>
<!-- //Tab buttons -->
</ul>
<!-- //Tab buttons -->
<div
class=
"tabDetails"
>
<div
class=
"tabDetails"
>
<div
id=
"tab1"
class=
"tabContents"
>
<div
id=
"tab1"
class=
"tabContents"
>
...
@@ -74,6 +75,55 @@
...
@@ -74,6 +75,55 @@
<!--Fin tab1-->
<!--Fin tab1-->
</div>
</div>
<div
id=
"tab2"
class=
"tabContents"
>
<div
id=
"tab2"
class=
"tabContents"
>
<form
action=
""
method=
post
>
<input
type=
"hidden"
name=
"subfolder"
id=
"subfolder"
value=
""
/>
<h2
style=
"{% if project %}display:none{% endif %}"
id=
"repoEmpty"
>
Your repository folder is empty.
<a
id=
"switchtoclone"
>
Click here
</a>
to create a new one!
</h2>
<div
id=
"repoContent"
style=
"{% if not project %}display:none{% endif %}"
>
<label
for=
'project'
>
Current Repository:
</label>
<select
id=
"project"
name=
"project"
>
{% for folder in project%}
<option
value=
"{{folder}}"
>
{{folder}}
</option>
{% endfor %}
</select>
<a
id=
"switchtoclone"
class=
"lshare"
>
New repository
</a>
<br/><br/>
<div
id=
"contentInfo"
>
<div
id=
"status"
style=
"margin-bottom:20px;"
>
<h2>
Please select one project...
</h2>
</div>
<div
id=
"branchlist"
style=
"margin-bottom:20px;"
>
<h2>
Your Repository Branches
</h2>
<div
style=
"margin-left:15px;"
>
<label
for=
'activebranch'
>
Select your active Branch:
</label>
<select
name=
"activebranch"
id=
"activebranch"
>
</select>
<label
for=
'branchname'
>
Branch Name:
</label>
<input
type=
"text"
name=
"branchname"
id=
"branchname"
size=
'22'
value=
"Enter the branch name..."
/>
<input
type=
"submit"
name=
"addbranch"
id =
"addbranch"
value=
"Add"
class=
"button"
title=
'add new branch: git checkout -b branch'
/>
<input
type=
"submit"
name=
"docheckout"
id =
"docheckout"
value=
"Checkout"
class=
"button"
title=
'add existing branch: git checkout branch'
/>
<br/>
<!--<label for='pullbranch'>Update your local repository: </label>-->
<!--<input type="submit" name="pullbranch" id ="pullbranch" value="Pull" class="button"/>-->
<!--<img class="waitting" id="pullimgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />-->
</div>
</div>
<div
id=
"push"
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"
/>
<img
class=
"waitting"
id=
"imgwaitting"
src=
"{{ url_for('static', filename='images/waiting.gif') }}"
alt=
""
/>
</div>
</div>
<br/>
</div>
</div>
</form>
</div>
<div
id=
"tab3"
class=
"tabContents"
>
<div
id=
"fileNavigator"
></div>
<div
id=
"fileNavigator"
></div>
</div>
</div>
</div>
</div>
...
...
slapos/runner/templates/projectFolder.html
View file @
21e50956
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
{% block title %}{% if method == "new" %}Adding new software{%else%}Open existing project{%endif%}{% endblock %}
{% block title %}{% if method == "new" %}Adding new software{%else%}Open existing project{%endif%}{% endblock %}
{% block head %}
{% block head %}
{{ super() }}
{{ super() }}
<link
href=
"{{ url_for('static', filename='css/
jqueryFileT
ree.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"{{ url_for('static', filename='css/
ui.fancyt
ree.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<script
src=
"{{ url_for('static', filename='js/jquery/jquery
FileTree
.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/jquery/jquery
.fancytree.min
.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/project.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"{{ url_for('static', filename='js/scripts/project.js') }}"
type=
"text/javascript"
charset=
"utf-8"
></script>
{% endblock %}
{% endblock %}
{% block body %}
{% block body %}
...
...
slapos/runner/templates/softwareFolder.html
View file @
21e50956
...
@@ -39,23 +39,29 @@
...
@@ -39,23 +39,29 @@
</ul>
</ul>
<div
id=
"software_folder"
>
<div
id=
"software_folder"
>
<div
class=
"software_details"
>
<div>
<div>
<a
href=
"#"
id=
"switch"
class=
"lshare no-right-border"
style=
"float:left"
>
Switch to Project
</a>
<ul
class=
'box_header'
>
<a
href=
"#"
id=
"clearselect"
class=
"lshare no-right-border"
style=
"float:left"
>
Reset
</a>
<li
id=
"switch"
><span
class=
"swith_btn"
title=
"Switch between differents file source"
>
Workspace
</span></li>
<a
href=
"#"
id=
"save"
class=
"lshare"
style=
"float:left"
>
Save
</a>
<li
id=
"save"
><span
class=
"save_btn"
title=
"Save current file. Hint: Use Ctrl+S"
>
Save
</span></li>
<li>
<h2>
<a
style=
"display:none"
id=
'option'
href=
'#'
rel=
'tooltip'
title=
'Show more option'
>
[Current file]
</a><span
id=
"edit_info"
>
No file in editor
</span>
<span
id=
"edit_status"
></span>
</h2>
</li>
</ul>
<!--<a href="#" id="clearselect" class="lshare no-right-border" style="float:left">Clean</a>-->
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
<div
class=
"software_details"
>
<div
id=
"details_box"
>
<div
id=
"details_box"
>
<div
id=
"fileTree"
class=
"file_tree_short"
></div>
<div
id=
"fileTree"
class=
"file_tree_short"
></div>
<div
id=
"fileTreeFull"
style=
'display:none'
class=
"file_tree_short"
></div>
<div
id=
"fileTreeFull"
style=
'display:none'
class=
"file_tree_short"
></div>
</div>
</div>
</div>
</div>
<div
id=
"code"
>
<div
id=
"code"
>
<h2
class=
'title'
>
<a
style=
"display:none"
id=
'option'
href=
'#'
rel=
'tooltip'
title=
'Show more option'
>
[Current file]
</a><span
id=
"edit_info"
>
No file in editor
</span>
<span
id=
"edit_status"
></span>
</h2>
<div
class=
"main_content"
>
<div
class=
"main_content"
>
<pre
id=
"editor"
>
<pre
id=
"editor"
>
...
@@ -67,13 +73,12 @@
...
@@ -67,13 +73,12 @@
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<div
id=
"file_info"
class=
"file_info"
><span
id=
"info"
></span></div>
<div
id=
"file_info"
class=
"file_info"
><span
id=
"info"
></span></div>
<br/>
</form>
</form>
<div
id=
"tooltip-option"
style=
"display:none"
>
<div
id=
"tooltip-option"
style=
"display:none"
>
<span
class=
"list first-list"
>
MD5 SUM for the current file
</span>
<span
class=
"list first-list"
>
MD5 SUM for the current file
</span>
<a
id=
'getmd5'
href=
"#"
>
Get or Update md5sum
</a>
<a
id=
'getmd5'
href=
"#"
>
Get or Update md5sum
</a>
<div
class=
"sep"
></div>
<div
class=
"sep"
></div>
<span
class=
"list"
>
Add
Project to Develop
</span>
<span
class=
"list"
>
Add
project development
</span>
<ul
id=
"plist"
>
<ul
id=
"plist"
>
{% for name in projectList%}
{% for name in projectList%}
<li><input
type=
"checkbox"
name=
"develop"
value=
"{{name}}"
id=
"{{name}}"
>
<li><input
type=
"checkbox"
name=
"develop"
value=
"{{name}}"
id=
"{{name}}"
>
...
...
slapos/runner/utils.py
View file @
21e50956
...
@@ -443,94 +443,22 @@ def svcStartStopProcess(config, process, action):
...
@@ -443,94 +443,22 @@ def svcStartStopProcess(config, process, action):
cmd[action], process]).communicate()[0]
cmd[action], process]).communicate()[0]
def getFolderContent(config, folder):
def listFolder(config, path):
"""
"""Return the list of folder into path
Read all file and folder into specified directory
Args:
config: Slaprunner configuration.
folder: the directory to read.
Returns:
Html formatted string or error message when fail.
"""
r = ['
<
ul
class
=
"jqueryFileTree"
style
=
"display: none;"
>
']
try:
folder = str(folder)
r = ['
<
ul
class
=
"jqueryFileTree"
style
=
"display: none;"
>
']
d = urllib.unquote(folder)
realdir = realpath(config, d)
if realdir:
ldir = sorted(os.listdir(realdir), key=str.lower)
else:
r.append('
Could
not
load
directory
:
Permission
denied
')
ldir = []
for f in ldir:
if f.startswith('
.
'): # do not displays this file/folder
continue
ff = os.path.join(d, f)
if os.path.isdir(os.path.join(realdir, f)):
r.append('
<
li
class
=
"directory collapsed"
><
a
href
=
"#%s"
rel
=
"%s/"
>%
s
</
a
></
li
>
' % (ff, ff, f))
else:
e = os.path.splitext(f)[1][1:] # get .ext and remove dot
r.append('
<
li
class
=
"file ext_%s"
><
a
href
=
"#%s"
rel
=
"%s"
>%
s
</
a
></
li
>
' % (e, ff, ff, f))
r.append('
</
ul
>
')
except Exception as e:
r.append('
Could
not
load
directory
:
%
s
' % str(e))
r.append('
</
ul
>
')
return jsonify(result=''.join(r))
def getFolder(config, folder):
"""
Read list of folder for the specified directory
Args:
config: Slaprunner configuration.
folder: the directory to read.
Returns:
Html formatted string or error message when fail.
"""
r = ['
<
ul
class
=
"jqueryFileTree"
style
=
"display: none;"
>
']
try:
folder = str(folder)
r = ['
<
ul
class
=
"jqueryFileTree"
style
=
"display: none;"
>
']
d = urllib.unquote(folder)
realdir = realpath(config, d)
if not realdir:
r.append('
Could
not
load
directory
:
Permission
denied
')
ldir = []
else:
ldir = sorted(os.listdir(realdir), key=str.lower)
for f in ldir:
if f.startswith('
.
'): # do not display this file/folder
continue
ff = os.path.join(d, f)
if os.path.isdir(os.path.join(realdir, f)):
r.append('
<
li
class
=
"directory collapsed"
><
a
href
=
"#%s"
rel
=
"%s/"
>%
s
</
a
></
li
>
' % (ff, ff, f))
r.append('
</
ul
>
')
except Exception as e:
r.append('
Could
not
load
directory
:
%
s
' % str(e))
r.append('
</
ul
>
')
return jsonify(result=''.join(r))
def getProjectList(folder):
"""Return the list of projet (folder) into the workspace
Agrs:
Agrs:
folder: path of the workspace
path: path of the directory to list
Returns:
Returns:
a list that contains each folder name.
a list that contains each folder name.
"""
"""
project = []
folderList = []
project_list = sorted(os.listdir(folder), key=str.lower)
folder = realpath(config, path)
for elt in project_list:
if folder:
path_list = sorted(os.listdir(folder), key=str.lower)
for elt in path_list:
if os.path.isdir(os.path.join(folder, elt)):
if os.path.isdir(os.path.join(folder, elt)):
projec
t.append(elt)
folderLis
t.append(elt)
return
projec
t
return
folderLis
t
def configNewSR(config, projectpath):
def configNewSR(config, projectpath):
...
...
slapos/runner/views.py
View file @
21e50956
...
@@ -13,9 +13,8 @@ from flask import (Flask, request, redirect, url_for, render_template,
...
@@ -13,9 +13,8 @@ from flask import (Flask, request, redirect, url_for, render_template,
g
,
flash
,
jsonify
,
session
,
abort
,
send_file
)
g
,
flash
,
jsonify
,
session
,
abort
,
send_file
)
from
slapos.runner.process
import
killRunningProcess
from
slapos.runner.process
import
killRunningProcess
from
slapos.runner.utils
import
(
checkSoftwareFolder
,
configNewSR
,
getFolder
,
from
slapos.runner.utils
import
(
checkSoftwareFolder
,
configNewSR
,
getProfilePath
,
getFolderContent
,
getProfilePath
,
listFolder
,
getProjectTitle
,
getSession
,
getProjectList
,
getProjectTitle
,
getSession
,
getSlapStatus
,
getSvcStatus
,
getSlapStatus
,
getSvcStatus
,
getSvcTailProcess
,
isInstanceRunning
,
getSvcTailProcess
,
isInstanceRunning
,
isSoftwareRunning
,
isText
,
isSoftwareRunning
,
isText
,
...
@@ -104,10 +103,11 @@ def dologout():
...
@@ -104,10 +103,11 @@ def dologout():
@
login_required
()
@
login_required
()
def
configRepo
():
def
manageRepository
():
public_key
=
open
(
app
.
config
[
'public_key'
]).
read
()
public_key
=
open
(
app
.
config
[
'public_key'
]).
read
()
account
=
getSession
(
app
.
config
)
account
=
getSession
(
app
.
config
)
return
render_template
(
'cloneRepository.html'
,
workDir
=
'workspace'
,
return
render_template
(
'manageRepository.html'
,
workDir
=
'workspace'
,
project
=
listFolder
(
app
.
config
,
'workspace'
),
public_key
=
public_key
,
name
=
account
[
3
].
decode
(
'utf-8'
),
public_key
=
public_key
,
name
=
account
[
3
].
decode
(
'utf-8'
),
email
=
account
[
2
])
email
=
account
[
2
])
...
@@ -286,13 +286,9 @@ def cloneRepository():
...
@@ -286,13 +286,9 @@ def cloneRepository():
@
login_required
()
@
login_required
()
def
readFolder
():
def
listDirectory
():
return
getFolderContent
(
app
.
config
,
request
.
form
[
'dir'
])
folderList
=
listFolder
(
app
.
config
,
request
.
form
[
'name'
])
return
jsonify
(
result
=
folderList
)
@
login_required
()
def
openFolder
():
return
getFolder
(
app
.
config
,
request
.
form
[
'dir'
])
@
login_required
()
@
login_required
()
...
@@ -336,7 +332,7 @@ def editCurrentProject():
...
@@ -336,7 +332,7 @@ def editCurrentProject():
if
os
.
path
.
exists
(
project
):
if
os
.
path
.
exists
(
project
):
return
render_template
(
'softwareFolder.html'
,
workDir
=
'workspace'
,
return
render_template
(
'softwareFolder.html'
,
workDir
=
'workspace'
,
project
=
open
(
project
).
read
(),
project
=
open
(
project
).
read
(),
projectList
=
getProjectList
(
app
.
config
[
'workspace'
]
))
projectList
=
listFolder
(
app
.
config
,
'workspace'
))
return
redirect
(
url_for
(
'configRepo'
))
return
redirect
(
url_for
(
'configRepo'
))
...
@@ -770,9 +766,8 @@ app.add_url_rule('/createSoftware', 'createSoftware', createSoftware,
...
@@ -770,9 +766,8 @@ app.add_url_rule('/createSoftware', 'createSoftware', createSoftware,
methods
=
[
'POST'
])
methods
=
[
'POST'
])
app
.
add_url_rule
(
'/cloneRepository'
,
'cloneRepository'
,
cloneRepository
,
app
.
add_url_rule
(
'/cloneRepository'
,
'cloneRepository'
,
cloneRepository
,
methods
=
[
'POST'
])
methods
=
[
'POST'
])
app
.
add_url_rule
(
'/openFolder'
,
'openFolder'
,
openFolder
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
'/listDirectory'
,
'listDirectory'
,
listDirectory
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
'/readFolder'
,
'readFolder'
,
readFolder
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
'/manageRepository'
,
'manageRepository'
,
manageRepository
)
app
.
add_url_rule
(
'/configRepo'
,
'configRepo'
,
configRepo
)
app
.
add_url_rule
(
"/saveParameterXml"
,
'saveParameterXml'
,
saveParameterXml
,
app
.
add_url_rule
(
"/saveParameterXml"
,
'saveParameterXml'
,
saveParameterXml
,
methods
=
[
'POST'
])
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/getPath"
,
'getPath'
,
getPath
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/getPath"
,
'getPath'
,
getPath
,
methods
=
[
'POST'
])
...
...
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