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
Justin
slapos.toolbox
Commits
47997b66
Commit
47997b66
authored
Apr 11, 2014
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rename, copy and paster in Editor. Add Upload file in editor
parent
0b55aeef
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
18 deletions
+90
-18
slapos/runner/static/css/jquery.contextMenu.css
slapos/runner/static/css/jquery.contextMenu.css
+2
-1
slapos/runner/static/js/jquery/jquery.fancytree.min.js
slapos/runner/static/js/jquery/jquery.fancytree.min.js
+5
-5
slapos/runner/static/js/scripts/process.js
slapos/runner/static/js/scripts/process.js
+1
-1
slapos/runner/static/js/scripts/softwareFolder.js
slapos/runner/static/js/scripts/softwareFolder.js
+62
-11
slapos/runner/templates/softwareFolder.html
slapos/runner/templates/softwareFolder.html
+20
-0
No files found.
slapos/runner/static/css/jquery.contextMenu.css
View file @
47997b66
...
@@ -69,3 +69,4 @@
...
@@ -69,3 +69,4 @@
.contextMenu
LI
.md5sum
A
{
background-image
:
url(images/selection-select.png)
;
}
.contextMenu
LI
.md5sum
A
{
background-image
:
url(images/selection-select.png)
;
}
.contextMenu
LI
.refresh
A
{
background-image
:
url(images/refresh.png)
;
}
.contextMenu
LI
.refresh
A
{
background-image
:
url(images/refresh.png)
;
}
.contextMenu
LI
.favorite
A
{
background-image
:
url(images/knewstuff.png)
;
}
.contextMenu
LI
.favorite
A
{
background-image
:
url(images/knewstuff.png)
;
}
.contextMenu
LI
.uploadfile
A
{
background-image
:
url(images/upload_folder.png)
;
}
\ No newline at end of file
slapos/runner/static/js/jquery/jquery.fancytree.min.js
View file @
47997b66
This diff is collapsed.
Click to expand it.
slapos/runner/static/js/scripts/process.js
View file @
47997b66
...
@@ -156,7 +156,7 @@ function updateStatus(elt, val) {
...
@@ -156,7 +156,7 @@ function updateStatus(elt, val) {
$
(
src
).
addClass
(
value
);
$
(
src
).
addClass
(
value
);
switch
(
val
)
{
switch
(
val
)
{
case
"
waiting
"
:
case
"
waiting
"
:
$
(
src
).
children
(
'
p
'
).
text
(
"
Waiting for starting
"
);
$
(
src
).
children
(
'
p
'
).
text
(
"
Queue
"
);
break
;
break
;
case
"
stopped
"
:
case
"
stopped
"
:
$
(
src
).
children
(
'
p
'
).
text
(
"
Stopped by user
"
);
$
(
src
).
children
(
'
p
'
).
text
(
"
Stopped by user
"
);
...
...
slapos/runner/static/js/scripts/softwareFolder.js
View file @
47997b66
...
@@ -9,6 +9,8 @@ $(document).ready(function () {
...
@@ -9,6 +9,8 @@ $(document).ready(function () {
var
viewer
,
var
viewer
,
modelist
,
modelist
,
config
,
config
,
files
,
working_node
=
null
,
editorlist
=
Array
(),
editorlist
=
Array
(),
editorIndex
=
0
,
editorIndex
=
0
,
saveTimeOut
=
null
,
saveTimeOut
=
null
,
...
@@ -434,6 +436,7 @@ $(document).ready(function () {
...
@@ -434,6 +436,7 @@ $(document).ready(function () {
var
request
,
cb
=
clipboardNode
.
toDict
(
true
,
function
(
dict
){
var
request
,
cb
=
clipboardNode
.
toDict
(
true
,
function
(
dict
){
delete
dict
.
key
;
// Remove key, so a new one will be created
delete
dict
.
key
;
// Remove key, so a new one will be created
});
});
cb
.
data
.
path
=
node
.
data
.
path
+
'
/
'
+
clipboardNode
.
title
;
if
(
pasteMode
==
"
cut
"
)
{
if
(
pasteMode
==
"
cut
"
)
{
// Cut mode: check for recursion and remove source
// Cut mode: check for recursion and remove source
dataForSend
.
opt
=
7
;
dataForSend
.
opt
=
7
;
...
@@ -449,7 +452,7 @@ $(document).ready(function () {
...
@@ -449,7 +452,7 @@ $(document).ready(function () {
node
.
render
();
node
.
render
();
}
}
else
{
else
{
node
.
l
azyLoad
()
node
.
l
oad
(
true
);
}
}
clipboardNode
.
remove
();
clipboardNode
.
remove
();
}
}
...
@@ -466,7 +469,7 @@ $(document).ready(function () {
...
@@ -466,7 +469,7 @@ $(document).ready(function () {
request
.
always
(
function
()
{
request
.
always
(
function
()
{
if
(
ajaxResult
){
if
(
ajaxResult
){
if
(
dataForSend
.
opt
===
14
){
if
(
dataForSend
.
opt
===
14
){
node
.
l
azyL
oad
(
true
);
node
.
load
(
true
);
node
.
toggleExpanded
();
node
.
toggleExpanded
();
}
}
else
if
(
node
.
isExpanded
()){
else
if
(
node
.
isExpanded
()){
...
@@ -493,7 +496,7 @@ $(document).ready(function () {
...
@@ -493,7 +496,7 @@ $(document).ready(function () {
menu
.
disableContextMenuItems
(
"
#edit,#view,#md5sum,#favorite
"
);
menu
.
disableContextMenuItems
(
"
#edit,#view,#md5sum,#favorite
"
);
}
}
else
{
else
{
menu
.
disableContextMenuItems
(
"
#nfile,#nfolder,#refresh,#paste
"
);
menu
.
disableContextMenuItems
(
"
#nfile,#nfolder,#refresh,#paste
,#ufile
"
);
}
}
return
true
;
return
true
;
}
}
...
@@ -570,7 +573,7 @@ $(document).ready(function () {
...
@@ -570,7 +573,7 @@ $(document).ready(function () {
getmd5sum
(
node
.
data
.
path
);
getmd5sum
(
node
.
data
.
path
);
break
;
break
;
case
"
refresh
"
:
case
"
refresh
"
:
node
.
l
azyL
oad
(
true
);
node
.
load
(
true
);
node
.
toggleExpanded
();
node
.
toggleExpanded
();
break
;
break
;
case
"
nfolder
"
:
case
"
nfolder
"
:
...
@@ -586,7 +589,7 @@ $(document).ready(function () {
...
@@ -586,7 +589,7 @@ $(document).ready(function () {
request
=
fileBrowserOp
(
dataForSend
)
request
=
fileBrowserOp
(
dataForSend
)
request
.
always
(
function
()
{
request
.
always
(
function
()
{
if
(
ajaxResult
){
if
(
ajaxResult
){
node
.
l
azyL
oad
(
true
);
node
.
load
(
true
);
node
.
toggleExpanded
();
node
.
toggleExpanded
();
}
}
});
});
...
@@ -604,7 +607,7 @@ $(document).ready(function () {
...
@@ -604,7 +607,7 @@ $(document).ready(function () {
request
=
fileBrowserOp
(
dataForSend
)
request
=
fileBrowserOp
(
dataForSend
)
request
.
always
(
function
()
{
request
.
always
(
function
()
{
if
(
ajaxResult
){
if
(
ajaxResult
){
node
.
l
azyL
oad
(
true
);
node
.
load
(
true
);
node
.
toggleExpanded
();
node
.
toggleExpanded
();
}
}
});
});
...
@@ -639,10 +642,18 @@ $(document).ready(function () {
...
@@ -639,10 +642,18 @@ $(document).ready(function () {
request
=
fileBrowserOp
(
dataForSend
);
request
=
fileBrowserOp
(
dataForSend
);
request
.
always
(
function
()
{
request
.
always
(
function
()
{
if
(
ajaxResult
){
if
(
ajaxResult
){
var
copy
=
node
.
toDict
(
true
,
function
(
dict
){
if
(
node
.
getParent
().
isRoot
())
{
dict
.
title
=
newName
;
if
(
$
(
'
#fileTreeFull
'
).
css
(
'
display
'
)
===
'
none
'
){
});
$
(
'
#fileTree
'
).
fancytree
(
"
getTree
"
).
reload
();
node
.
applyPatch
(
copy
);
}
else
{
$
(
'
#fileTreeFull
'
).
fancytree
(
"
getTree
"
).
reload
();
}
}
else
{
node
.
getParent
().
load
(
true
);
node
.
toggleExpanded
();
}
}
}
});
});
...
@@ -650,6 +661,16 @@ $(document).ready(function () {
...
@@ -650,6 +661,16 @@ $(document).ready(function () {
case
"
favorite
"
:
case
"
favorite
"
:
addToFavourite
(
node
.
data
.
path
);
addToFavourite
(
node
.
data
.
path
);
break
;
break
;
case
"
ufile
"
:
$
.
colorbox
.
remove
();
$
(
"
#uploadForm input[name=dir]
"
).
val
(
node
.
data
.
path
);
$
(
"
#inlineUpload
"
).
colorbox
({
inline
:
true
,
width
:
"
480px
"
,
height
:
"
200px
"
,
onComplete
:
function
(){
//nothing
}});
$
(
"
#inlineUpload
"
).
click
();
working_node
=
node
;
break
;
default
:
default
:
return
;
return
;
}
}
...
@@ -683,7 +704,7 @@ $(document).ready(function () {
...
@@ -683,7 +704,7 @@ $(document).ready(function () {
data
:{
opt
:
20
,
dir
:
path
,
key
:
key
,
listfiles
:
'
yes
'
},
data
:{
opt
:
20
,
dir
:
path
,
key
:
key
,
listfiles
:
'
yes
'
},
cache
:
false
cache
:
false
},
},
lazy
l
oad
:
function
(
event
,
data
)
{
lazy
L
oad
:
function
(
event
,
data
)
{
var
node
=
data
.
node
;
var
node
=
data
.
node
;
data
.
result
=
{
data
.
result
=
{
url
:
$SCRIPT_ROOT
+
"
/fileBrowser
"
,
url
:
$SCRIPT_ROOT
+
"
/fileBrowser
"
,
...
@@ -980,4 +1001,34 @@ $(document).ready(function () {
...
@@ -980,4 +1001,34 @@ $(document).ready(function () {
return
false
;
return
false
;
});
});
$
(
'
#choosefiles
'
).
on
(
'
change
'
,
function
(
event
)
{
files
=
event
.
target
.
files
;
});
$
(
"
#submitUpload
"
).
click
(
function
(){
jQuery
(
'
#uploadForm
'
).
submit
();
$
(
"
#cboxClose
"
).
click
();
return
false
;
});
jQuery
(
'
#uploadForm
'
).
ajaxForm
({
beforeSubmit
:
function
()
{
$
(
"
#error
"
).
Popup
(
"
We are uploading your file...
"
,
{
type
:
'
info
'
,
duration
:
3000
});
},
success
:
function
(
data
,
statusText
,
xhr
,
$form
)
{
if
(
data
.
indexOf
(
"
{result: '1'}
"
)
===
-
1
)
{
var
msg
=
(
data
===
"
{result: '0'}
"
)
?
"
ERROR: Please check your file or folder location!
"
:
data
;
$
(
"
#error
"
).
Popup
(
"
Error:
"
+
msg
,
{
type
:
'
error
'
,
duration
:
5000
});
}
else
{
$
(
"
#error
"
).
Popup
(
"
Your file has been uploaded!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
working_node
.
load
(
true
);
}
},
error
:
function
(
xhr
,
ajaxOptions
,
thrownError
)
{
alertStatus
(
xhr
);
},
dataType
:
'
script
'
});
});
});
slapos/runner/templates/softwareFolder.html
View file @
47997b66
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<li
class=
"paste"
><a
href=
"#paste"
>
Paste
</a></li>
<li
class=
"paste"
><a
href=
"#paste"
>
Paste
</a></li>
<li
class=
"newfile separator"
><a
href=
"#nfile"
>
New File
</a></li>
<li
class=
"newfile separator"
><a
href=
"#nfile"
>
New File
</a></li>
<li
class=
"newdir"
><a
href=
"#nfolder"
>
New Folder
</a></li>
<li
class=
"newdir"
><a
href=
"#nfolder"
>
New Folder
</a></li>
<li
class=
"uploadfile"
><a
href=
"#ufile"
>
Upload File
</a></li>
</ul>
</ul>
<div
id=
"software_folder"
>
<div
id=
"software_folder"
>
<div
class=
'box_header'
>
<div
class=
'box_header'
>
...
@@ -109,4 +110,23 @@
...
@@ -109,4 +110,23 @@
</div>
</div>
</div>
</div>
<a
id=
'inlineUpload'
style=
'display:none'
href=
"#uploadContent"
>
Inline HTML
</a>
<div
style=
'display:none'
>
<div
id=
"uploadContent"
style=
"padding:10px; background:#fff;"
>
<h2
style=
"color: #4c6172; font: 18px \'Helvetica Neue\', Helvetica, Arial, sans-serif;"
>
Upload local file to your workspace
</h2>
<p
id=
"uploadlog"
class=
"message"
><br/></p>
<br/>
<form
action=
"{{ url_for('fileBrowser') }}"
id=
"uploadForm"
enctype=
"multipart/form-data"
>
<div
class=
"fileinputs"
>
<input
type=
"file"
name=
"filename"
size=
"30"
id=
"choosefiles"
/>
<input
type=
"hidden"
name=
"opt"
value=
"11"
/>
<input
type=
"hidden"
name=
"dir"
value=
""
/>
<br/>
<input
type=
submit
value=
"Upload"
id=
"submitUpload"
class=
"button"
/>
</div>
</form>
</div>
</div>
{% endblock %}
{% endblock %}
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