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
Joanne Hugé
slapos.toolbox
Commits
1650be7b
Commit
1650be7b
authored
Jul 17, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: get rid off bad use of tests on var in javascript
parent
48eeebec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
slapos/runner/static/js/scripts/process.js
slapos/runner/static/js/scripts/process.js
+11
-11
No files found.
slapos/runner/static/js/scripts/process.js
View file @
1650be7b
/*jslint undef: true */
/*global $, window, $SCRIPT_ROOT, setRunningState, setCookie, getCookie, deleteCookie */
/*global currentState: true, running: true, $current: true,
processType: true, currentProces
s: true */
/*global currentState: true, running: true, $current: true,
currentProcess: true, processType
s: true */
/*global sendStop: true, openedlogpage: true, logReadingPosition: true, speed: true */
/*global isRunning: true */
/* vim: set et sts=4: */
...
...
@@ -10,8 +10,8 @@
var
url
=
$SCRIPT_ROOT
+
"
/slapgridResult
"
;
var
currentState
=
false
;
var
running
=
true
;
var
processType
=
""
;
var
currentProcess
;
var
currentProcess
=
""
;
var
processTypes
=
{
instance
:
"
instance
"
,
software
:
"
software
"
}
;
var
sendStop
=
false
;
var
forcedStop
=
false
;
var
openedlogpage
=
""
;
//content software or instance if the current page is software or instance log, otherwise nothing
...
...
@@ -91,14 +91,14 @@ function getRunningState() {
run_success
=
0
,
param
=
{
position
:
logReadingPosition
,
log
:
(
openedlogpage
!==
""
)
?
processType
.
toLowerCase
()
:
""
log
:
(
openedlogpage
!==
""
)
?
currentProcess
:
""
},
jqxhr
=
$
.
post
(
url
,
param
,
function
(
data
)
{
running
=
data
.
result
;
if
(
data
.
instance
.
state
)
{
processType
=
"
Instance
"
;
currentProcess
=
processTypes
.
instance
;
}
else
if
(
data
.
software
.
state
)
{
processType
=
"
Software
"
;
currentProcess
=
processTypes
.
software
;
}
//show accurate right panel
if
(
running
)
{
...
...
@@ -108,7 +108,7 @@ function getRunningState() {
writeLogs
(
data
);
setRunningState
(
data
);
if
(
data
.
result
)
{
updateStatus
(
processType
.
toLowerCase
()
,
"
running
"
);
updateStatus
(
currentProcess
,
"
running
"
);
}
else
{
build_success
=
(
data
.
software
.
success
===
0
)?
"
terminated
"
:
"
failed
"
;
run_success
=
(
data
.
instance
.
success
===
0
)?
"
terminated
"
:
"
failed
"
;
...
...
@@ -131,7 +131,7 @@ function stopProcess() {
var
urlfor
=
$SCRIPT_ROOT
+
"
stopSlapgrid
"
,
type
=
"
slapgrid-sr
"
;
if
(
processType
===
"
Instance
"
)
{
if
(
currentProcess
===
processTypes
.
instance
)
{
type
=
"
slapgrid-cp
"
;
}
$
.
post
(
urlfor
,
{
type
:
type
},
function
(
data
)
{
...
...
@@ -229,13 +229,13 @@ function setRunningState(data) {
}
}
else
{
if
(
$
(
"
#running
"
).
is
(
"
:visible
"
)
)
{
$
(
"
#error
"
).
Popup
(
"
Slapgrid finished running your
"
+
processType
+
"
P
rofile
"
,
{
type
:
'
info
'
,
duration
:
3000
});
$
(
"
#error
"
).
Popup
(
"
Slapgrid finished running your
"
+
currentProcess
+
"
p
rofile
"
,
{
type
:
'
info
'
,
duration
:
3000
});
if
(
forcedStop
)
{
updateStatus
(
'
instance
'
,
'
stopped
'
);
updateStatus
(
'
software
'
,
'
stopped
'
);
}
else
{
updateStatus
(
processType
.
toLowerCase
()
,
'
terminated
'
);
updateStatus
(
currentProcess
,
'
terminated
'
);
}
//Update window!!!
$
(
"
#slapswitch
"
).
attr
(
'
rel
'
,
'
opend
'
);
...
...
@@ -256,7 +256,7 @@ function setRunningState(data) {
function
runProcess
(
urlfor
)
{
"
use strict
"
;
if
(
!
isRunning
())
{
currentProcess
=
$
.
post
(
urlfor
);
$
.
post
(
urlfor
);
if
(
$
(
"
#running_info
"
).
children
(
'
span
'
).
length
>
0
)
{
$
(
"
#running_info
"
).
children
(
'
p
'
).
remove
();
}
...
...
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