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
Nicolas Wavrant
slapos.toolbox
Commits
a591c3f3
Commit
a591c3f3
authored
Jan 15, 2020
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: remove /inspectSoftware page and related views
parent
462713da
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
157 deletions
+1
-157
slapos/runner/static/js/scripts/inspectSoftware.js
slapos/runner/static/js/scripts/inspectSoftware.js
+0
-99
slapos/runner/templates/layout.html
slapos/runner/templates/layout.html
+0
-1
slapos/runner/templates/runResult.html
slapos/runner/templates/runResult.html
+0
-28
slapos/runner/views.py
slapos/runner/views.py
+1
-29
No files found.
slapos/runner/static/js/scripts/inspectSoftware.js
deleted
100644 → 0
View file @
462713da
/*jslint undef: true */
/*global $, document, window, $SCRIPT_ROOT, ace */
/* vim: set et sts=4: */
$
(
document
).
ready
(
function
()
{
"
use strict
"
;
var
editor
,
send
=
false
,
runnerDir
=
$
(
"
input#runnerdir
"
).
val
();
function
fillContent
()
{
$
(
'
#fileNavigator
'
).
gsFileManager
({
script
:
$SCRIPT_ROOT
+
"
/fileBrowser
"
,
root
:
runnerDir
});
}
$
(
"
#reloadfiles
"
).
click
(
function
()
{
fillContent
();
});
fillContent
();
$
(
"
#open
"
).
click
(
function
()
{
var
elt
=
$
(
"
option:selected
"
,
$
(
"
#softwarelist
"
));
if
(
elt
.
val
()
===
"
No Software Release found
"
)
{
$
(
"
#error
"
).
Popup
(
"
Please select your Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
});
return
false
;
}
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/supplySoftwareRelease
'
,
data
:
"
path=
"
+
elt
.
attr
(
'
rel
'
),
success
:
function
(
data
)
{
if
(
data
.
code
===
1
)
{
window
.
location
.
href
=
$SCRIPT_ROOT
+
'
/editSoftwareProfile
'
;
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
});
return
false
;
});
$
(
"
#delete
"
).
click
(
function
()
{
if
(
$
(
"
#softwarelist
"
).
val
()
===
"
No Software Release found
"
)
{
$
(
"
#error
"
).
Popup
(
"
Please select your Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
});
return
false
;
}
if
(
send
)
{
return
;
}
if
(
!
window
.
confirm
(
"
Do you really want to delete this software release?
"
))
{
return
;
}
send
=
false
;
var
elt
=
$
(
"
option:selected
"
,
$
(
"
#softwarelist
"
));
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/removeSoftwareDir
'
,
data
:
{
md5
:
$
(
"
#softwarelist
"
).
val
(),
title
:
elt
.
attr
(
'
title
'
)
},
success
:
function
(
data
)
{
var
i
;
if
(
data
.
code
===
1
)
{
$
(
"
#softwarelist
"
).
empty
();
for
(
i
=
0
;
i
<
data
.
result
.
length
;
i
+=
1
)
{
$
(
"
#softwarelist
"
).
append
(
'
<option value="
'
+
data
.
result
[
i
].
md5
+
'
" title="
'
+
data
.
result
[
i
].
title
+
'
" rel="
'
+
data
.
result
[
i
].
path
+
'
">
'
+
data
.
result
[
i
].
title
+
'
</option>
'
);
}
if
(
data
.
result
.
length
<
1
)
{
$
(
"
#softwarelist
"
).
append
(
'
<option>No Software Release found</option>
'
);
$
(
'
#fileTree
'
).
empty
();
}
fillContent
();
$
(
"
#error
"
).
Popup
(
"
Operation complete, Selected Software Release has been delete!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
});
}
send
=
false
;
}
});
return
false
;
});
function
setupEditor
()
{
editor
=
ace
.
edit
(
"
editor
"
);
editor
.
setTheme
(
"
ace/theme/crimson_editor
"
);
var
CurentMode
=
require
(
"
ace/mode/text
"
).
Mode
;
editor
.
getSession
().
setMode
(
new
CurentMode
());
editor
.
getSession
().
setTabSize
(
2
);
editor
.
getSession
().
setUseSoftTabs
(
true
);
editor
.
renderer
.
setHScrollBarAlwaysVisible
(
false
);
editor
.
setReadOnly
(
true
);
}
});
slapos/runner/templates/layout.html
View file @
a591c3f3
...
...
@@ -98,7 +98,6 @@
<li><a
href=
"{{ url_for('runInstanceProfile') }}"
id=
"instrun"
>
Redeploy Services
</a></li>
<li
class=
'sep'
></li>
<li><a
href=
"{{ url_for('browseWorkspace') }}"
>
Browse Workspace
</a></li>
<li><a
href=
"{{ url_for('inspectSoftware') }}"
>
My Software Releases
</a></li>
</ul>
</li>
<li
class=
'right_menu slapos_run'
id=
"softrun"
><a
href=
"{{ url_for('runSoftwareProfile') }}"
></a>
...
...
slapos/runner/templates/runResult.html
deleted
100644 → 0
View file @
462713da
{% extends "layout.html" %}
{% block title %}Webrunner software Inspection{% endblock %}
{% block head %}
{{ super() }}
<script
src=
"{{ url_for('static', filename='js/scripts/inspectSoftware.js') }}"
type=
"application/javascript"
charset=
"utf-8"
></script>
<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/jquery.colorbox-min.js') }}"
type=
"application/javascript"
charset=
"utf-8"
></script>
<link
href=
"{{ url_for('static', filename='css/gsFileManager.css', _external=False) }}"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<script
src=
"{{ url_for('static', filename='js/jquery/gsFileManager.js') }}"
type=
"application/javascript"
charset=
"utf-8"
></script>
{% endblock %}
{% block body %}
<input
type=
"hidden"
name=
"runnerdir"
id=
"runnerdir"
value=
"{{softwareRoot}}"
/>
<label
for=
'softwarelist'
class=
'header'
>
Inspect software release
</label>
<select
name=
"softwarelist"
id=
"softwarelist"
>
{%if not softwares %}
<option
>
No Software Release found
</option>
{% endif %}
{%for soft in softwares %}
<option
value=
"{{soft['md5']}}"
title=
"{{soft['title']}}"
rel=
"{{soft['path']}}"
>
{{soft['title']}}
</option>
{%endfor%}
</select>
<button
id =
"delete"
class=
"button"
title=
"Remove this software"
>
Remove
</button>
<button
id =
"open"
class=
"button"
title=
"Set this software as current software release"
>
Open
</button>
<br/><br/>
<div
id=
"fileNavigator"
></div>
<br/>
<a
href=
"#"
id=
"reloadfiles"
class=
"lshare simple"
>
Reload Files
</a>
<br/>
{% endblock %}
slapos/runner/views.py
View file @
a591c3f3
...
...
@@ -29,7 +29,7 @@ from slapos.runner.utils import (checkSoftwareFolder, checkUserCredential,
loadSoftwareRList
,
md5sum
,
newSoftware
,
readFileFrom
,
readParameters
,
realpath
,
removeCurrentInstance
,
r
emoveSoftwareByName
,
r
unSlapgridUntilSuccess
,
runSlapgridUntilSuccess
,
saveBuildAndRunParams
,
setMiniShellHistory
,
stopProxy
,
...
...
@@ -143,24 +143,6 @@ def editSoftwareProfile():
profile
=
profile
,
projectList
=
listFolder
(
app
.
config
,
'workspace'
))
def
inspectSoftware
():
return
render_template
(
'runResult.html'
,
softwareRoot
=
'software_link/'
,
softwares
=
loadSoftwareRList
(
app
.
config
))
#remove content of compiled software release
def
removeSoftware
():
if
isSoftwareRunning
(
app
.
config
)
or
isInstanceRunning
(
app
.
config
):
flash
(
'Software installation or instantiation in progress, cannot remove'
)
elif
os
.
path
.
exists
(
app
.
config
[
'software_root'
]):
svcStopAll
(
app
.
config
)
shutil
.
rmtree
(
app
.
config
[
'software_root'
])
for
link
in
os
.
listdir
(
app
.
config
[
'software_link'
]):
os
.
remove
(
os
.
path
.
join
(
app
.
config
[
'software_link'
],
link
))
flash
(
'Software removed'
)
return
redirect
(
url_for
(
'inspectSoftware'
))
def
runSoftwareProfile
():
_thread
.
start_new_thread
(
runSlapgridUntilSuccess
,
(
app
.
config
,
"software"
,
True
))
...
...
@@ -402,12 +384,6 @@ def removeFile():
return
jsonify
(
code
=
0
,
result
=
str
(
e
))
def
removeSoftwareDir
():
status
,
message
=
removeSoftwareByName
(
app
.
config
,
request
.
form
[
'md5'
],
request
.
form
[
'title'
])
return
jsonify
(
code
=
status
,
result
=
message
)
#read file and return content to ajax
def
getFileContent
():
file_path
=
realpath
(
app
.
config
,
request
.
form
[
'file'
])
...
...
@@ -846,8 +822,6 @@ app.add_url_rule('/', 'home', home)
app
.
add_url_rule
(
'/browseWorkspace'
,
'browseWorkspace'
,
browseWorkspace
)
app
.
add_url_rule
(
'/editSoftwareProfile'
,
'editSoftwareProfile'
,
editSoftwareProfile
)
app
.
add_url_rule
(
'/inspectSoftware'
,
'inspectSoftware'
,
inspectSoftware
)
app
.
add_url_rule
(
'/removeSoftware'
,
'removeSoftware'
,
removeSoftware
)
app
.
add_url_rule
(
'/runSoftwareProfile'
,
'runSoftwareProfile'
,
runSoftwareProfile
,
methods
=
[
'GET'
,
'POST'
])
app
.
add_url_rule
(
'/editInstanceProfile'
,
'editInstanceProfile'
,
...
...
@@ -893,8 +867,6 @@ app.add_url_rule("/newBranch", 'newBranch', newBranch, methods=['POST'])
app
.
add_url_rule
(
"/changeBranch"
,
'changeBranch'
,
changeBranch
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/saveFileContent"
,
'saveFileContent'
,
saveFileContent
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/removeSoftwareDir"
,
'removeSoftwareDir'
,
removeSoftwareDir
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/getFileContent"
,
'getFileContent'
,
getFileContent
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/removeFile"
,
'removeFile'
,
removeFile
,
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