Commit ea78efa9 authored by Sven Franck's avatar Sven Franck

fixed red theme, added service config page and destroy action

parent 02320a0b
......@@ -70,13 +70,16 @@ span.static {
text-align: center;
margin: 0;
}
/* TODO: we should not float!!! and not clear... */
.left {
display: block;
text-align: left;
float: left;
}
.right {
display: block;
text-align: right;
float: right;
}
.starred {
color: #0FBABD;
......@@ -97,45 +100,6 @@ span.static {
margin: 0 auto;
}
}
html a.ui-btn.error.status,
html a.ui-btn.error.status:hover,
html a.ui-btn.error.status:active {
background-color: red !important;
color: #fff !important;
}
.alert {
color: red;
font-weight: bold;
}
.alert textarea {
color: red !important;
font-weight: normal;
}
.alert label {
display: block;
width: 100%;
float: none;
}
html table.ui-table tr td.plain,
html table.ui-table tr th.plain {
padding: 0 .25em;
}
tbody .alert,
tbody .proceed,
tbody .large {
display: block;
text-align: center
}
@media (max-width: 40em) {
tbody .alert,
tbody .proceed {
font-size: 1.5em;
}
}
.proceed {
color: #0FBABD;
font-weight: bold;
}
.static {
cursor: default;
}
......@@ -429,4 +393,119 @@ html body div.ui-panel a.unenhanced:active {
padding: 1em;
text-align: center;
width: 100%;
}
/* ============================= content grid ============================= */
.span_1, .span_2 {
display: inline-block;
vertical-align: middle;
width: 45%;
padding-left: 2%;
padding-right: 2%;
/* ~ 98% for 2 col layout */
padding-top: 2%;
}
/* form need no padding and align top */
form .span_1, form .span_2 {
vertical-align: top;
padding-left: 0%;
padding-right: 0%;
}
.span_1 textarea {
width: 57.5%;
display: inline-block;
vertical-align: middle;
}
.span_2 {
width: 96% /* 2% padding-left/right */
}
form .span_1 {
width: 50%;
}
/* TODO: is all this padding really necessary? */
.span_1 .ui-controlgroup-vertical,
.span_2 .ui-controlgroup-vertical,
.span_1 .ui-controlgroup-horizontal,
.span_2 .ui-controlgroup-horizontal,
.span_1 form,
.span_2 form {
margin-top: 1em;
margin-bottom: 1em;
vertical-align: middle;
}
@media (max-width: 40em) {
.span_1, .span_2, form .span_1, form .span_2 {
width: 100%;
padding: 0;
}
.span_1 textarea {
width: 100%;
}
}
.span_1 .ui-input-search,
.span_2 .ui-input-search {
width: 50%;
}
.span_1 .ui-table-wrapper .ui-input-search,
.span_2 .ui-table-wrapper .ui-input-search{
width: auto;
margin: 0;
box-shadow: none;
-webkit-box-shadow: none;
border-width: 0;
border-bottom-width: 1px;
}
@media (max-width: 45em) {
.span_1 .ui-input-search,
.span_2 .ui-input-search {
width: 100%;
}
}
@media (min-width: 45em) {
.span_1 .ui-input-search,
.span_2 .ui-input-search {
width: 60%;
}
}
/* ======================== status (red...) ========================= */
html body div.ui-page a.ui-btn.error.status,
html body div.ui-page a.ui-btn.error.status:hover,
html body div.ui-page a.ui-btn.error.status:active,
html body div.ui-page .ui-controlgroup-controls a.ui-btn.error.status:hover,
html body div.ui-page .ui-controlgroup-controls a.ui-btn.error.status:active {
background: 0 none;
background-color: red !important;
color: #fff !important;
}
.alert {
color: red;
font-weight: bold;
}
.alert textarea {
color: red !important;
font-weight: normal;
}
.alert label {
display: block;
width: 100%;
float: none;
}
html table.ui-table tr td.plain,
html table.ui-table tr th.plain {
padding: 0 .25em;
}
tbody .alert,
tbody .proceed,
tbody .large {
display: block;
text-align: center
}
@media (max-width: 40em) {
tbody .alert,
tbody .proceed {
font-size: 1.5em;
}
}
.proceed {
color: #0FBABD;
font-weight: bold;
}
\ No newline at end of file
......@@ -913,78 +913,7 @@ html .ui-header .ui-last-wrap .ui-controlgroup-controls .ui-btn {
right: 0.25em;
}
}
/* ============================= content grid ============================= */
.span_1, .span_2 {
display: inline-block;
vertical-align: middle;
width: 45%;
padding-left: 2%;
padding-right: 2%;
/* ~ 98% for 2 col layout */
padding-top: 2%;
}
/* form need no padding and align top */
form .span_1, form .span_2 {
vertical-align: top;
padding-left: 0%;
padding-right: 0%;
}
.span_1 textarea {
width: 57.5%;
display: inline-block;
vertical-align: middle;
}
.span_2 {
width: 96% /* 2% padding-left/right */
}
form .span_1 {
width: 50%;
}
/* is this padding really necessary? */
.span_1 .ui-controlgroup-vertical,
.span_2 .ui-controlgroup-vertical,
.span_1 .ui-controlgroup-horizontal,
.span_2 .ui-controlgroup-horizontal,
.span_1 form,
.span_2 form {
margin-top: 1em;
margin-bottom: 1em;
vertical-align: middle;
}
@media (max-width: 40em) {
.span_1, .span_2, form .span_1, form .span_2 {
width: 100%;
padding: 0;
}
.span_1 textarea {
width: 100%;
}
}
.span_1 .ui-input-search,
.span_2 .ui-input-search {
width: 50%;
}
.span_1 .ui-table-wrapper .ui-input-search,
.span_2 .ui-table-wrapper .ui-input-search{
width: auto;
margin: 0;
box-shadow: none;
-webkit-box-shadow: none;
border-width: 0;
border-bottom-width: 1px;
}
@media (max-width: 45em) {
.span_1 .ui-input-search,
.span_2 .ui-input-search {
width: 100%;
}
}
@media (min-width: 45em) {
.span_1 .ui-input-search,
.span_2 .ui-input-search {
width: 60%;
}
}
/* ============================= content elements ============================= */
/* TODO: merge with span_1 span_2... */
html div.ui-page div.ui-content .ui-content-element {
......
......@@ -208,6 +208,47 @@
}
}
},
"service_state": {
"type":"StringField",
"widget": {
"id": "service_state",
"title": "State",
"title_i18n": "portal_type_dict.service_dict.field_list.state.title",
"description": "The status of the current service.",
"description_i18n": "portal_type_dict.service_dict.field_list.state.description",
"alternate_name": "service_state",
"default_value": null,
"css_class": null,
"hidden": null,
"display_width": null,
"maximum_input": null,
"extra": null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
"truncate": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_long": {
"message": "Too much input give.",
"i18n": "validation_dict.too_much_input"
}
}
},
"service_usage": {
"type":"StringField",
"widget": {
......
{
"portal_type_source": "Service",
"portal_type_title": "service",
"portal_type_fields": "service_fieldlist",
"initial_query": {"include_docs": true, "limit":[0,1]},
"form": true,
"id": "service_status",
"property_dict": {
"dynamic_children": [1],
"requires_authentication": true,
"depends_on": "login_state"
},
"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": "Update", "className": "action translate"}, "attributes": {"type": "submit", "data-action":"store", "data-i18n":"[value]global_dict.common_dict.update", "data-theme": "slapos-black"}}
]
}],
"layout": [
{
"position": "center",
"fieldlist": [
{"type": "input", "direct": {"disabled": true, "className":"progress_notifier", "name": "release_status", "id": "release_status", "value": "Preparing instance..."}, "attributes": {"data-i18n":"[value]page_dict.services.prepare_instance"}}
]
},
{
"position": "left",
"fieldlist": [
{"title": "release_title", "overrides": {"properties": {"required": true, "editable":false}}},
{"title": "release_version", "overrides": {"properties": {"required": true, "editable":false}}},
{"type": "input", "direct": {"name": "release_id", "id": "release_id", "className": "required"}, "attributes": {"data-enhanced":"true", "type":"text", "readonly": "readonly"}, "logic":{"setValue": "instance_", "label":"Instance ID", "label_i18n":"page_dict.services.instance_id"}},
{"type":"select", "direct":{"name": "release_reference_computer", "id": "release_reference_computer","className": "required"},"attributes": {"data-enhanced": "true"},"logic": {"label":"Request for Computer", "label_i18n":"page_dict.services.instance_server", "options":[{"value":"", "text": "", "selected": "true"}, {"value": "Cortana", "text": "Cortana"},{"value": "Prof. Simon Wright", "text": "Prof. Simon Wright"},{"value": "HAL", "text": "HAL"},{"value": "Computer", "text": "Computer"},{"value": "Lawnmower", "text": "Lawnmower"}]}},
{"type":"select", "direct":{"name": "release_reference_network", "id": "release_reference_network", "className": "required"},"attributes": {"data-enhanced": "true"},"logic": {"label":"Request for Network", "label_i18n":"page_dict.services.instance_network", "options":[{"value":"", "text": "", "selected": "true"}, {"value": "Foo-Net", "text": "Foo-Net"},{"value": "Bar-Net", "text": "Bar-Net"},{"value": "Lawn", "text": "Lawn"}]}}
]
},
{
"position": "right",
"fieldlist": [
{"title": "release_image_url"},
{"title": "release_image_type", "overrides": {"widget": {"hidden":true}}},
{"title": "release_image_url", "overrides": {"type": "StringField", "widget": {"hidden": true}}},
{"title": "release_detail_description", "overrides": {"properties": {"required": true, "editable":false}}}
]
},
{
"position": "center",
"fieldlist": [
{"type": "textarea", "direct": {"name": "release_xml_recipe", "id": "release_xml_recipe", "className": "required", "value": "<?xml version='1.0' encoding='utf-8'?>\n<instance>\n</instance>"}, "attributes": {"data-enhanced":"true"}, "logic": {"label":"Instance Configuration", "label_i18n":"page_dict.services.instance_recipe"}}
]
}
]
}
],
"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": "page_dict.person.register",
"data-icon": "edit"
},
"logic": {"text":"Register"}
}
]
}
]
}
}
}
{
"portal_type_source": "Service",
"portal_type_title": "service",
"portal_type_fields": "service_fieldlist",
"form": true,
"id": "service_statusbox",
"property_dict": {
"dynamic_children": [0],
"wrap_gadget": 2,
"layout": {
"header": [
[
{"column": "service_status", "show": true, "priority": 5},
{"column": "service_title", "show": true, "priority": 5},
{"column": "service_image_url", "show": true, "priority": 2},
{"column": "service_state", "show": true, "priority": 3}
]
],
"body": [
{"column": "service_status", "show": true, "priority": 5},
{"column": "service_title", "show": true, "priority": 5},
{"column": "service_image_url", "show": true, "priority": 2, "image": true},
{"column": "service_state", "show": true, "priority": 3}
],
"footer": []
},
"feature_dict": {}
},
"children": [{
"generate": "widget",
"type": "table",
"class_list": "table-stroke ui-responsive",
"property_dict": {
"mode": "columntoggle",
"toggle_popup": false,
"wrap": "both",
"top_grid": 1,
"bottom_grid": 1
},
"children": []
}, {
"type": "a",
"direct": {"href": "#", "className": "action translate right error status ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-left ui-icon-trash"},
"attributes": {"data-i18n":"page_dict.services.destroy", "data-action": "destroy"},
"logic": {"text":"Destroy"}
}
],
"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"}
}
]
}
]
}
}
}
......@@ -27,11 +27,12 @@
"theme": "slapos-white",
"layout": {
"default": [
{
"generate": "gadget",
"type": "listgrid",
"id": "service_status",
"href": "service_status"
"type": "listbox",
"id": "service_statusbox",
"href": "service_statusbox"
}
],
"add": [
......
......@@ -3323,6 +3323,7 @@
snippet;
// cell action buttons
// TODO: need help here once fully converting to promises
if ((field.action_list && field.action_list.length)) {
group = {
"generate": "widget",
......@@ -3371,8 +3372,8 @@
"data-reference": field.href ? null : spec.config.reference,
"data-column-title": field.href ? null : field.column,
"text": title || null,
"img": field.image ?
{"href": field.image, "alt": null, "alt_i18n": null} :
"img": field.image ? (typeof field.image === "string" ?
{"href": field.image, "alt": ""} : field.image) :
null,
"href": field.href || null,
"data-i18n": field.href ? null : (field.text_i18n ?
......@@ -3383,7 +3384,12 @@
// image
} else if (field.image) {
logic.img = field.image;
// we may get a href only
if (typeof field.image === "string") {
logic.img = {"href": field.image, "alt": ""}
} else {
logic.img = field.image;
}
// default
} else {
......@@ -3854,7 +3860,7 @@
{},
{
"data-i18n": pic.alt_i18n ? ("[alt]" + pic.alt_i18n) : null,
"alt": pic.alt || null
"alt": pic.alt || ""
}
));
}
......
......@@ -37,7 +37,8 @@
"register": "Register",
"create": "Create Instance",
"install": "Install",
"request": "Request"
"request": "Request",
"update": "Update"
},
"export_dict": {
"download": "Download"
......@@ -114,7 +115,8 @@
"instance_recipe": "Instance Configuration",
"instance_server": "Computer",
"instance_network": "Network",
"configuration": "Configuration"
"configuration": "Configuration",
"destroy": "Destroy"
},
"networks": {
"no_servers": "No servers associated with this network.",
......@@ -193,6 +195,10 @@
},
"service_dict": {
"field_list": {
"state": {
"title": "State",
"description": "The state of this service."
},
"recipe": {
"title": "XML Parameters",
"description": "The xml configuration for this service instance."
......
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