From 3935d3ef9268b43eace51d0f16a3f48a29284405 Mon Sep 17 00:00:00 2001 From: Michael Irwin Date: Fri, 23 Feb 2024 12:46:52 -0500 Subject: [PATCH] Add survey feedback toast and button (#610) --- handlers/www/assets/app.js | 38 +++++++++++++++++++++++++++++++++ handlers/www/default/index.html | 33 ++++++++++++++++++++-------- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/handlers/www/assets/app.js b/handlers/www/assets/app.js index f1e9201..0f1cab7 100644 --- a/handlers/www/assets/app.js +++ b/handlers/www/assets/app.js @@ -847,6 +847,44 @@ return "None"; } }]) + .controller("SurveyToastController", function($mdToast) { + var ctrl = this; + ctrl.openSurvey = function() { + $mdToast.hide("ok"); + } + ctrl.closeToast = function() { + $mdToast.hide(); + } + }) + .component('surveyRequest', { + template : "Give feedback", + controller : function($mdToast, $timeout) { + var $ctrl = this; + + $ctrl.$onInit = function() { + window.$mdToast = $mdToast; + $timeout(function() { + $mdToast.show({ + hideDelay: 0, + position: 'bottom right', + controller: "SurveyToastController", + controllerAs: "ctrl", + bindToControlller: true, + templateUrl: "survey-toast.html" + }).then(function (result) { + if (result === "ok") { + $ctrl.openSurvey(); + } + }); + }, 300000); // Display toast after five minutes + } + + $ctrl.openSurvey = function() { + window.open("https://docker.qualtrics.com/jfe/form/SV_267blbhIjjf3Mma", "_blank"); + } + + }, + }) .service('TerminalService', ['$window', '$rootScope', function($window, $rootScope) { var fullscreen; var fontSize = getFontSize(); diff --git a/handlers/www/default/index.html b/handlers/www/default/index.html index 2669723..234beb2 100644 --- a/handlers/www/default/index.html +++ b/handlers/www/default/index.html @@ -59,17 +59,18 @@ {{newInstanceBtnText}} - - - - -
+ + + + +

{{instance.ip}}

{{instance.hostname}}

-
- -
-
+
+ +
+
+
@@ -227,6 +228,20 @@ +