From 265fa4c0f2126072e668caa708f39a19e19b7c26 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 16 Dec 2021 16:02:54 -0800 Subject: [PATCH] retired the tools menu, added help menu #184 --- docs/MANAGED_INSTANCES.md | 2 +- source/html/index.html | 15 ++++++++++++--- source/html/js/app/plugins.js | 6 ------ source/html/js/app/statemachine.js | 4 ++-- source/html/js/app/tools/build_numbers.js | 16 ++-------------- source/html/js/app/ui/help_menu.js | 22 ++++++++++++++++++++++ 6 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 source/html/js/app/ui/help_menu.js diff --git a/docs/MANAGED_INSTANCES.md b/docs/MANAGED_INSTANCES.md index 7261741a..c2ea636e 100644 --- a/docs/MANAGED_INSTANCES.md +++ b/docs/MANAGED_INSTANCES.md @@ -42,7 +42,7 @@ To override the default: ## Tagging SSM Managed EC2 and Hybrid Resources -Refer to [this guide]( https://github.com/awslabs/aws-media-services-application-mapper/blob/master/RESOURCE_TAGS.md#ssm-managed-ec2-and-hybrid-resources) on tagging your managed instance resources. +Refer to [this guide]( https://github.com/awslabs/aws-media-services-application-mapper/blob/main/docs/RESOURCE_TAGS.md#ssm-managed-ec2-and-hybrid-resources) on tagging your managed instance resources. ## [Support for Elemental Live Encoders](#support-for-elemental-live-encoders) diff --git a/source/html/index.html b/source/html/index.html index 99e1f576..0b68ceca 100644 --- a/source/html/index.html +++ b/source/html/index.html @@ -201,11 +201,20 @@ diff --git a/source/html/js/app/plugins.js b/source/html/js/app/plugins.js index 04645acb..45220806 100644 --- a/source/html/js/app/plugins.js +++ b/source/html/js/app/plugins.js @@ -40,12 +40,6 @@ define({ "app/mappers/connections/medialive_channel_input", "app/mappers/connections/medialive_channel_mediaconnect_flow", ], - "tools": [ - "app/tools/build_numbers", - "app/tools/clear_http", - "app/tools/cross_region", - "app/tools/duplicate_names" - ], "overlays": [ "app/ui/overlays/mediaconnect_flow", "app/ui/overlays/medialive_channel", diff --git a/source/html/js/app/statemachine.js b/source/html/js/app/statemachine.js index 03168211..ed0d8420 100644 --- a/source/html/js/app/statemachine.js +++ b/source/html/js/app/statemachine.js @@ -224,9 +224,9 @@ define(["app/connections", "app/regions", "app/model", "app/ui/settings_menu", " "app/ui/search_view", "app/ui/selected_item_view", "app/ui/tile_view", - "app/ui/tools_menu", "app/ui/information_compartment", - "app/ui/user_defined" + "app/ui/user_defined", + "app/ui/help_menu" ]); // show the tiles tab $("#channel-tiles-tab").tab('show'); diff --git a/source/html/js/app/tools/build_numbers.js b/source/html/js/app/tools/build_numbers.js index 85b8640d..f6a1e5bd 100644 --- a/source/html/js/app/tools/build_numbers.js +++ b/source/html/js/app/tools/build_numbers.js @@ -16,18 +16,7 @@ define(["jquery", "app/api_check", "app/build", "app/connections"], var api_key = current_connection[1]; var app_stamp = build.get_version(); check.ping(endpoint, api_key).then(function(response) { - var api_stamp = Number.parseInt(response.buildstamp); - var browser_stamp = Number.parseInt(app_stamp); - var delta_stamp = Math.abs(api_stamp - browser_stamp); - if (Number.isNaN(delta_stamp)) { - delta_stamp = 0; - } - var badge = `Info`; - if (delta_stamp >= tolerance) { - badge = `Warning`; - } - var warning = `${badge} Browser and Endpoint build timestamps are ${Math.round(delta_stamp / (3600 * 24))} days apart.`; - var message = ` + var message = `

This tool shows the build numbers for the currently running browser application and the currently connected endpoint.

@@ -46,11 +35,10 @@ define(["jquery", "app/api_check", "app/build", "app/connections"], - +
2 Endpoint API${response.buildstamp}${response.version}
-

${warning}

`; resolve({ name: name, diff --git a/source/html/js/app/ui/help_menu.js b/source/html/js/app/ui/help_menu.js new file mode 100644 index 00000000..153ef8a9 --- /dev/null +++ b/source/html/js/app/ui/help_menu.js @@ -0,0 +1,22 @@ +/*! Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + SPDX-License-Identifier: Apache-2.0 */ + +define(["jquery", "app/tools/build_numbers"], function($, build_numbers) { + + $("#build-version-button").on("click", function(event) { + build_numbers.run().then(function (result) { + var alert_class = result.success ? "alert-success" : "alert-danger"; + var prefix = result.success ? "Passed" : "Failed"; + var html = ``; + $("#tool_output_modal_title").html(html); + $("#tool_output_modal_message").html(result.message); + $("#tool_output_modal").modal('show'); + }).catch(function (error) { + var alert_class = "alert-danger"; + var html = ``; + $("#tool_output_modal_title").html(html); + $("#tool_output_modal_message").html(error); + $("#tool_output_modal").modal('show'); + }) + }); +});