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
Kirill Smelkov
slapos.toolbox
Commits
f021766e
Commit
f021766e
authored
Mar 29, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slaprunner-stable'
parents
c6aeb904
3902b5aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
9 deletions
+35
-9
slapos/runner/static/css/styles.css
slapos/runner/static/css/styles.css
+1
-0
slapos/runner/static/js/scripts/inspectInstance.js
slapos/runner/static/js/scripts/inspectInstance.js
+13
-0
slapos/runner/static/js/scripts/process.js
slapos/runner/static/js/scripts/process.js
+1
-1
slapos/runner/templates/layout.html
slapos/runner/templates/layout.html
+1
-1
slapos/runner/utils.py
slapos/runner/utils.py
+10
-7
slapos/runner/views.py
slapos/runner/views.py
+9
-0
No files found.
slapos/runner/static/css/styles.css
View file @
f021766e
...
@@ -502,6 +502,7 @@ h2.hight:hover{
...
@@ -502,6 +502,7 @@ h2.hight:hover{
width
:
926px
;
width
:
926px
;
padding
:
2px
;
padding
:
2px
;
height
:
450px
;
height
:
450px
;
resize
:
both
;
font-size
:
13px
;
font-size
:
13px
;
overflow-y
:
auto
;
overflow-y
:
auto
;
white-space
:
pre-wrap
;
white-space
:
pre-wrap
;
...
...
slapos/runner/static/js/scripts/inspectInstance.js
View file @
f021766e
...
@@ -124,6 +124,18 @@ $(document).ready(function () {
...
@@ -124,6 +124,18 @@ $(document).ready(function () {
}
}
}
}
function
loadSoftwareType
()
{
$
.
ajax
({
type
:
'
GET
'
,
url
:
$SCRIPT_ROOT
+
'
/getSoftwareType
'
,
success
:
function
updateSoftwareType
(
data
)
{
if
(
data
.
code
===
1
&&
data
.
result
)
{
$
(
"
#software_type
"
).
val
(
data
.
result
);
}
}
});
}
function
loadParameter
()
{
function
loadParameter
()
{
$
.
ajax
({
$
.
ajax
({
type
:
'
GET
'
,
type
:
'
GET
'
,
...
@@ -267,6 +279,7 @@ $(document).ready(function () {
...
@@ -267,6 +279,7 @@ $(document).ready(function () {
});
});
//Load previous instance parameters
//Load previous instance parameters
loadParameter
();
loadParameter
();
loadSoftwareType
();
$
(
'
a#parameterTab
'
).
click
(
function
()
{
$
(
'
a#parameterTab
'
).
click
(
function
()
{
var
i
,
var
i
,
size
=
$
(
'
#partitionParameter > tbody > tr
'
).
length
;
size
=
$
(
'
#partitionParameter > tbody > tr
'
).
length
;
...
...
slapos/runner/static/js/scripts/process.js
View file @
f021766e
...
@@ -23,7 +23,7 @@ var currentLogSize = 0; //Define the size of log actually displayed
...
@@ -23,7 +23,7 @@ var currentLogSize = 0; //Define the size of log actually displayed
var
isRunning
=
function
()
{
var
isRunning
=
function
()
{
"
use strict
"
;
"
use strict
"
;
if
(
running
)
{
if
(
running
)
{
$
(
"
#error
"
).
Popup
(
"
Slapgrid is currently
under execution
!
"
,
$
(
"
#error
"
).
Popup
(
"
Slapgrid is currently
running
!
"
,
{
type
:
'
alert
'
,
duration
:
3000
});
{
type
:
'
alert
'
,
duration
:
3000
});
}
}
return
running
;
return
running
;
...
...
slapos/runner/templates/layout.html
View file @
f021766e
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
</div>
</div>
{% if request.path != '/login' %}
{% if request.path != '/login' %}
<div
id=
"footer"
>
<div
id=
"footer"
>
SlapOS web runner
©
Vifib SARL 2011
- All right reserved - Creative Commons Shared Alike Non Commercial
SlapOS web runner
©
Vifib SARL 2011
, 2012, 2013 - All right reserved - Creative Commons Shared Alike
</div>
</div>
{%endif%}
{%endif%}
</div>
</div>
...
...
slapos/runner/utils.py
View file @
f021766e
...
@@ -19,9 +19,6 @@ from flask import jsonify
...
@@ -19,9 +19,6 @@ from flask import jsonify
import
slapos.slap
import
slapos.slap
# Global variable
global_software_type
=
'default'
# Setup default flask (werkzeug) parser
# Setup default flask (werkzeug) parser
logger
=
logging
.
getLogger
(
'werkzeug'
)
logger
=
logging
.
getLogger
(
'werkzeug'
)
...
@@ -107,9 +104,14 @@ def requestInstance(config, software_type=None):
...
@@ -107,9 +104,14 @@ def requestInstance(config, software_type=None):
"""
"""
Request the main instance of our environment
Request the main instance of our environment
"""
"""
software_type_path
=
os
.
path
.
join
(
config
[
'etc_dir'
],
".software_type.xml"
)
if
software_type
:
if
software_type
:
global
global_software_type
# Write it to conf file for later use
global_software_type
=
software_type
open
(
software_type_path
,
'w'
).
write
(
software_type
)
elif
os
.
path
.
exists
(
software_type_path
):
software_type
=
open
(
software_type_path
,
'r'
).
read
()
else
:
software_type
=
'default'
slap
=
slapos
.
slap
.
slap
()
slap
=
slapos
.
slap
.
slap
()
profile
=
getCurrentSoftwareReleaseProfile
(
config
)
profile
=
getCurrentSoftwareReleaseProfile
(
config
)
...
@@ -125,7 +127,7 @@ def requestInstance(config, software_type=None):
...
@@ -125,7 +127,7 @@ def requestInstance(config, software_type=None):
profile
,
profile
,
partition_reference
=
getSoftwareReleaseName
(
config
),
partition_reference
=
getSoftwareReleaseName
(
config
),
partition_parameter_kw
=
partition_parameter_kw
,
partition_parameter_kw
=
partition_parameter_kw
,
software_type
=
global_
software_type
,
software_type
=
software_type
,
filter_kw
=
None
,
filter_kw
=
None
,
state
=
None
,
state
=
None
,
shared
=
False
)
shared
=
False
)
...
@@ -186,7 +188,8 @@ def startProxy(config):
...
@@ -186,7 +188,8 @@ def startProxy(config):
log
=
os
.
path
.
join
(
config
[
'log_dir'
],
'slapproxy.log'
)
log
=
os
.
path
.
join
(
config
[
'log_dir'
],
'slapproxy.log'
)
Popen
([
config
[
'slapproxy'
],
'--log_file'
,
log
,
Popen
([
config
[
'slapproxy'
],
'--log_file'
,
log
,
config
[
'configuration_file_path'
]],
config
[
'configuration_file_path'
]],
name
=
'slapproxy'
)
name
=
'slapproxy'
,
stdout
=
None
)
time
.
sleep
(
4
)
time
.
sleep
(
4
)
...
...
slapos/runner/views.py
View file @
f021766e
...
@@ -497,6 +497,13 @@ def saveParameterXml():
...
@@ -497,6 +497,13 @@ def saveParameterXml():
result
=
"An error occurred while applying your settings!<br/>"
+
str
(
e
))
result
=
"An error occurred while applying your settings!<br/>"
+
str
(
e
))
return
jsonify
(
code
=
1
,
result
=
""
)
return
jsonify
(
code
=
1
,
result
=
""
)
@
login_required
()
def
getSoftwareType
():
software_type_path
=
os
.
path
.
join
(
app
.
config
[
'etc_dir'
],
".software_type.xml"
)
if
os
.
path
.
exists
(
software_type_path
):
return
jsonify
(
code
=
1
,
result
=
open
(
software_type_path
,
'r'
).
read
())
return
jsonify
(
code
=
1
,
result
=
"default"
)
#read instance parameters into the local xml file and return a dict
#read instance parameters into the local xml file and return a dict
@
login_required
()
@
login_required
()
def
getParameterXml
(
request
):
def
getParameterXml
(
request
):
...
@@ -656,6 +663,8 @@ app.add_url_rule('/startStopProccess/name/<process>/cmd/<action>',
...
@@ -656,6 +663,8 @@ app.add_url_rule('/startStopProccess/name/<process>/cmd/<action>',
'startStopProccess'
,
startStopProccess
,
methods
=
[
'GET'
])
'startStopProccess'
,
startStopProccess
,
methods
=
[
'GET'
])
app
.
add_url_rule
(
"/getParameterXml/<request>"
,
'getParameterXml'
,
app
.
add_url_rule
(
"/getParameterXml/<request>"
,
'getParameterXml'
,
getParameterXml
,
methods
=
[
'GET'
])
getParameterXml
,
methods
=
[
'GET'
])
app
.
add_url_rule
(
'/getSoftwareType'
,
'getSoftwareType'
,
getSoftwareType
,
methods
=
[
'GET'
])
app
.
add_url_rule
(
"/stopSlapgrid"
,
'stopSlapgrid'
,
stopSlapgrid
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/stopSlapgrid"
,
'stopSlapgrid'
,
stopSlapgrid
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/slapgridResult"
,
'slapgridResult'
,
app
.
add_url_rule
(
"/slapgridResult"
,
'slapgridResult'
,
slapgridResult
,
methods
=
[
'POST'
])
slapgridResult
,
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