Commit 924fc3b1 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Display appropriate informations about Software Installations on Computers view

parent 327bae76
......@@ -39,6 +39,16 @@
title: "Status",
type: "GadgetField"
};
result.data.rows[i].value.software_release = {
css_class: "",
description: "Software Release Info",
hidden: 0,
"default": {jio_key: value},
key: "software_release",
url: "gadget_slapos_software_release_info.html",
title: "Software Release Info",
type: "GadgetField"
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
......@@ -104,8 +114,8 @@
form_gadget = results[0],
computer_network_list = [["", ""]],
column_list = [
['software_title', 'Software Release'],
['reference', 'Reference'],
['software_release', 'Software Release'],
['url_string', 'Url'],
['monitoring_status', 'Status']
],
ticket_column_list = [
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.7016.54864.20531</string> </value>
<value> <string>965.22323.37519.26163</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1514293807.46</float>
<float>1518025231.58</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_software_release_info.js"></script>
</head>
<body>
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</body>
</html>
\ No newline at end of file
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareMethod("render", function (options) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getElement(),
gadget.getSetting("hateoas_url")
]);
})
.push(function (result) {
var hateoas_url = result[1],
element = result[0];
return gadget.jio_getAttachment(options.value.jio_key,
hateoas_url + options.value.jio_key +
"/SoftwareInstallation_getSoftwareReleaseInformation")
.push(function (info) {
console.log(info);
element.innerHTML = info;
return info;
});
});
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
import json
software_release = context.portal_catalog.getResultValue(
url_string={'query': context.getUrlString(), 'key': 'ExactMatch'},
portal_type='Software Release')
return json.dumps("%s (%s)" % (software_release.getTitle(), software_release.getVersion()))
<?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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstallation_getSoftwareReleaseInformation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -7,6 +7,8 @@ web_page_module/rjs_gadget_slapos_appcache
web_page_module/rjs_gadget_erp5_page_map_js
web_page_module/rjs_gadget_erp5_page_slap_intent_js
web_page_module/rjs_gadget_erp5_page_slap_intent_html
web_page_module/rjs_gadget_slapos_software_release_info_js
web_page_module/rjs_gadget_slapos_software_release_info_html
web_page_module/rjs_gadget_erp5_page_slap_add_computer_html
web_page_module/rjs_gadget_erp5_page_slap_add_computer_js
web_page_module/rjs_gadget_erp5_page_slap_add_hosting_subscription_html
......
......@@ -134,6 +134,8 @@ web_page_module/rjs_gadget_slapos_project_status_html
web_page_module/rjs_gadget_slapos_project_status_js
web_page_module/rjs_gadget_slapos_site_status_html
web_page_module/rjs_gadget_slapos_site_status_js
web_page_module/rjs_gadget_slapos_software_release_info_html
web_page_module/rjs_gadget_slapos_software_release_info_js
web_page_module/rjs_leaflet_css
web_page_module/rjs_leaflet_js
web_page_module/rjs_tv4_min_js
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment