Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
e4c1e419
Commit
e4c1e419
authored
Sep 14, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display the computer status in the computer listbox
parent
1973b8e0
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
758 additions
and
28 deletions
+758
-28
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Base_getVifibOverview.xml
...Item/portal_skins/vifib_hosting/Base_getVifibOverview.xml
+1
-1
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_getMyServersRenderJS.xml
...l_skins/vifib_hosting/WebSection_getMyServersRenderJS.xml
+80
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender.xml
...al_skins/vifib_hosting/WebSection_viewMyServersRender.xml
+4
-1
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender/listbox.xml
.../vifib_hosting/WebSection_viewMyServersRender/listbox.xml
+16
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender/listbox_monitoring_status.xml
...Section_viewMyServersRender/listbox_monitoring_status.xml
+311
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender/your_monitoring_status.xml
...WebSection_viewMyServersRender/your_monitoring_status.xml
+307
-0
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/vifib_hosting_js/vifib_monitoring.js.xml
...ib_hosting_theme/vifib_hosting_js/vifib_monitoring.js.xml
+24
-17
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/vifib_hosting_style/hosting-design.css.xml
..._hosting_theme/vifib_hosting_style/hosting-design.css.xml
+14
-8
master/bt5/vifib_web/bt/revision
master/bt5/vifib_web/bt/revision
+1
-1
No files found.
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Base_getVifibOverview.xml
View file @
e4c1e419
...
@@ -59,7 +59,7 @@ return """\n
...
@@ -59,7 +59,7 @@ return """\n
<script>
\n
<script>
\n
$(document).ready(function () {\n
$(document).ready(function () {\n
$("ul#vifib_monitoring")\n
$("ul#vifib_monitoring")\n
.vifibmonitoring("%s");\n
.vifibmonitoring("
fill_list", "
%s");\n
});\n
});\n
</script>
\n
</script>
\n
""" % tool.absolute_url()\n
""" % tool.absolute_url()\n
...
...
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_getMyServersRenderJS.xml
0 → 100644
View file @
e4c1e419
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
tool = context.getPortalObject().portal_vifib_rest_api\n
return """\n
<script>
\n
$(document).ready(function () {\n
$(".monitoring_to_check").each(function() {\n
$(this).vifibmonitoring("check_status", "%s", $(this).attr("data-relative-url"));\n
});\n
});\n
</script>
\n
""" % tool.absolute_url()\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_getMyServersRenderJS
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender.xml
View file @
e4c1e419
...
@@ -86,7 +86,9 @@
...
@@ -86,7 +86,9 @@
<item>
<item>
<key>
<string>
hidden
</string>
</key>
<key>
<string>
hidden
</string>
</key>
<value>
<value>
<list/>
<list>
<string>
listbox_monitoring_status
</string>
</list>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -98,6 +100,7 @@
...
@@ -98,6 +100,7 @@
<string>
new_server_button
</string>
<string>
new_server_button
</string>
<string>
listbox
</string>
<string>
listbox
</string>
<string>
last_event_listbox
</string>
<string>
last_event_listbox
</string>
<string>
your_monitoring_status
</string>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender/listbox.xml
View file @
e4c1e419
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<value>
<value>
<list>
<list>
<string>
columns
</string>
<string>
columns
</string>
<string>
editable_columns
</string>
<string>
list_method
</string>
<string>
list_method
</string>
<string>
portal_types
</string>
<string>
portal_types
</string>
<string>
search
</string>
<string>
search
</string>
...
@@ -93,6 +94,10 @@
...
@@ -93,6 +94,10 @@
<key>
<string>
columns
</string>
</key>
<key>
<string>
columns
</string>
</key>
<value>
<value>
<list>
<list>
<tuple>
<string>
monitoring_status
</string>
<string>
Status
</string>
</tuple>
<tuple>
<tuple>
<string>
title
</string>
<string>
title
</string>
<string>
Title
</string>
<string>
Title
</string>
...
@@ -108,6 +113,17 @@
...
@@ -108,6 +113,17 @@
</list>
</list>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
editable_columns
</string>
</key>
<value>
<list>
<tuple>
<string>
monitoring_status
</string>
<string>
Status
</string>
</tuple>
</list>
</value>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_list_mode_listbox
</string>
</value>
<value>
<string>
my_list_mode_listbox
</string>
</value>
...
...
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender/listbox_monitoring_status.xml
0 → 100644
View file @
e4c1e419
This diff is collapsed.
Click to expand it.
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyServersRender/your_monitoring_status.xml
0 → 100644
View file @
e4c1e419
This diff is collapsed.
Click to expand it.
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/vifib_hosting_js/vifib_monitoring.js.xml
View file @
e4c1e419
...
@@ -114,15 +114,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
...
@@ -114,15 +114,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
if (/#ok/.test(data.text)
&
/computer_module/.test(data[\'@document\'])
&
(now - created_at
< 300000
))
{\n
if (/#ok/.test(data.text)
&
/computer_module/.test(data[\'@document\'])
&
(now - created_at
< 300000
))
{\n
$(this).attr("class",
"monitoring_ok")\n
$(this).attr("class",
"monitoring_ok")\n
.attr("title",
data.text
+
"
("
+
created_at
+
")"
)\n
.attr("title",
data.text
+
"
("
+
created_at
+
")"
)\n
.
html("<a
href=
\'"
+
data[\'@document\']
+
"\'
></a>
"
);\n
.
attr("href",
data[\'@document\']
);\n
}
else
if
(/#ok/.test(data.text)
&
/software_instance_module/.test(data[\'@document\'])
&
(now
-
created_at
<
86400000))
{\n
}
else
if
(/#ok/.test(data.text)
&
/software_instance_module/.test(data[\'@document\'])
&
(now
-
created_at
<
86400000))
{\n
$(this).attr("class",
"monitoring_ok")\n
$(this).attr("class",
"monitoring_ok")\n
.attr("title",
data.text
+
"
("
+
created_at
+
")"
)\n
.attr("title",
data.text
+
"
("
+
created_at
+
")"
)\n
.
html("<a
href=
\'"
+
data[\'@document\']
+
"\'
></a>
"
);\n
.
attr("href",
data[\'@document\']
);\n
}
else
{\n
}
else
{\n
$(this).attr("class",
"monitoring_error")\n
$(this).attr("class",
"monitoring_error")\n
.attr("title",
data.text
+
"
("
+
created_at
+
")"
)\n
.attr("title",
data.text
+
"
("
+
created_at
+
")"
)\n
.
html("
<a
href=
\'"
+
data[\'@document\']
+
"\'
></a>
"
);\n
.
attr("href",
data[\'@document\']
);\n
}\n
}\n
setTimeout(function
()
{\n
setTimeout(function
()
{\n
update_status(context);\n
update_status(context);\n
...
@@ -146,10 +146,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
...
@@ -146,10 +146,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
});\n
});\n
};\n
};\n
\n
\n
search_document_list = function (context, base_url) {\n
search_document_list =
function
(context,
list_url)
{\n
var start = parseInt(context.attr("data-start") || "0", 10),\n
i = 0,\n
list_url = base_url + "/v1/status/"; // XXX Hardcoded\n
\n
\n
$.ajax({\n
$.ajax({\n
type:
\'GET\',\n
type:
\'GET\',\n
...
@@ -158,7 +155,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
...
@@ -158,7 +155,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
async:
true,\n
async:
true,\n
context:
context,
\n
context:
context,
\n
success:
function(data)
{\n
success:
function(data)
{\n
var result_list = data.list || [];\n
var
result_list =
data.list
||
[],\n
i;\n
\n
\n
for
(
i=
0;
i<result_list.length;
i
+=
1)
{\n
for
(
i=
0;
i<result_list.length;
i
+=
1)
{\n
var
status_url =
result_list[i],\n
var
status_url =
result_list[i],\n
...
@@ -167,8 +165,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
...
@@ -167,8 +165,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
status_id =
encodeURIComponent(Base61.encode(status_url)),\n
status_id =
encodeURIComponent(Base61.encode(status_url)),\n
status_context =
$(this).find(\'#\'
+
status_id);\n
status_context =
$(this).find(\'#\'
+
status_id);\n
if
(!status_context[0])
{\n
if
(!status_context[0])
{\n
status_context =
$(this).append(\'<li
class=
"check_monitoring"
id=
"\'\n
status_context =
$(this).append(\'<li
><a
class=
"check_monitoring"
id=
"\'\n
+ status_id + \'"
data-url=
"\' + encodeURIComponent(status_url) + \'"
></li>
\')\n
+ status_id + \'"
data-url=
"\' + encodeURIComponent(status_url) + \'"
></
a></
li>
\')\n
.find(\'#\' + status_id);\n
.find(\'#\' + status_id);\n
}\n
}\n
setTimeout(function () {\n
setTimeout(function () {\n
...
@@ -188,22 +186,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
...
@@ -188,22 +186,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
\n
\n
\n
\n
methods = {\n
methods = {\n
init: function (base_url) {\n
fill_list: function (base_url) {\n
var context = $(this);\n
var context = $(this),\n
list_url = base_url + "/v1/status/"; // XXX Hardcoded\n
setTimeout(function () {\n
setTimeout(function () {\n
search_document_list(context, base_url);\n
search_document_list(context, list_url);\n
});\n
return context;\n
},\n
check_status: function (base_url, relative_path) {\n
var context = $(this),\n
status_url = base_url + "/v1/status/" + relative_path; // XXX Hardcoded\n
context.attr("data-url", encodeURIComponent(status_url));\n
setTimeout(function () {\n
update_status(context);\n
});\n
});\n
return context;\n
return context;\n
},\n
},\n
};\n
};\n
\n
\n
$.fn.vifibmonitoring = function () {\n
$.fn.vifibmonitoring = function (method) {\n
var result,\n
var result;\n
method = "init";\n
if (methods.hasOwnProperty(method)) {\n
if (methods.hasOwnProperty(method)) {\n
result = methods[method].apply(\n
result = methods[method].apply(\n
this,\n
this,\n
Array.prototype.slice.call(arguments,
0
)\n
Array.prototype.slice.call(arguments,
1
)\n
);\n
);\n
} else {\n
} else {\n
$.error(\'Method \' + method +\n
$.error(\'Method \' + method +\n
...
...
master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting_theme/vifib_hosting_style/hosting-design.css.xml
View file @
e4c1e419
...
@@ -192,26 +192,32 @@ ul#vifib_monitoring li {\n
...
@@ -192,26 +192,32 @@ ul#vifib_monitoring li {\n
width: 2em;\n
width: 2em;\n
}\n
}\n
\n
\n
ul#vifib_monitoring li a {\n
a.check_monitoring {\n
background-color: grey;\n
display: block;\n
display: block;\n
height: 2em;\n
height: 2em;\n
width: 2em;\n
width: 2em;\n
}\n
}\n
\n
\n
li.check_monitoring {\n
a.monitoring_ok {\n
background-color: grey;\n
}\n
\n
li.monitoring_ok {\n
background-color: green;\n
background-color: green;\n
display: block;\n
height: 2em;\n
width: 2em;\n
}\n
}\n
\n
\n
li
.monitoring_error {\n
a
.monitoring_error {\n
background-color: red;\n
background-color: red;\n
display: block;\n
height: 2em;\n
width: 2em;\n
}\n
}\n
\n
\n
li
.monitoring_failed {\n
a
.monitoring_failed {\n
background-color: orange;\n
background-color: orange;\n
display: block;\n
height: 2em;\n
width: 2em;\n
}\n
}\n
</tal:block>
</tal:block>
...
...
master/bt5/vifib_web/bt/revision
View file @
e4c1e419
446
447
\ No newline at end of file
\ No newline at end of file
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