Commit bda756e0 authored by Sven Franck's avatar Sven Franck

moved pagination from JSON API to automatic generation

parent eb354604
......@@ -20,9 +20,34 @@
"link_source": null,
"editable": null,
"action_menu": true,
"search": {"text": "Search available servers", "text_i18n": "portal_type_dict.computer_dict.text_dict.search", "id": "search_server_list", "records": true, "filter": true, "sorted": true},
"caption": {"slot": 1, "text": "Created Servers", "text_i18n": "portal_type_dict.computer_dict.text_dict.created_servers"},
"pagination": {"slot": 2, "options": [{"text":8, "text_i18n":"portal_type_dict.computer_dict.text_dict.8"},{"text":16, "text_i18n":"portal_type_dict.computer_dict.text_dict.16"},{"text":32, "text_i18n":"portal_type_dict.computer_dict.text_dict.32"},{"text":64, "text_i18n":"portal_type_dict.computer_dict.text_dict.64"}]}
"caption": {
"slot": 1,
"text": "Created Servers",
"text_i18n": "portal_type_dict.computer_dict.text_dict.created_servers"
},
"no_items": {
"message":"No Software installed.",
"message_i18n":"portal_type_dict.software_dict.text_dict.no_software",
"children": [
{
"href": "#software::new",
"text": "Add Software",
"text_i18n": "portal_type_dict.software_dict.text_dict.add_software",
"class_list": "translate ui-btn-slapos-black"
}
]
},
"pagination": {
"slot": 2,
"option_list": [
{"text":8, "text_i18n":"portal_type_dict.computer_dict.text_dict.8"},
{"text":16, "text_i18n":"portal_type_dict.computer_dict.text_dict.16"},
{"text":32, "text_i18n":"portal_type_dict.computer_dict.text_dict.32"},
{"text":64, "text_i18n":"portal_type_dict.computer_dict.text_dict.64"}
]
},
"search": {"text": "Search available servers", "text_i18n": "portal_type_dict.computer_dict.text_dict.search", "id": "search_server_list", "records": true, "filter": true, "sorted": true}
},
"scheme": {
"header": [
......@@ -67,24 +92,6 @@
"type": "controlbar",
"property_dict": {"slot": 3},
"children": [{"type": "a","direct": {"className": "toggle_local_popup ui-btn ui-btn-icon-left ui-icon-cogs ui-shadow ui-corner-all","href":"#global_popup"},"attributes": {"data-reference":"configure_search","data-type":"invoices", "data-rel":"popup","data-transition":"pop","data-position-to":"window"},"logic": {"text":"Configuration"}}]
},{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 4},
"children": [
{
"generate":"widget",
"type": "controlgroup",
"property_dict": {"direction":"horizontal"},
"children":[
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"global_dict.pagination_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"global_dict.pagination_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_release_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "16", "text": "16", "text_i18n":"global_dict.pagination_dict.16"},{"value": "32", "text": "32", "text_i18n":"global_dict.pagination_dict.32"},{"value": "64", "text": "64", "text_i18n":"global_dict.pagination_dict.64"}, {"value": "128", "text": "128", "text_i18n":"global_dict.pagination_dict.128"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"global_dict.pagination_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"global_dict.pagination_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}
]
}, {
"generate": "widget",
"type": "table",
......
......@@ -8,7 +8,7 @@
"id": "computer_overview",
"property_dict": {
"initial_query_url_identifier": "_id",
"dynamic_children": [4],
"dynamic_children": [2],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
......@@ -20,6 +20,15 @@
"slot": 1,
"text": "Created Servers",
"text_i18n": "portal_type_dict.computer_dict.text_dict.created_servers"
},
"pagination": {
"slot": 2,
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.computer_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.computer_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.computer_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.computer_dict.text_dict.64"}
]
}
},
"scheme": [
......@@ -61,24 +70,6 @@
"data-icon": "edit"
},
"logic": {"text":"Add server"}
}, {
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 2},
"children": [
{
"generate":"widget",
"type": "controlgroup",
"property_dict": {"direction":"horizontal"},
"children":[
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.computer_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.computer_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_server_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "8", "text": "8", "text_i18n":"portal_type_dict.computer_dict.text_dict.8"},{"value": "16", "text": "16", "text_i18n":"portal_type_dict.computer_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.computer_dict.text_dict.32"}, {"value": "64", "text": "64", "text_i18n":"portal_type_dict.computer_dict.text_dict.64"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.computer_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.computer_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}
]
}, {
"generate": "widget",
"type": "table",
......
......@@ -11,7 +11,7 @@
"message":"No invoices found",
"message_i18n":"portal_type_dict.invoice_dict.text_dict.nodata"
},
"dynamic_children": [3],
"dynamic_children": [1],
"requires_authentication": true,
"wrap_gadget": 2,
"sortable": true,
......@@ -21,6 +21,15 @@
"slot": 1,
"text": "Invoice Overview",
"text_i18n": "portal_type_dict.invoice_dict.text_dict.overview"
},
"pagination": {
"slot": 2,
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.invoice_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.invoice_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.invoice_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.invoice_dict.text_dict.64"}
]
}
},
"scheme": [
......@@ -46,25 +55,6 @@
}
],
"children": [{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 2},
"children": [
{
"generate":"widget",
"type": "controlgroup",
"property_dict": {"direction":"horizontal"},
"children":[
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.invoice_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.invoice_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_invoice_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "8", "text": "8", "text_i18n":"portal_type_dict.invoice_dict.text_dict.8"},{"value": "16", "text": "16", "text_i18n":"portal_type_dict.invoice_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.invoice_dict.text_dict.32"}, {"value": "64", "text": "64", "text_i18n":"portal_type_dict.invoice_dict.text_dict.64"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.invoice_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.invoice_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}
]
},
{
"generate": "widget",
"type": "controlbar",
"class_list": "responsive",
......
......@@ -7,11 +7,7 @@
"view": "FOO",
"id": "network_overview",
"property_dict": {
"no_items": {
"message": "No networks found.",
"message_i18n": "portal_type_dict.network_dict.text_dict.nonet"
},
"dynamic_children": [4],
"dynamic_children": [2],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
......@@ -21,6 +17,19 @@
"slot": 1,
"text": "Created Networks",
"text_i18n": "portal_type_dict.network_dict.text_dict.created_networks"
},
"pagination": {
"slot": 2,
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.network_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.network_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.network_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.network_dict.text_dict.64"}
]
},
"no_items": {
"message": "No networks found.",
"message_i18n": "portal_type_dict.network_dict.text_dict.nonet"
}
},
"scheme": [
......@@ -46,24 +55,6 @@
"data-icon": "edit"
},
"logic": {"text":"Add network"}
}, {
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 2},
"children": [
{
"generate":"widget",
"type": "controlgroup",
"property_dict": {"direction":"horizontal"},
"children":[
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.network_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.network_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_network_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "8", "text": "8", "text_i18n":"portal_type_dict.network_dict.text_dict.8"},{"value": "16", "text": "16", "text_i18n":"portal_type_dict.network_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.network_dict.text_dict.32"}, {"value": "64", "text": "64", "text_i18n":"portal_type_dict.network_dict.text_dict.64"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.network_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.network_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}
]
}, {
"generate": "widget",
"type": "controlbar",
......
......@@ -8,7 +8,7 @@
"id": "release_overview",
"property_dict": {
"initial_query_url_identifier": "reference_id",
"dynamic_children": [2],
"dynamic_children": [1],
"wrap_gadget": 2,
"link": true,
"link_identifier": "_id",
......@@ -16,6 +16,15 @@
"slot": 1,
"text": "Available Releases",
"text_i18n": "portal_type_dict.release_dict.text_dict.available_releases"
},
"pagination": {
"slot": 2,
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.release_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.release_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.release_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.release_dict.text_dict.64"}
]
}
},
"scheme": [
......@@ -36,26 +45,7 @@
]
}
],
"children": [
{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 2},
"children": [
{
"generate":"widget",
"type": "controlgroup",
"property_dict": {"direction":"horizontal"},
"children":[
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.release_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.release_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_release_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "8", "text": "8", "text_i18n":"portal_type_dict.release_dict.text_dict.8"},{"value": "16", "text": "16", "text_i18n":"portal_type_dict.release_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.release_dict.text_dict.32"}, {"value": "64", "text": "64", "text_i18n":"portal_type_dict.release_dict.text_dict.64"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.release_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.release_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}
]
}, {
"children": [{
"generate": "widget",
"type": "controlbar",
"class_list": "responsive",
......
......@@ -8,7 +8,7 @@
"id": "service_overview",
"property_dict": {
"initial_query_url_identifier": "reference_computer",
"dynamic_children": [4],
"dynamic_children": [2],
"wrap_gadget": 2,
"link": true,
"link_identifier": "_id",
......@@ -16,6 +16,15 @@
"slot": 1,
"text": "Installed Services",
"text_i18n": "portal_type_dict.service_dict.text_dict.installed_services"
},
"pagination": {
"slot": 2,
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.service_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.service_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.service_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.service_dict.text_dict.64"}
]
}
},
"scheme": [
......@@ -46,24 +55,6 @@
"data-icon": "edit"
},
"logic": {"text":"Install new service"}
}, {
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 2},
"children": [
{
"generate":"widget",
"type": "controlgroup",
"property_dict": {"direction":"horizontal"},
"children":[
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.service_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.service_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_services_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "8", "text": "8", "text_i18n":"portal_type_dict.service_dict.text_dict.8"},{"value": "16", "text": "16", "text_i18n":"portal_type_dict.service_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.service_dict.text_dict.32"}, {"value": "64", "text": "64", "text_i18n":"portal_type_dict.service_dict.text_dict.64"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.service_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.service_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}
]
}, {
"generate": "widget",
"type": "controlbar",
......
......@@ -10,7 +10,16 @@
"link": true,
"link_identifier": "id",
"link_to_view": "install",
"dynamic_children": [1]
"dynamic_children": [1],
"pagination": {
"class_list": "responsive",
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.software_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.software_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.software_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.software_dict.text_dict.64"}
]
}
},
"scheme": [
{
......@@ -50,25 +59,6 @@
"input": "#search_software_list"
},
"children": []
}, {
"generate":"widget",
"type": "controlbar",
"class_list": "responsive",
"children": [{
"generate": "widget",
"type": "controlgroup",
"class_list": "pagination",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_software_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "16", "text": "16", "text_i18n":"portal_type_dict.software_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.software_dict.text_dict.32"},{"value": "64", "text": "64", "text_i18n":"portal_type_dict.software_dict.text_dict.64"}, {"value": "128", "text": "128", "text_i18n":"portal_type_dict.software_dict.text_dict.128"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}]
}]
}
......
......@@ -9,7 +9,16 @@
"property_dict": {
"link": true,
"link_identifier": "id",
"dynamic_children": [1]
"dynamic_children": [1],
"pagination": {
"class_list": "responsive",
"option_list": [
{"value": "8", "text": "8", "text_i18n":"portal_type_dict.software_dict.text_dict.8"},
{"value": "16", "text": "16", "text_i18n":"portal_type_dict.software_dict.text_dict.16"},
{"value": "32", "text": "32", "text_i18n":"portal_type_dict.software_dict.text_dict.32"},
{"value": "64", "text": "64", "text_i18n":"portal_type_dict.software_dict.text_dict.64"}
]
}
},
"scheme": [
{
......@@ -47,25 +56,6 @@
"input": "#search_software_list"
},
"children": []
}, {
"generate":"widget",
"type": "controlbar",
"class_list": "responsive",
"children": [{
"generate": "widget",
"type": "controlgroup",
"class_list": "pagination",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.first", "data-action":"first", "data-icon":"step-backward", "data-iconpos":"notext"}, "logic": {"text":"First"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.previous", "data-action":"prev", "data-icon":"backward", "data-iconpos":"notext"}, "logic": {"text":"Step Backward"}},
{"type":"select", "direct":{"id":"paginate_software_list", "className":"action"},"attributes": {"data-icon":"reorder", "data-action":"limit", "data-iconpos":"notext"},"logic": {"options":[{"value": "16", "text": "16", "text_i18n":"portal_type_dict.software_dict.text_dict.16"},{"value": "32", "text": "32", "text_i18n":"portal_type_dict.software_dict.text_dict.32"},{"value": "64", "text": "64", "text_i18n":"portal_type_dict.software_dict.text_dict.64"}, {"value": "128", "text": "128", "text_i18n":"portal_type_dict.software_dict.text_dict.128"}]}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.next", "data-action":"next", "data-icon":"forward", "data-iconpos":"notext"}, "logic": {"text":"Step Forward"}},
{"type": "a", "direct":{"className":"action", "href":""}, "attributes":{"data-i18n":"portal_type_dict.software_dict.text_dict.last", "data-action":"last", "data-icon":"step-forward", "data-iconpos":"notext"}, "logic": {"text": "Last"}}
]
}]
}]
}
......
......@@ -7,6 +7,16 @@
"id": "service_overview",
"view": "FOO",
"property_dict": {
"initial_query_url_identifier": "reference_computer",
"dynamic_children": [0],
"wrap_gadget": 2,
"linkable": true,
"link_identifier": "id",
"caption": {
"slot": 1,
"text": "Installed Services",
"text_i18n":"portal_type_dict.software_dict.text_dict.no_software"
},
"no_items": {
"message":"No Software installed.",
"message_i18n":"portal_type_dict.software_dict.text_dict.no_software",
......@@ -18,16 +28,6 @@
"class_list": "translate ui-btn-slapos-black"
}
]
},
"initial_query_url_identifier": "reference_computer",
"dynamic_children": [0],
"wrap_gadget": 2,
"linkable": true,
"link_identifier": "id",
"caption": {
"slot": 1,
"text": "Installed Services",
"text_i18n":"portal_type_dict.software_dict.text_dict.no_software"
}
},
"scheme":[
......
......@@ -203,7 +203,7 @@
// create signature and ticket
signature = util.generateRandomIdentifier(36);
flux[signature] = util.generateUuid();
flux[signature] = util.uuid();
// authenticate with 3rd party
// NOTE: normally the signature should be a server roundtrip token!
......@@ -792,7 +792,7 @@
// TODO: not nice, find better way
if (prevail.setValue) {
field_value = prevail.setValue + util.generateUuid();
field_value = prevail.setValue + util.uuid();
}
// easy way out if not enabled
......@@ -1284,6 +1284,11 @@
// query has results
if (answer.data.total_rows > 0) {
// add pagination
if (props.pagination) {
spec.children.push(factory.util.paginate(props.pagination));
}
// loop children (elements to generate)
for (i = 0; i < spec.children.length; i += 1) {
element = spec.children[i];
......@@ -1333,7 +1338,8 @@
// TODO: refactor!
"listbox": function (spec, answer, field_dict, update, url_pointer) {
var element, i, j, k, l, m, target, container, pack, slot, pop, active,
countColumns, column, no_content, no_result, content, segment, field;
countColumns, column, no_content, no_result, content, segment, field,
props;
// count columns
countColumns = function (scheme) {
......@@ -1357,14 +1363,16 @@
return app.noItemsFound(config, "td", countColumns(spec.scheme))
};
props = spec.property_dict;
// set update of gadget flag
if (spec.property_dict.depends_on) {
spec.depend = spec.property_dict.depends_on;
if (props.depends_on) {
spec.depend = props.depends_on;
}
// set state reset flag
if (spec.property_dict.resets) {
spec.reset = spec.property_dict.resets;
if (props.resets) {
spec.reset = props.resets;
}
// no auth
......@@ -1380,8 +1388,8 @@
if (update) {
target = document.createDocumentFragment();
} else {
slot = spec.property_dict.wrap_gadget;
pop = spec.property_dict.need_popup;
slot = props.wrap_gadget;
pop = props.need_popup;
if (slot) {
container = factory.element("div", {"className": "span_" + slot});
pack = true;
......@@ -1407,20 +1415,25 @@
}
// add caption
if (spec.property_dict.caption) {
if (props.caption) {
spec.children.push({
"generate":"widget",
"type": "controlbar",
"property_dict": {"slot": spec.property_dict.caption.slot || 1},
"property_dict": {"slot": props.caption.slot || 1},
"children": [{
"type": "p",
"direct": {"className": "ui-table-caption translate"},
"attributes": {"data-i18n": spec.property_dict.caption.text_i18n || null},
"logic": {"text": spec.property_dict.caption.text}
"attributes": {"data-i18n": props.caption.text_i18n || null},
"logic": {"text": props.caption.text}
}]
})
});
}
// add pagination
if (props.pagination) {
spec.children.push(factory.util.paginate(props.pagination));
}
// loop over dynamic data and generate table
for (i = 0; i < spec.children.length; i += 1) {
element = spec.children[i];
......@@ -1429,8 +1442,8 @@
element.reference = spec.id;
// set flag to label elements that should contain dynamic data
if (spec.property_dict.dynamic_children) {
if (spec.property_dict.dynamic_children.indexOf(i) > -1) {
if (props.dynamic_children) {
if (props.dynamic_children.indexOf(i) > -1) {
// pass relevant information to method generating the gadget
element.portal_type = spec.portal_type_title;
element.dynamic = true;
......@@ -1456,9 +1469,9 @@
// dynamic element being updated - 0 results need placeholder
if (element.dynamic && no_result) {
if (update) {
content.appendChild(no_content(spec.property_dict.no_items));
content.appendChild(no_content(props.no_items));
} else {
content.querySelector("tbody").appendChild(no_content(spec.property_dict.no_items));
content.querySelector("tbody").appendChild(no_content(props.no_items));
}
}
if (content) {
......@@ -1523,7 +1536,7 @@
if (answer.request_new || answer.data.total_rows === 0) {
data = {};
if (answer.request_new) {
data._id = util.generateUuid();
data._id = util.uuid();
}
} else if (answer.data.total_rows > 1) {
util.error("Fieldlist: More than 1 record");
......@@ -1568,6 +1581,86 @@
/* ********************************************************************** */
factory.util = {};
/** Generate a pagination toolbar
* @method paginate
* @param {object} spec Pagination configuration
* @return {object} finished config object
**/
factory.util.paginate = function (spec) {
var n, option, props, option_list, class_list;
option_list = [{"value": "", "text": "", "text_i18n": ""}];
props = spec.slot ? {"slot": spec.slot} : {};
class_list = spec.class_list || "";
for (n = 0; n < spec.option_list.length; n += 1) {
option = spec.option_list[n];
option_list.push({"value": option.value, "text": option.text, "text_i18n": option.text_i18n});
}
return {
"generate": "widget",
"type": "controlbar",
"class_list": class_list,
"property_dict": props,
"children": [{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [{
"type": "a",
"direct":{"className":"action", "href":"#"},
"attributes":{
"data-i18n": "global_dict.first",
"data-action": "first",
"data-icon": "step-backward",
"data-iconpos": "notext"
},
"logic": {"text":"First"}
}, {
"type": "a",
"direct":{"className":"action", "href":"#"},
"attributes":{
"data-i18n": "global_dict.previous",
"data-action": "prev",
"data-icon": "backward",
"data-iconpos": "notext"
},
"logic": {"text":"Previous"}
}, {
"type":"select",
"direct":{"id": "select_" + util.uuid(), "className": "action"},
"attributes": {
"data-icon":"reorder",
"data-action":"limit",
"data-iconpos":"notext"
},
"logic": {"options":option_list}
}, {
"type": "a",
"direct":{"className":"action", "href":"#"},
"attributes":{
"data-i18n": "global_dict.next",
"data-action": "next",
"data-icon": "forward",
"data-iconpos": "notext"
},
"logic": {"text":"Next"}
}, {
"type": "a",
"direct":{"className":"action", "href":"#"},
"attributes":{
"data-i18n": "global_dict.last",
"data-action": "last",
"data-icon": "step-forward",
"data-iconpos": "notext"
},
"logic": {"text":"Last"}
}]
}]
};
};
/**
* Update an element dict depending on status
* @method convertDict
......@@ -2361,7 +2454,7 @@
// make sure value is set correctly
if (input_config.logic && input_config.logic.setValue) {
input_config.direct.value = input_config.logic.setValue +
util.generateUuid();
util.uuid();
}
} else {
config = spec.fields[field.field];
......@@ -6419,10 +6512,10 @@
/**
* Generate a UUID ticket for a transaction
* @method generateUuid
* @method uuid
* @return {string} UUID
**/
util.generateUuid = function () {
util.uuid = function () {
function S4() {
return ('0000' + Math.floor(
Math.random() * 0x10000 /* 65536 */
......
{
"global_dict": {
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"english": "English",
"search": "Search",
"account": "Account",
......@@ -84,10 +88,6 @@
"nonet": "No networks found.",
"add": "Add network",
"created_networks": "Created Networks",
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"8":"8",
"16": "16",
"32": "32",
......@@ -127,10 +127,6 @@
"search": "Search available services",
"add": "Install new service",
"installed_services": "Installed Services",
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"8":"8",
"16": "16",
"32": "32",
......@@ -216,10 +212,6 @@
"add": "Add Server",
"servers": "Servers",
"created_servers": "Created Servers",
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"8":"8",
"16": "16",
"32": "32",
......@@ -450,10 +442,6 @@
"title": "Invoices",
"nodata": "No invoices found",
"overview": "Invoice Overview",
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"8":"8",
"16": "16",
"32": "32",
......@@ -757,10 +745,6 @@
"add_software": "Install software",
"status": "Status",
"search": "Search available software",
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"8":"8",
"16": "16",
"32": "32",
......@@ -812,10 +796,6 @@
"instance_recipe": "Instance Configuration",
"instance_server": "Computer",
"instance_network": "Network",
"first": "First",
"previous": "Previous",
"next": "Next",
"last": "Last",
"8":"8",
"16": "16",
"32": "32",
......
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