918 lines
35 KiB
Plaintext
918 lines
35 KiB
Plaintext
{
|
|
"custom": {
|
|
"api_region_name": "eu",
|
|
"api_stage": "prod",
|
|
"enable_site_selection": true,
|
|
"help_url": "https://w.amazon.com/bin/view/EURME/MAP/Projects/Amazon_SCADA/Expanding_BU_and_New_Regions_SCADA/AMZL/DeveloperGuide/#H7.1SCADAFileManagementUtility",
|
|
"image_file_container_basis": "50%",
|
|
"image_file_content_shown": true,
|
|
"image_file_prefix": "SCADA//images/",
|
|
"image_file_suffix": ".svg",
|
|
"instances_file_prefix": "SCADA/EWR4/instance_configs/",
|
|
"loading": false,
|
|
"migrate_enabled": false,
|
|
"selected_image": null,
|
|
"selected_whid": "",
|
|
"site_folder": "SCADA//",
|
|
"site_image_list": [],
|
|
"site_source_list": [],
|
|
"source_file_container_basis": "50%",
|
|
"source_file_content_shown": true,
|
|
"source_file_prefix": "SCADA//source/",
|
|
"source_file_suffix": ".drawio",
|
|
"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"
|
|
},
|
|
"title_text": "S3 File Management",
|
|
"upload_enabled": true,
|
|
"user_roles": [
|
|
"rme-ctrl-map-all",
|
|
"rme-ctrl-all",
|
|
"rme-grt-all",
|
|
"na-rme-all",
|
|
"watrmecomms-l4-l8-bb-all",
|
|
"eurme-ignition-developers",
|
|
"eurme-ignition-admins",
|
|
"eurme-ignition-managers",
|
|
"eurme-ignition-users",
|
|
"maplab-rme-all",
|
|
"eurme-ignition-ae-india"
|
|
],
|
|
"whid": ""
|
|
},
|
|
"events": {
|
|
"system": {
|
|
"onStartup": {
|
|
"config": {
|
|
"script": "\tselected_image \u003d self.params.selected_image\n\tself.custom.selected_image \u003d selected_image\n\tselected_site \u003d self.params.selected_site\n\tif not selected_site:\n\t\tselected_site \u003d self.custom.whid\n\tself.custom.selected_whid \u003d selected_site"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"params": {
|
|
"selected_image": null,
|
|
"selected_site": null
|
|
},
|
|
"propConfig": {
|
|
"custom.api_region_name": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.aws.prefix"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.api_stage": {
|
|
"persistent": true
|
|
},
|
|
"custom.enable_site_selection": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "isAuthorized(false, \u0027Authenticated/Roles/eurme-ignition-developers\u0027)"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.help_url": {
|
|
"persistent": true
|
|
},
|
|
"custom.image_file_container_basis": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if(!{view.custom.image_file_content_shown},\u0027auto\u0027,\r\n\tif({view.custom.source_file_content_shown},\u002750%\u0027,\u0027100%\u0027))"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.image_file_content_shown": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "/root/FlexContainer File Configs/Image File Config.props.params.content_shown"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.image_file_prefix": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{view.custom.site_folder}+\u0027images/\u0027"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.image_file_suffix": {
|
|
"persistent": true
|
|
},
|
|
"custom.loading": {
|
|
"persistent": true
|
|
},
|
|
"custom.migrate_enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{view.custom.flow_view_edit_mode.reviewer_enabled}\r\n\u0026\u0026!isNull({view.custom.stage_source})\r\n\u0026\u0026len({view.custom.stage_source})\r\n\u0026\u0026!isNull({view.custom.stage_destination})\r\n\u0026\u0026len({view.custom.stage_destination})"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.selected_image": {
|
|
"persistent": true
|
|
},
|
|
"custom.selected_whid": {
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\t# DEVNOTE: During peer review, noticed that when files are selected and then \n\t# the whid is changed, that a loop of file updates can be triggered\n\t# therefore, clear the \"selected_image\" custom prop on whid change\n\tself.custom.selected_image \u003d None\n\t"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.site_folder": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "stringFormat(\u0027SCADA/%s/\u0027, {view.custom.selected_whid})"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.site_image_list": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_whid"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tif not value:\n\t\treturn []\n\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(api_region_name\u003dapi_region_name, username\u003dusername)\n\t\n\tsite \u003d value\n\tbucket \u003d self.custom.stage_config.repo_bucket\n\t\n\treturn s3m.fetch_object_list_by_site_and_bucket(site, bucket)",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.site_source_list": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_whid"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tif not value:\n\t\treturn []\n\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(api_region_name\u003dapi_region_name, username\u003dusername)\n\t\n\tsite \u003d value\n\tbucket \u003d self.custom.stage_config.source_bucket\n\t\n\treturn s3m.fetch_object_list_by_site_and_bucket(site, bucket)",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.source_file_container_basis": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if(!{view.custom.source_file_content_shown},\u0027auto\u0027,\r\n\tif({view.custom.image_file_content_shown},\u002750%\u0027,\u0027100%\u0027))"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.source_file_content_shown": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "/root/FlexContainer File Configs/Source File Config.props.params.content_shown"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.source_file_prefix": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{view.custom.site_folder}+\u0027source/\u0027"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.source_file_suffix": {
|
|
"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.title_text": {
|
|
"persistent": true
|
|
},
|
|
"custom.upload_enabled": {
|
|
"persistent": true
|
|
},
|
|
"custom.user_roles": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.props.auth.user.roles"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.whid": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.fc"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"params.selected_image": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.selected_site": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 825,
|
|
"width": 1200
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Header"
|
|
},
|
|
"position": {
|
|
"grow": 1
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"opacity": "0.73",
|
|
"overflow": "auto",
|
|
"textShadow": "#AAAAAA 1px 2px 2px"
|
|
},
|
|
"text": "S3 SCADA File Management",
|
|
"textStyle": {
|
|
"fontSize": 30,
|
|
"textAlign": "center"
|
|
}
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"newTab": true,
|
|
"url": "{view.custom.help_url}"
|
|
},
|
|
"scope": "C",
|
|
"type": "nav"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Icon",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"text": "View documentation for this tool"
|
|
}
|
|
},
|
|
"position": {
|
|
"basis": "30px"
|
|
},
|
|
"props": {
|
|
"path": "material/help_outline",
|
|
"style": {
|
|
"cursor": "pointer"
|
|
}
|
|
},
|
|
"type": "ia.display.icon"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "30px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"direction": "column"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Header"
|
|
},
|
|
"position": {
|
|
"basis": "75px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": "Framework/Card/Title_transparent",
|
|
"textTransform": "capitalize"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Folder Config"
|
|
},
|
|
"position": {
|
|
"basis": "50%",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.params.params.enables.site": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.enable_site_selection"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.image_count": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "try(len({view.custom.site_image_list}),0)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.params.params.selected_whid": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_whid"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.source_count": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "try(len({view.custom.site_source_list}),0)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"params": {
|
|
"open_expanded": true,
|
|
"params": {
|
|
"enables": {}
|
|
},
|
|
"path": "Objects/Templates/S3/Management/manage",
|
|
"show_box_shadow_on_expanded": true,
|
|
"title": "Bucket Configuration",
|
|
"useDefaultHeight": false,
|
|
"useDefaultWidth": false
|
|
},
|
|
"path": "Framework/Card/Card_Collapsible_Transparent"
|
|
},
|
|
"type": "ia.display.view"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Site Config"
|
|
},
|
|
"position": {
|
|
"basis": "50%",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.params.params.enables.site": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.enable_site_selection"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.image_count": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "try(len({view.custom.site_image_list}),0)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.params.params.selected_whid": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_whid"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.source_count": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "try(len({view.custom.site_source_list}),0)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"params": {
|
|
"open_expanded": true,
|
|
"params": {
|
|
"enables": {}
|
|
},
|
|
"path": "Objects/Templates/S3/Management/site",
|
|
"show_box_shadow_on_expanded": true,
|
|
"title": "Site Configuration",
|
|
"useDefaultHeight": false,
|
|
"useDefaultWidth": false
|
|
},
|
|
"path": "Framework/Card/Card_Collapsible_Transparent"
|
|
},
|
|
"type": "ia.display.view"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer Site"
|
|
},
|
|
"position": {
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Image File Config"
|
|
},
|
|
"position": {
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"position.basis": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.image_file_container_basis"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.bucket": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.stage_config.repo_bucket"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.enables.delete": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.upload_enabled"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.enables.upload": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.upload_enabled"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.files": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.site_image_list"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.prefix": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.image_file_prefix"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.selected_file": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_image"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.suffix": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.image_file_suffix"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.whid": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_whid"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"params": {
|
|
"anchor_position": "left",
|
|
"content_shown": true,
|
|
"open_expanded": true,
|
|
"params": {
|
|
"enables": {
|
|
"download": true,
|
|
"file": true,
|
|
"object_key": false
|
|
},
|
|
"upload_file_types": [
|
|
"svg"
|
|
]
|
|
},
|
|
"path": "Objects/Templates/S3/Management/file",
|
|
"show_box_shadow_on_expanded": true,
|
|
"title": "Image SVG Files",
|
|
"useDefaultHeight": false,
|
|
"useDefaultWidth": false
|
|
},
|
|
"path": "Framework/Card/Card_Collapsible_Transparent_with_Anchor",
|
|
"style": {
|
|
"overflow": "auto"
|
|
}
|
|
},
|
|
"type": "ia.display.view"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Source File Config"
|
|
},
|
|
"position": {
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"position.basis": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.source_file_container_basis"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.bucket": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.stage_config.source_bucket"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.enables.delete": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.upload_enabled"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.enables.upload": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.upload_enabled"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.files": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.site_source_list"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.prefix": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.source_file_prefix"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.selected_file": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_image"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.suffix": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.source_file_suffix"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.params.params.whid": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.selected_whid"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"params": {
|
|
"anchor_position": "right",
|
|
"content_shown": true,
|
|
"open_expanded": true,
|
|
"params": {
|
|
"enables": {
|
|
"download": true,
|
|
"file": true,
|
|
"object_key": false
|
|
},
|
|
"upload_file_types": [
|
|
"drawio"
|
|
]
|
|
},
|
|
"path": "Objects/Templates/S3/Management/file",
|
|
"show_box_shadow_on_expanded": true,
|
|
"title": "Source DRAWIO Files",
|
|
"useDefaultHeight": false,
|
|
"useDefaultWidth": false
|
|
},
|
|
"path": "Framework/Card/Card_Collapsible_Transparent_with_Anchor",
|
|
"style": {
|
|
"overflow": "auto"
|
|
}
|
|
},
|
|
"type": "ia.display.view"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer File Configs"
|
|
},
|
|
"position": {
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"justify": "space-between"
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"newTab": true,
|
|
"url": "{view.custom.help_url}"
|
|
},
|
|
"scope": "C",
|
|
"type": "nav"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button Documentation",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"location": "bottom",
|
|
"text": "View online documentation for this utility"
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/info"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": "4px",
|
|
"padding": "4px"
|
|
},
|
|
"text": "Documentation"
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tsite \u003d self.view.params.selected_site\n\tnull \u003d None\n\tquery_params \u003d {\n\t\t\"copy_option\": null,\n\t\t\"destination_view\": null,\n\t\t\"destination_site\": site,\n\t\t\"destination_bucket\": null,\n\t\t\"end_time\": null,\n\t\t\"error_occurred\": null,\n\t\t\"operation\": null,\n\t\t\"source_view\": null,\n\t\t\"source_site\": null,\n\t\t\"source_bucket\": null,\n\t\t\"start_time\": null,\n\t\t\"username\": self.session.props.auth.user.userName\n\t}\n\t# Open audit log viewer\n\tview_path \u003d \u0027PopUp-Views/S3/Audit/Log_Viewer\u0027\n\tparams \u003d {\u0027query_params\u0027: query_params}\n\tsystem.perspective.openPopup(\u0027Audit Log Viewer\u0027, view_path, \n\t\t\t\t\t\t\t\tparams, \u0027SCADA Audit Logs\u0027)\n\t"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button Audit Log",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"location": "bottom",
|
|
"text": "View SCADA S3 audit logs for current user and site"
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/table_view"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": "4px",
|
|
"padding": "4px"
|
|
},
|
|
"text": "Audit Logs"
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\t# build out the object key from repo bucket, site, selected view, and suffix\n\tbucket \u003d self.view.custom.stage_config.repo_bucket\n\tsite \u003d self.view.params.selected_site\n\tprefix \u003d self.view.custom.source_file_prefix\n\tview \u003d self.view.params.selected_image\n\tsuffix \u003d self.view.custom.image_file_suffix\n\tobj_key \u003d \u0027%s%s%s\u0027 % (prefix, view, suffix)\n\t# build out query params from local variables\n\tquery_params \u003d {\n\t\t\"view\": view,\n\t\t\"object_key\": obj_key,\n\t\t\"site\": site,\n\t\t\"bucket\": bucket\n\t}\n\t# Open version history log viewer\n\tview_path \u003d \u0027PopUp-Views/S3/Versions/Log_Viewer\u0027\n\tparams \u003d {\u0027query_params\u0027: query_params}\n\tsystem.perspective.openPopup(\u0027Version Log Viewer\u0027, view_path, \n\t\t\t\t\t\t\t\tparams, \u0027SCADA S3 Version History Log Viewer\u0027)\n\t\t\t"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button Version History",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"location": "bottom",
|
|
"text": "View SCADA S3 version history for currently selected file"
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/history"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": "4px",
|
|
"padding": "4px"
|
|
},
|
|
"text": "Version History"
|
|
},
|
|
"type": "ia.input.button"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer Buttons"
|
|
},
|
|
"position": {
|
|
"basis": "50px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"justify": "flex-end"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "50px",
|
|
"grow": 1,
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"justify": "flex-end"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"props": {
|
|
"direction": "column"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [
|
|
{
|
|
"name": "show_confirm_dialog",
|
|
"params": [],
|
|
"script": "\t# ~~ 12 PARAMETERS ~~\n\t\t# state\t\t\t\t\t(default \u003d info) empty string uses generic gray styling\n\t\t# title \t\t\t\t(default \u003d Alert Title) empty string sets the title visibility to false\n\t\t# message \t\t\t\t(default \u003d Alert message goes here.)\n\t\t# show close button\t\t(default \u003d true) boolean\n\t\t# btn text primary\t\t(default \u003d \"Primary\")\n\t\t# btn text secondary\t(default \u003d \"Secondary\")\n\t\t# btn icon primary \t\t(default \u003d chevron_right) do not include \u0027material/\u0027 in the path, just the icon name\n\t\t# btn icon secondary \t(default \u003d \"\") do not include \u0027material/\u0027 in the path, just the icon name\n\t\t# btn icon alignment\t(default \u003d \"right\") left or right\n\t\t# btn primary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t\t# btn secondary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t\t# btn close action\t\t(default \u003d \"\") add message handlers on this icon to enable other script actions\n\t\n\t\tmsg \u003d \"Update Instance Configuration for MP%s?\" % (self.view.params.instance.viewParams.mhe_id)\n\t\tAlerts.showAlert(\n\t\t\t\"info\", \n\t\t\t\"Update Instance Config?\", \n\t\t\tmsg, \n\t\t\t\"true\",\n\t\t\t\"Continue\", \n\t\t\t\"Cancel\", \n\t\t\t\"chevron_right\", \n\t\t\t\"\", \n\t\t\t\"right\", \n\t\t\t\"confirm_update_instance_config\", \n\t\t\t\"closePopup\", \n\t\t\t\"closePopup\"\n\t\t)\n\t\t"
|
|
},
|
|
{
|
|
"name": "show_success_dialog",
|
|
"params": [
|
|
"msg\u003dNone"
|
|
],
|
|
"script": "\t# ~~ 13 PARAMETERS ~~\n\t# state\t\t\t\t\t(default \u003d info) empty string uses generic gray styling\n\t# title \t\t\t\t(default \u003d Alert Title) empty string sets the title visibility to false\n\t# message \t\t\t\t(default \u003d Alert message goes here.)\n\t# show close button\t\t(default \u003d true) boolean\n\t# btn text primary\t\t(default \u003d \"Primary\")\n\t# btn text secondary\t(default \u003d \"Secondary\")\n\t# btn icon primary \t\t(default \u003d chevron_right) do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon secondary \t(default \u003d \"\") do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon alignment\t(default \u003d \"right\") left or right\n\t# btn primary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn secondary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn close action\t\t(default \u003d \"\") add message handlers on this icon to enable other script actions\n\t# payload\t\t\t\t(default \u003d {}) add a payload here to return to the target message handler\n\t\n\tAlerts.showAlert(\n\t\t\"success\", \n\t\t\"Instance Updated\", \n\t\tmsg, \n\t\t\"true\",\n\t\t\"OK\", \n\t\t\"CLOSE\", \n\t\t\"\", \n\t\t\"\", \n\t\t\"right\", \n\t\t\"closePopup\", \n\t\t\"closePopup\", \n\t\t\"closePopup\",\n\t\t{}\n\t)\n\t\t"
|
|
},
|
|
{
|
|
"name": "show_warning_dialog",
|
|
"params": [
|
|
"msg\u003dNone"
|
|
],
|
|
"script": "\t# ~~ 12 PARAMETERS ~~\n\t# state\t\t\t\t\t(default \u003d info) empty string uses generic gray styling\n\t# title \t\t\t\t(default \u003d Alert Title) empty string sets the title visibility to false\n\t# message \t\t\t\t(default \u003d Alert message goes here.)\n\t# show close button\t\t(default \u003d true) boolean\n\t# btn text primary\t\t(default \u003d \"Primary\")\n\t# btn text secondary\t(default \u003d \"Secondary\")\n\t# btn icon primary \t\t(default \u003d chevron_right) do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon secondary \t(default \u003d \"\") do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon alignment\t(default \u003d \"right\") left or right\n\t# btn primary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn secondary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn close action\t\t(default \u003d \"\") add message handlers on this icon to enable other script actions\n\n\tAlerts.showAlert(\n\t\t\"warning\", \n\t\t\"Instance Not Updated\", \n\t\tmsg, \n\t\t\"true\",\n\t\t\"OK\", \n\t\t\"CLOSE\", \n\t\t\"\", \n\t\t\"\", \n\t\t\"right\", \n\t\t\"closePopup\", \n\t\t\"closePopup\", \n\t\t\"closePopup\"\n\t)\n\t\t"
|
|
},
|
|
{
|
|
"name": "show_error_dialog",
|
|
"params": [
|
|
"msg\u003dNone"
|
|
],
|
|
"script": "\t# ~~ 12 PARAMETERS ~~\n\t# state\t\t\t\t\t(default \u003d info) empty string uses generic gray styling\n\t# title \t\t\t\t(default \u003d Alert Title) empty string sets the title visibility to false\n\t# message \t\t\t\t(default \u003d Alert message goes here.)\n\t# show close button\t\t(default \u003d true) boolean\n\t# btn text primary\t\t(default \u003d \"Primary\")\n\t# btn text secondary\t(default \u003d \"Secondary\")\n\t# btn icon primary \t\t(default \u003d chevron_right) do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon secondary \t(default \u003d \"\") do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon alignment\t(default \u003d \"right\") left or right\n\t# btn primary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn secondary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn close action\t\t(default \u003d \"\") add message handlers on this icon to enable other script actions\n\n\tAlerts.showAlert(\n\t\t\"error\", \n\t\t\"Instance Update Error!\", \n\t\tmsg, \n\t\t\"true\",\n\t\t\"OK\", \n\t\t\"CLOSE\", \n\t\t\"\", \n\t\t\"\", \n\t\t\"right\", \n\t\t\"closePopup\", \n\t\t\"closePopup\", \n\t\t\"closePopup\"\n\t)\n\t\t"
|
|
},
|
|
{
|
|
"name": "update_bindings",
|
|
"params": [],
|
|
"script": "\tself.view.custom.loading \u003d False\n\t\t"
|
|
}
|
|
],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "update_selected_whid",
|
|
"pageScope": false,
|
|
"script": "\t# implement your handler here\n\tself.view.custom.selected_whid \u003d payload.get(\u0027whid\u0027, None)\n",
|
|
"sessionScope": true,
|
|
"viewScope": true
|
|
},
|
|
{
|
|
"messageType": "update_selected_image",
|
|
"pageScope": false,
|
|
"script": "\t# implement your handler here\n\tself.view.custom.selected_image \u003d payload.get(\u0027image\u0027, None)\n\t",
|
|
"sessionScope": true,
|
|
"viewScope": true
|
|
},
|
|
{
|
|
"messageType": "update_file_binding",
|
|
"pageScope": false,
|
|
"script": "\t# update the appropriate binding to fetch an updated dataset of S3 objects,\n\t# depending upon which bucket was updated\n\tbucket \u003d payload.get(\u0027bucket\u0027, None)\n\tif bucket \u003d\u003d self.view.custom.stage_config.repo_bucket:\n\t\tself.view.refreshBinding(\u0027custom.site_image_list\u0027)\n\tif bucket \u003d\u003d self.view.custom.stage_config.source_bucket:\n\t\tself.view.refreshBinding(\u0027custom.site_source_list\u0027)",
|
|
"sessionScope": true,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
} |