Commit 79683bda authored by Sven Franck's avatar Sven Franck

updated JSON API to allow different views per page. Added new pages

parent 181b5b16
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Blog", "title": "Blog",
"title_i18n": "page_dict.blog.title", "title_i18n": "page_dict.blog.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
{
"portal_type_source": "Computer",
"portal_type_title": "computer",
"portal_type_fields": "computer_fieldlist",
"form": true,
"id": "computer_new",
"property_dict": {
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
"submit_to": "#servers::__id__"
},
"children": [{
"generate": "widget",
"type": "form",
"class_list": "responsive",
"property_dict": {
"editable": true,
"secure": "default",
"secret_hash": "foo",
"public_key": "6Ldpb-oSAAAAAGwriKpk4ol1n4yjN_as6M4xv0zA"
},
"children": [{
"generate": "widget",
"type": "controlgroup",
"class_list": "center",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type": "input", "direct": {"value": "Reset", "className": "translate"}, "attributes": {"type": "reset", "data-i18n":"[value]global_dict.common_dict.cancel"}},
{"type": "input", "direct": {"value": "Submit", "className": "action translate"}, "attributes": {"type": "submit", "data-action":"add", "data-icon":"save", "data-i18n":"[value]global_dict.common_dict.submit", "data-theme": "slapos-black"}}
]
}],
"layout": [
{
"position": "left",
"fieldlist": [
{"title": "computer_title"}
]
}, {
"position": "center",
"fieldlist": [
{"title": "computer_description"}
]
}
]
}
],
"placeholder_dict": {
"no_auth": {
"text":"Requires authorization.",
"text_i18n":"validation_dict.requires_auth",
"children": [
{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [{
"type": "a",
"direct":{"className":"translate action", "href":"#global-popup"},
"attributes":{
"data-i18n":"global_dict.common_dict.login",
"data-action":"login",
"data-icon":"lock",
"data-rel": "popup"
},
"logic": {"text":"Login"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "global_dict.common_dict.register",
"data-icon": "edit"
},
"logic": {"text":"Register"}
}
]
}
]
}
}
}
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"id": "computer_overview", "id": "computer_overview",
"property_dict": { "property_dict": {
"initial_query_url_identifier": "computer_reference", "initial_query_url_identifier": "computer_reference",
"dynamic_children": [1], "dynamic_children": [2],
"requires_authentication": true, "requires_authentication": true,
"depends_on": "login_state", "depends_on": "login_state",
"wrap_gadget": 2, "wrap_gadget": 2,
...@@ -38,6 +38,14 @@ ...@@ -38,6 +38,14 @@
"type": "controlbar", "type": "controlbar",
"property_dict": {"slot": 1}, "property_dict": {"slot": 1},
"children": [{"type": "input", "direct": {"id":"search_computer_list", "className": "translate"}, "attributes": {"data-action":"search", "data-enhanced":"true", "data-i18n": "[placeholder]page_dict.servers.search","placeholder":"Search created servers", "data-icon":"search", "data-action-btn":"true", "data-type":"search", "type":"search"}, "logic":{"clear":"true", "action":"search"}}] "children": [{"type": "input", "direct": {"id":"search_computer_list", "className": "translate"}, "attributes": {"data-action":"search", "data-enhanced":"true", "data-i18n": "[placeholder]page_dict.servers.search","placeholder":"Search created servers", "data-icon":"search", "data-action-btn":"true", "data-type":"search", "type":"search"}, "logic":{"clear":"true", "action":"search"}}]
},{
"type": "a",
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#servers::new"},
"attributes": {
"data-i18n": "page_dict.servers.add",
"data-icon": "edit"
},
"logic": {"text":"Add server"}
},{ },{
"generate": "widget", "generate": "widget",
"type": "table", "type": "table",
......
{
"portal_type_source": "Computer",
"portal_type_title": "computer",
"portal_type_fields": "computer_fieldlist",
"form": true,
"id": "computer_new",
"property_dict": {
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
"submit_to": "#servers::__id__"
},
"children": [{
"generate": "widget",
"type": "form",
"class_list": "responsive",
"property_dict": {
"editable": true,
"secure": "default",
"secret_hash": "foo",
"public_key": "6Ldpb-oSAAAAAGwriKpk4ol1n4yjN_as6M4xv0zA"
},
"children": [{
"generate": "widget",
"type": "controlgroup",
"class_list": "center inline",
"property_dict": {},
"children": [
{"type": "a", "direct": {"href": "#servers::__id__::scope", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"page_dict.servers.scope", "data-icon":"globe"}, "logic": {"text":"Set Server Scope"}},
{"type": "a", "direct": {"href": "#servers::__id__::config", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"page_dict.servers.config", "data-icon":"cogs"}, "logic": {"text":"Set Configuration"}},
{"type": "a", "direct": {"href": "#servers::__id__::ssl_on", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"page_dict.servers.ssl_on", "data-icon":"lock"}, "logic": {"text":"Request SSL"}},
{"type": "a", "direct": {"href": "#servers::__id__::ssl_off", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"page_dict.servers.ssl_off", "data-icon":"unlock"}, "logic": {"text":"Revoke SSL"}}
]
}],
"layout": [
{
"position": "left",
"fieldlist": [
{"title": "computer_title", "overrides": {"properties":{"editable":false, "required": false}}},
{"title": "computer_reference", "overrides": {"properties":{"editable":false, "required": false}}}
]
}
]
}
],
"placeholder_dict": {
"no_auth": {
"text":"Requires authorization.",
"text_i18n":"validation_dict.requires_auth",
"children": [
{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [{
"type": "a",
"direct":{"className":"translate action", "href":"#global-popup"},
"attributes":{
"data-i18n":"global_dict.common_dict.login",
"data-action":"login",
"data-icon":"lock",
"data-rel": "popup"
},
"logic": {"text":"Login"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "global_dict.common_dict.register",
"data-icon": "edit"
},
"logic": {"text":"Register"}
}
]
}
]
}
}
}
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Office JS App Store", "title": "Office JS App Store",
"title_i18n": "page_dict.home.title", "title_i18n": "page_dict.home.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Download", "title": "Download",
"title_i18n": "page_dict.download.title", "title_i18n": "page_dict.download.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Forum", "title": "Forum",
"title_i18n": "page_dict.forum.title", "title_i18n": "page_dict.forum.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Help", "title": "Help",
"title_i18n": "page_dict.help.title", "title_i18n": "page_dict.help.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"title": "Invoices", "title": "Invoices",
"title_i18n": "page_dict.invoices.title", "title_i18n": "page_dict.invoices.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "listgrid", "type": "listgrid",
...@@ -18,5 +19,6 @@ ...@@ -18,5 +19,6 @@
} }
] ]
} }
}
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Monitoring", "title": "Monitoring",
"title_i18n": "page_dict.monitoring.title", "title_i18n": "page_dict.monitoring.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Networks", "title": "Networks",
"title_i18n": "page_dict.networks.title", "title_i18n": "page_dict.networks.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"title": "Account", "title": "Account",
"title_i18n": "page_dict.person.title", "title_i18n": "page_dict.person.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "fieldlist", "type": "fieldlist",
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
"href": "person_view" "href": "person_view"
} }
] ]
}
}, },
{ {
"generate": "widget", "generate": "widget",
...@@ -24,7 +26,16 @@ ...@@ -24,7 +26,16 @@
"title": "Register", "title": "Register",
"title_i18n": "page_dict.person.register", "title_i18n": "page_dict.person.register",
"theme":"slapos-white", "theme":"slapos-white",
"children":[ "layout": {
"default": [
{
"generate": "gadget",
"type": "fieldlist",
"id": "person_view",
"href": "person_view"
}
],
"new": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "fieldlist", "type": "fieldlist",
...@@ -33,5 +44,6 @@ ...@@ -33,5 +44,6 @@
} }
] ]
} }
}
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Pricing", "title": "Pricing",
"title_i18n": "page_dict.pricing.title", "title_i18n": "page_dict.pricing.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"title": "Servers", "title": "Servers",
"title_i18n": "page_dict.servers.title", "title_i18n": "page_dict.servers.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "listbox", "type": "listbox",
...@@ -17,20 +18,42 @@ ...@@ -17,20 +18,42 @@
"href": "computer_overview" "href": "computer_overview"
} }
] ]
}
}, { }, {
"generate": "widget", "generate": "widget",
"type": "page", "type": "page",
"title": "Server Instance", "title": "Server Instance",
"title_i18n": "page_dict.servers.instance", "title_i18n": "page_dict.servers.instance",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{
"generate": "gadget",
"type": "fieldlist",
"id": "computer_status",
"href": "computer_status"
}
],
"new": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "fieldlist", "type": "fieldlist",
"id": "computer_view", "id": "computer_new",
"href": "computer_view" "href": "computer_new"
} }
] ]
} }
}, {
"generate": "widget",
"type": "page",
"title": "Instance Configuration",
"title_i18n": "page_dict.servers.configuration",
"layout": {
"default": [],
"scope": [],
"ssl_on": [],
"ssl_off": []
}
}
] ]
} }
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"title": "Services", "title": "Services",
"title_i18n": "page_dict.services.title", "title_i18n": "page_dict.services.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"title": "Software", "title": "Software",
"title_i18n": "page_dict.software.title", "title_i18n": "page_dict.software.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "listgrid", "type": "listgrid",
...@@ -17,13 +18,15 @@ ...@@ -17,13 +18,15 @@
"href": "subscription_overview" "href": "subscription_overview"
} }
] ]
}
}, { }, {
"generate": "widget", "generate": "widget",
"type": "page", "type": "page",
"title": "Software", "title": "Software",
"title_i18n": "page_dict.software.title", "title_i18n": "page_dict.software.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{ {
"generate": "gadget", "generate": "gadget",
"type": "listbox", "type": "listbox",
...@@ -31,13 +34,16 @@ ...@@ -31,13 +34,16 @@
"href": "release_overview" "href": "release_overview"
} }
] ]
}
}, { }, {
"generate": "widget", "generate": "widget",
"type": "page", "type": "page",
"title": "Release", "title": "Release",
"title_i18n": "page_dict.release.title", "title_i18n": "page_dict.release.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [] "layout": {
"default": []
}
} }
] ]
} }
{
"portal_type_source": "Software Installation",
"portal_type_title": "installation",
"portal_type_fields": "subscription_fieldlist",
"form": true,
"id": "computer_new",
"property_dict": {
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
"submit_to": "#servers::__id__"
},
"children": [],
"placeholder_dict": {
"no_auth": {
"text":"Requires authorization.",
"text_i18n":"validation_dict.requires_auth",
"children": [
{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [{
"type": "a",
"direct":{"className":"translate action", "href":"#global-popup"},
"attributes":{
"data-i18n":"global_dict.common_dict.login",
"data-action":"login",
"data-icon":"lock",
"data-rel": "popup"
},
"logic": {"text":"Login"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "global_dict.common_dict.register",
"data-icon": "edit"
},
"logic": {"text":"Register"}
}
]
}
]
}
}
}
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"title": "Thanks", "title": "Thanks",
"title_i18n": "page_dict.thanks.title", "title_i18n": "page_dict.thanks.title",
"theme": "slapos-white", "theme": "slapos-white",
"children": [ "layout": {
"default": [
{ {
"type": "p", "type": "p",
"direct": {"className": "ui-content-element translate responsive"}, "direct": {"className": "ui-content-element translate responsive"},
...@@ -18,5 +19,6 @@ ...@@ -18,5 +19,6 @@
} }
] ]
} }
}
] ]
} }
\ No newline at end of file
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