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
Boxiang Sun
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() {
...
@@ -10,8 +10,8 @@ $(document).ready( function() {
$
(
"
#slappart li
"
).
each
(
function
(){
$
(
"
#slappart li
"
).
each
(
function
(){
lastli
=
$
(
this
);
lastli
=
$
(
this
);
$
(
this
).
find
(
"
input:radio
"
).
change
(
function
(){
$
(
this
).
find
(
"
input:radio
"
).
change
(
function
(){
configRadio
();
configRadio
();
});
});
});
});
if
(
lastli
){
lastli
.
css
(
"
border-bottom
"
,
"
none
"
);}
if
(
lastli
){
lastli
.
css
(
"
border-bottom
"
,
"
none
"
);}
...
@@ -27,14 +27,14 @@ $(document).ready( function() {
...
@@ -27,14 +27,14 @@ $(document).ready( function() {
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
url
:
$SCRIPT_ROOT
+
'
/supervisordStatus
'
,
url
:
$SCRIPT_ROOT
+
'
/supervisordStatus
'
,
data
:
""
,
data
:
""
,
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#supervisordcontent
"
).
empty
();
$
(
"
#supervisordcontent
"
).
empty
();
$
(
"
#supervisordcontent
"
).
append
(
data
.
result
);
$
(
"
#supervisordcontent
"
).
append
(
data
.
result
);
}
}
$
(
"
#imgwaitting
"
).
fadeOut
();
$
(
"
#imgwaitting
"
).
fadeOut
();
}
}
});
});
return
false
;
return
false
;
});
});
...
@@ -57,21 +57,21 @@ $(document).ready( function() {
...
@@ -57,21 +57,21 @@ $(document).ready( function() {
return
false
;
return
false
;
});
});
$
(
"
#xmlview
"
).
click
(
function
(){
$
(
"
#xmlview
"
).
click
(
function
(){
var
content
=
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">
'
+
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>
'
;
'
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>
'
+
content
+=
'
<div class="main_content" style="height:230px"><pre id="editor"></pre></div>
'
+
'
<input type=submit value="Load" id="loadxml" class="button">
'
;
'
<input type=submit value="Load" id="loadxml" class="button">
'
;
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
url
:
$SCRIPT_ROOT
+
'
/getParameterXml/xml
'
,
url
:
$SCRIPT_ROOT
+
'
/getParameterXml/xml
'
,
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#inline_content
"
).
html
(
content
);
$
(
"
#inline_content
"
).
html
(
content
);
setupEditor
(
true
);
setupEditor
(
true
);
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
600px
"
,
height
:
"
410px
"
,
onComplete
:
function
(){
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
600px
"
,
height
:
"
410px
"
,
onComplete
:
function
(){
editor
.
getSession
().
setValue
(
data
.
result
);
editor
.
getSession
().
setValue
(
data
.
result
);
}});
}});
$
(
"
.inline
"
).
click
();
$
(
"
.inline
"
).
click
();
$
(
"
#loadxml
"
).
click
(
function
(){
$
(
"
#loadxml
"
).
click
(
function
(){
//Parse XML file
//Parse XML file
try
{
try
{
...
@@ -83,22 +83,22 @@ $(document).ready( function() {
...
@@ -83,22 +83,22 @@ $(document).ready( function() {
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
software_type
:
""
,
parameter
:
editor
.
getSession
().
getValue
()},
data
:
{
software_type
:
""
,
parameter
:
editor
.
getSession
().
getValue
()},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
location
.
href
=
$SCRIPT_ROOT
+
'
/inspectInstance#tab3
'
;
location
.
href
=
$SCRIPT_ROOT
+
'
/inspectInstance#tab3
'
;
location
.
reload
();
location
.
reload
();
}
}
else
{
$
(
"
p#xmllog
"
).
html
(
data
.
result
);}
else
{
$
(
"
p#xmllog
"
).
html
(
data
.
result
);}
}
}
});
});
return
false
;
return
false
;
});
});
}
}
else
{
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
});
});
});
//Load previous instance parameters
//Load previous instance parameters
...
@@ -123,14 +123,14 @@ $(document).ready( function() {
...
@@ -123,14 +123,14 @@ $(document).ready( function() {
collapseSpeed
:
750
,
multiFolder
:
false
,
selectFolder
:
false
},
function
(
file
)
{
collapseSpeed
:
750
,
multiFolder
:
false
,
selectFolder
:
false
},
function
(
file
)
{
},
function
(
file
){
},
function
(
file
){
//User have double click on file in to the fileTree
//User have double click on file in to the fileTree
viewFile
(
file
);
viewFile
(
file
);
});
});
}
}
function
viewFile
(
file
){
function
viewFile
(
file
){
//User have double click on file in to the fileTree
//User have double click on file in to the fileTree
loadFileContent
(
file
);
loadFileContent
(
file
);
}
}
$
(
"
#parameter
"
).
load
(
$SCRIPT_ROOT
+
'
/getParameterXml
'
);
$
(
"
#parameter
"
).
load
(
$SCRIPT_ROOT
+
'
/getParameterXml
'
);
$
(
"
#update
"
).
click
(
function
(){
$
(
"
#update
"
).
click
(
function
(){
...
@@ -139,58 +139,58 @@ $(document).ready( function() {
...
@@ -139,58 +139,58 @@ $(document).ready( function() {
}
}
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
parameter
:
$
(
"
#parameter
"
).
val
().
trim
()},
data
:
{
parameter
:
$
(
"
#parameter
"
).
val
().
trim
()},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#error
"
).
Popup
(
"
Instance parameters updated!
"
,
{
type
:
'
info
'
,
duration
:
3000
});
$
(
"
#error
"
).
Popup
(
"
Instance parameters updated!
"
,
{
type
:
'
info
'
,
duration
:
3000
});
}
}
else
{
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
});
});
});
function
loadFileContent
(
file
){
function
loadFileContent
(
file
){
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/checkFileType
'
,
url
:
$SCRIPT_ROOT
+
'
/checkFileType
'
,
data
:
"
path=
"
+
file
,
data
:
"
path=
"
+
file
,
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
if
(
data
.
result
==
"
text
"
){
if
(
data
.
result
==
"
text
"
){
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/getFileContent
'
,
url
:
$SCRIPT_ROOT
+
'
/getFileContent
'
,
data
:
{
file
:
file
,
truncate
:
1500
},
data
:
{
file
:
file
,
truncate
:
1500
},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
empty
();
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Instance Content:
'
+
$
(
"
#inline_content
"
).
append
(
'
<h2 style="color: #4c6172; font: 18px
\'
Helvetica Neue
\'
, Helvetica, Arial, sans-serif;">Inspect Instance Content:
'
+
file
+
'
</h2>
'
);
file
+
'
</h2>
'
);
$
(
"
#inline_content
"
).
append
(
'
<br/><div class="main_content"><pre id="editor"></pre></div>
'
);
$
(
"
#inline_content
"
).
append
(
'
<br/><div class="main_content"><pre id="editor"></pre></div>
'
);
setupEditor
();
setupEditor
();
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
847px
"
,
onComplete
:
function
(){
$
(
"
.inline
"
).
colorbox
({
inline
:
true
,
width
:
"
847px
"
,
onComplete
:
function
(){
editor
.
getSession
().
setValue
(
data
.
result
);
editor
.
getSession
().
setValue
(
data
.
result
);
}});
}});
$
(
"
.inline
"
).
click
();
$
(
"
.inline
"
).
click
();
}
}
else
{
else
{
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
"
Can not load your file, please make sure that you have selected a Software Release
"
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
}
}
});
});
}
}
else
{
else
{
//Can not displays binary file
//Can not displays binary file
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
}
}
else
{
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
alert
'
,
duration
:
5000
});
}
}
}
}
});
});
}
}
function
updateParameter
(){
function
updateParameter
(){
...
@@ -210,16 +210,16 @@ $(document).ready( function() {
...
@@ -210,16 +210,16 @@ $(document).ready( function() {
xml
+=
'
</instance>
\n
'
;
xml
+=
'
</instance>
\n
'
;
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
url
:
$SCRIPT_ROOT
+
'
/saveParameterXml
'
,
data
:
{
software_type
:
software_type
,
parameter
:
xml
},
data
:
{
software_type
:
software_type
,
parameter
:
xml
},
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
$
(
"
#error
"
).
Popup
(
"
Instance parameters has been updated, please run your instance now!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
"
Instance parameters has been updated, please run your instance now!
"
,
{
type
:
'
confirm
'
,
duration
:
5000
});
}
}
else
{
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
});
}
}
function
setupTextarea
(
$txt
){
function
setupTextarea
(
$txt
){
...
@@ -240,8 +240,8 @@ $(document).ready( function() {
...
@@ -240,8 +240,8 @@ $(document).ready( function() {
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
url
:
$SCRIPT_ROOT
+
'
/getParameterXml/dict
'
,
url
:
$SCRIPT_ROOT
+
'
/getParameterXml/dict
'
,
success
:
function
(
data
){
success
:
function
(
data
){
if
(
data
.
code
==
1
){
if
(
data
.
code
==
1
){
var
dict
=
data
.
result
[
'
instance
'
];
var
dict
=
data
.
result
[
'
instance
'
];
for
(
propertie
in
dict
){
for
(
propertie
in
dict
){
$
(
"
#add_attribute
"
).
click
();
$
(
"
#add_attribute
"
).
click
();
...
@@ -250,29 +250,29 @@ $(document).ready( function() {
...
@@ -250,29 +250,29 @@ $(document).ready( function() {
$
(
"
textarea#value_
"
+
size
).
val
(
dict
[
propertie
]);
$
(
"
textarea#value_
"
+
size
).
val
(
dict
[
propertie
]);
$
(
"
textarea#value_
"
+
size
).
keyup
();
$
(
"
textarea#value_
"
+
size
).
keyup
();
}
}
}
}
else
{
else
{
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
$
(
"
#error
"
).
Popup
(
data
.
result
,
{
type
:
'
error
'
,
duration
:
5000
});
}
}
}
}
});
});
}
}
function
configRadio
(){
function
configRadio
(){
$
(
"
#slappart li
"
).
each
(
function
()
{
$
(
"
#slappart li
"
).
each
(
function
()
{
var
$radio
=
$
(
this
).
find
(
"
input:radio
"
);
var
$radio
=
$
(
this
).
find
(
"
input:radio
"
);
var
boxselector
=
"
#box
"
+
$radio
.
attr
(
'
id
'
);
var
boxselector
=
"
#box
"
+
$radio
.
attr
(
'
id
'
);
if
(
$
(
this
).
hasClass
(
'
checked
'
)){
if
(
$
(
this
).
hasClass
(
'
checked
'
)){
$
(
this
).
removeClass
(
'
checked
'
);
$
(
this
).
removeClass
(
'
checked
'
);
$
(
boxselector
).
slideUp
(
"
normal
"
);
$
(
boxselector
).
slideUp
(
"
normal
"
);
}
}
if
(
$radio
.
is
(
'
:checked
'
)){
if
(
$radio
.
is
(
'
:checked
'
)){
$
(
this
).
addClass
(
'
checked
'
);
$
(
this
).
addClass
(
'
checked
'
);
//change content here
//change content here
$
(
boxselector
).
slideDown
(
"
normal
"
);
$
(
boxselector
).
slideDown
(
"
normal
"
);
}
}
});
});
}
}
function
setupBox
(){
function
setupBox
(){
var
state
=
$
(
"
#softwareType
"
).
css
(
"
display
"
);
var
state
=
$
(
"
#softwareType
"
).
css
(
"
display
"
);
if
(
state
==
"
none
"
){
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