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
Tristan Cavelier
slapos.toolbox
Commits
90b94df2
Commit
90b94df2
authored
Sep 27, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't EVER mix spaces and tabs (bis).
parent
7b05db94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
91 deletions
+91
-91
slapos/runner/static/js/scripts/inspectInstance.js
slapos/runner/static/js/scripts/inspectInstance.js
+91
-91
No files found.
slapos/runner/static/js/scripts/inspectInstance.js
View file @
90b94df2
...
...
@@ -10,8 +10,8 @@ $(document).ready( function() {
$
(
"
#slappart li
"
).
each
(
function
(){
lastli
=
$
(
this
);
$
(
this
).
find
(
"
input:radio
"
).
change
(
function
(){
configRadio
();
});
configRadio
();
});
});
if
(
lastli
){
lastli
.
css
(
"
border-bottom
"
,
"
none
"
);}
...
...
@@ -27,14 +27,14 @@ $(document).ready( function() {
$
.
ajax
({
type
:
"
GET
"
,
url
:
$SCRIPT_ROOT
+
'
/supervisordStatus
'
,
data
:
""
,
success
:
function
(
data
){
data
:
""
,
success
:
function
(
data
){
if
(
data
.
code
==
1
){
$
(
"
#supervisordcontent
"
).
empty
();
$
(
"
#supervisordcontent
"
).
append
(
data
.
result
);
}
$
(
"
#imgwaitting
"
).
fadeOut
();
}
}
});
return
false
;
});
...
...
@@ -57,21 +57,21 @@ $(document).ready( function() {
return
false
;
});
$
(
"
#xmlview
"
).
click
(
function
(){
var
content
=
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">
'
+
'
INSTANCE PARAMETERS: Load XML file</h2><p id="xmllog" class="message"><br/></p>
'
;
content
+=
'
<div class="main_content" style="height:230px"><pre id="editor"></pre></div>
'
+
var
content
=
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">
'
+
'
INSTANCE PARAMETERS: Load XML file</h2><p id="xmllog" class="message"><br/></p>
'
;
content
+=
'
<div class="main_content" style="height:230px"><pre id="editor"></pre></div>
'
+
'
<input type=submit value="Load" id="loadxml" class="button">
'
;
$
.
ajax
({
type
:
"
GET
"
,
url
:
$SCRIPT_ROOT
+
'
/getParameterXml/xml
'
,
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#inline_content
"
).
html
(
content
);
setupEditor
(
true
);
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
600px
"
,
height
:
"
410px
"
,
onComplete
:
function
(){
setupEditor
(
true
);
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
600px
"
,
height
:
"
410px
"
,
onComplete
:
function
(){
editor
.
getSession
().
setValue
(
data
.
result
);
}});
$
(
"
.inline
"
).
click
();
}});
$
(
"
.inline
"
).
click
();
$
(
"
#loadxml
"
).
click
(
function
(){
//Parse XML file
try
{
...
...
@@ -83,22 +83,22 @@ $(document).ready( function() {
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
software_type
:
""
,
parameter
:
editor
.
getSession
().
getValue
()},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
data
:
{
software_type
:
""
,
parameter
:
editor
.
getSession
().
getValue
()},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
location
.
href
=
$SCRIPT_ROOT
+
'
/inspectInstance#tab3
'
;
location
.
reload
();
}
}
else
{
$
(
"
p#xmllog
"
).
html
(
data
.
result
);}
}
}
});
return
false
;
});
}
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
});
//Load previous instance parameters
...
...
@@ -123,14 +123,14 @@ $(document).ready( function() {
collapseSpeed
:
750
,
multiFolder
:
false
,
selectFolder
:
false
},
function
(
file
)
{
},
function
(
file
){
//User have double click on file in to the fileTree
viewFile
(
file
);
//User have double click on file in to the fileTree
viewFile
(
file
);
});
}
function
viewFile
(
file
){
//User have double click on file in to the fileTree
loadFileContent
(
file
);
//User have double click on file in to the fileTree
loadFileContent
(
file
);
}
$
(
"
#parameter
"
).
load
(
$SCRIPT_ROOT
+
'
/getParameterXml
'
);
$
(
"
#update
"
).
click
(
function
(){
...
...
@@ -139,58 +139,58 @@ $(document).ready( function() {
}
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
parameter
:
$
(
"
#parameter
"
).
val
().
trim
()},
success
:
function
(
data
){
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
parameter
:
$
(
"
#parameter
"
).
val
().
trim
()},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
$
(
"
#error
"
).
Popup
(
"
Instance parameters updated!
"
,
{
type
:
'
info
'
,
duration
:
3000
});
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
});
});
function
loadFileContent
(
file
){
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/checkFileType
'
,
data
:
"
path=
"
+
file
,
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
result
==
"
text
"
){
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/getFileContent
'
,
data
:
{
file
:
file
,
truncate
:
1500
},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Instance Content:
'
+
file
+
'
</h2>
'
);
$
(
"
#inline_content
"
).
append
(
'
<br/><div class="main_content"><pre id="editor"></pre></div>
'
);
setupEditor
();
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
847px
"
,
onComplete
:
function
(){
editor
.
getSession
().
setValue
(
data
.
result
);
}});
$
(
"
.inline
"
).
click
();
}
else
{
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
});
}
else
{
//Can not displays binary file
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/checkFileType
'
,
data
:
"
path=
"
+
file
,
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
result
==
"
text
"
){
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/getFileContent
'
,
data
:
{
file
:
file
,
truncate
:
1500
},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Instance Content:
'
+
file
+
'
</h2>
'
);
$
(
"
#inline_content
"
).
append
(
'
<br/><div class="main_content"><pre id="editor"></pre></div>
'
);
setupEditor
();
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
847px
"
,
onComplete
:
function
(){
editor
.
getSession
().
setValue
(
data
.
result
);
}});
$
(
"
.inline
"
).
click
();
}
else
{
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
});
}
else
{
//Can not displays binary file
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
});
}
function
updateParameter
(){
...
...
@@ -210,16 +210,16 @@ $(document).ready( function() {
xml
+=
'
</instance>
\n
'
;
$
.
ajax
({
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
software_type
:
software_type
,
parameter
:
xml
},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
software_type
:
software_type
,
parameter
:
xml
},
success
:
function
(
data
){
if
(
data
.
code
==
1
){
$
(
"
#error
"
).
Popup
(
"
Instance parameters has been updated, please run your instance now!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
}
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
}
function
setupTextarea
(
$txt
){
...
...
@@ -240,8 +240,8 @@ $(document).ready( function() {
$
.
ajax
({
type
:
"
GET
"
,
url
:
$SCRIPT_ROOT
+
'
/getParameterXml/dict
'
,
success
:
function
(
data
){
if
(
data
.
code
==
1
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
var
dict
=
data
.
result
[
'
instance
'
];
for
(
propertie
in
dict
){
$
(
"
#add_attribute
"
).
click
();
...
...
@@ -250,29 +250,29 @@ $(document).ready( function() {
$
(
"
textarea#value_
"
+
size
).
val
(
dict
[
propertie
]);
$
(
"
textarea#value_
"
+
size
).
keyup
();
}
}
}
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
}
function
configRadio
(){
$
(
"
#slappart li
"
).
each
(
function
()
{
$
(
"
#slappart li
"
).
each
(
function
()
{
var
$radio
=
$
(
this
).
find
(
"
input:radio
"
);
var
boxselector
=
"
#box
"
+
$radio
.
attr
(
'
id
'
);
if
(
$
(
this
).
hasClass
(
'
checked
'
)){
$
(
this
).
removeClass
(
'
checked
'
);
$
(
boxselector
).
slideUp
(
"
normal
"
);
}
if
(
$radio
.
is
(
'
:checked
'
)){
$
(
this
).
addClass
(
'
checked
'
);
//change content here
$
(
boxselector
).
slideDown
(
"
normal
"
);
var
boxselector
=
"
#box
"
+
$radio
.
attr
(
'
id
'
);
if
(
$
(
this
).
hasClass
(
'
checked
'
)){
$
(
this
).
removeClass
(
'
checked
'
);
$
(
boxselector
).
slideUp
(
"
normal
"
);
}
if
(
$radio
.
is
(
'
:checked
'
)){
$
(
this
).
addClass
(
'
checked
'
);
//change content here
$
(
boxselector
).
slideDown
(
"
normal
"
);
}
});
}
}
});
}
function
setupBox
(){
var
state
=
$
(
"
#softwareType
"
).
css
(
"
display
"
);
if
(
state
==
"
none
"
){
...
...
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