456 lines
13 KiB
Plaintext
456 lines
13 KiB
Plaintext
{
|
|
"custom": {
|
|
"api_region_name": "eu",
|
|
"enabled_whids": [
|
|
"DNK7",
|
|
"EWR4"
|
|
],
|
|
"stage_config": {
|
|
"account_id": "006306898152",
|
|
"api_call_role": "arn:aws:iam::609617486056:role/RMESDScadaS3ManagementAPIcallRole-prod-eu-west-1",
|
|
"endpoint": "https://eu-west-1.scada-s3-management.scada.eurme.amazon.dev/",
|
|
"lambda_name": "RMESDScadaS3ManagementFlaskLambda-prod",
|
|
"region": "eu-west-1",
|
|
"repo_bucket": "ignition-image-repo",
|
|
"s3_region": "eu-west-1",
|
|
"source_bucket": "ignition-image-source"
|
|
},
|
|
"whid_options": [
|
|
{
|
|
"label": "DNK7",
|
|
"value": "DNK7"
|
|
},
|
|
{
|
|
"label": "EWR4",
|
|
"value": "EWR4"
|
|
}
|
|
],
|
|
"whids_in_s3": [
|
|
"BOS3",
|
|
"BRS1",
|
|
"CGN9",
|
|
"DAO1",
|
|
"DAO3",
|
|
"DAR2",
|
|
"DBE2",
|
|
"DBH3",
|
|
"DBI7",
|
|
"DBT3",
|
|
"DCT7",
|
|
"DCT9",
|
|
"DCZ3",
|
|
"DCZ4",
|
|
"DEH1",
|
|
"DER1",
|
|
"DER2",
|
|
"DER3",
|
|
"DER5",
|
|
"DFV1",
|
|
"DHA1",
|
|
"DHE3",
|
|
"DHE4",
|
|
"DHE6",
|
|
"DIF2",
|
|
"DIF6",
|
|
"DIP1",
|
|
"DLO1",
|
|
"DLO2",
|
|
"DLO3",
|
|
"DLO4",
|
|
"DLO5",
|
|
"DLO7",
|
|
"DLZ1",
|
|
"DLZ2",
|
|
"DLZ3",
|
|
"DMA3",
|
|
"DMA4",
|
|
"DMA6",
|
|
"DMV1",
|
|
"DMV3",
|
|
"DMZ2",
|
|
"DMZ4",
|
|
"DNC1",
|
|
"DNC2",
|
|
"DNE2",
|
|
"DNG2",
|
|
"DNM7",
|
|
"DNP1",
|
|
"DNX3",
|
|
"DNZ2",
|
|
"DPI3",
|
|
"DPU1",
|
|
"DRM2",
|
|
"DSI2",
|
|
"DSO2",
|
|
"DSY6",
|
|
"DTC2",
|
|
"DVN1",
|
|
"DVN2",
|
|
"DVN5",
|
|
"DWN2",
|
|
"IST2",
|
|
"MAD6",
|
|
"MAN2",
|
|
"QCB6"
|
|
]
|
|
},
|
|
"params": {
|
|
"enables": {
|
|
"site": true
|
|
},
|
|
"image_count": 0,
|
|
"selected_whid": "EWR4",
|
|
"source_count": 0
|
|
},
|
|
"propConfig": {
|
|
"custom.api_region_name": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.aws.prefix"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.enabled_whids": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{session.custom.fc}"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tchild_projects \u003d config.project_config.get_child_scada_projects()\n\treturn [x.replace(\u0027_SCADA\u0027,\u0027\u0027) for x in child_projects]",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.stage_config": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{view.custom.api_region_name}"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\treturn AWS.s3.STAGE_CONFIG[\u0027prod\u0027][value]",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.whid_options": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.enabled_whids"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\treturn [{\u0027value\u0027: x, \u0027label\u0027: x} for x in value]",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.whids_in_s3": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{session.custom.fc}"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tfrom AWS.s3 import S3Manager\n\t\n\tusername \u003d self.session.props.auth.user.userName\n\tapi_region_name \u003d self.custom.api_region_name\n\t\n\ts3m \u003d S3Manager(\u0027prod\u0027, api_region_name, username)\n\t\n\tbucket \u003d self.custom.stage_config.repo_bucket\n\treturn s3m.fetch_site_list(bucket)",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"params.enables": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.image_count": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.selected_whid": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.source_count": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 78,
|
|
"width": 400
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "125px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"classes": "Framework/Card/Label Text/RightAlign_with_Padding",
|
|
"paddingLeft": "5px"
|
|
},
|
|
"text": "Site:"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tselected_whid \u003d self.props.value\n\tsystem.perspective.sendMessage(\u0027update_selected_whid\u0027, \n\t\t\t\t\t\t\t\t{\u0027whid\u0027: selected_whid}, \n\t\t\t\t\t\t\t\tscope\u003d\u0027session\u0027)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Dropdown",
|
|
"tooltip": {
|
|
"location": "bottom",
|
|
"style": {
|
|
"whiteSpace": "pre"
|
|
},
|
|
"text": "Click here to select a different \nstage folder to manage"
|
|
}
|
|
},
|
|
"position": {
|
|
"basis": "175px",
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.enables.site"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.options": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.whid_options"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.selected_whid"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"margin": "2px",
|
|
"marginRight": "26px"
|
|
}
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer Site Selection"
|
|
},
|
|
"position": {
|
|
"basis": "26px",
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "125px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"classes": "Framework/Card/Label Text/RightAlign_with_Padding",
|
|
"paddingLeft": "5px"
|
|
},
|
|
"text": "Images (SVG):"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "label_LeftAlign"
|
|
},
|
|
"position": {
|
|
"basis": "200px",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.params.text": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.image_count"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"path": "Objects/Templates/Labels/label_LeftAlign",
|
|
"style": {
|
|
"classes": "Framework/Card/Value"
|
|
}
|
|
},
|
|
"type": "ia.display.view"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer Images"
|
|
},
|
|
"position": {
|
|
"basis": "50%",
|
|
"grow": 1
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "125px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"classes": "Framework/Card/Label Text/RightAlign_with_Padding",
|
|
"paddingLeft": "5px"
|
|
},
|
|
"text": "Source (DRAWIO):"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "label_LeftAlign"
|
|
},
|
|
"position": {
|
|
"basis": "200px",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.params.text": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.source_count"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"path": "Objects/Templates/Labels/label_LeftAlign",
|
|
"style": {
|
|
"classes": "Framework/Card/Value"
|
|
}
|
|
},
|
|
"type": "ia.display.view"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer Source"
|
|
},
|
|
"position": {
|
|
"basis": "50%",
|
|
"grow": 1
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer File Counts"
|
|
},
|
|
"position": {
|
|
"basis": "26px",
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "100%",
|
|
"grow": 1
|
|
},
|
|
"props": {
|
|
"direction": "column"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"props": {
|
|
"direction": "column"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [
|
|
{
|
|
"name": "update_wo_view_param",
|
|
"params": [
|
|
"d\u003dNone"
|
|
],
|
|
"script": "\t# helper \"sanitize_tree\" function to make work order view param mutable\n\tfrom helper.helper import sanitize_tree\n\twork_order \u003d sanitize_tree(self.view.params.work_order)\n\t# sanity-check the update dict \"d\"\n\tif d is None or not isinstance(d, dict): d \u003d {}\n\t# update the embedded object inside the work order view param\n\twork_order.get(\u0027data\u0027, {}).get(\u0027WorkOrder\u0027, {}).update(d)\n\t# write the updated work_order object back to view param\n\tself.view.params.work_order \u003d work_order\n\t"
|
|
}
|
|
],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "update_enabled_whids",
|
|
"pageScope": false,
|
|
"script": "\t# implement your handler here\n\tself.view.refreshBinding(\u0027custom.enabled_whids\u0027)\n\tself.view.refreshBinding(\u0027custom.whids_in_s3\u0027)",
|
|
"sessionScope": true,
|
|
"viewScope": true
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
} |