From b73e14be92fa1bffb7d1b73e46fc43e0c8c9782d Mon Sep 17 00:00:00 2001 From: Ken Fukuyama Date: Thu, 23 Aug 2018 21:17:22 +0900 Subject: [PATCH] Automatically select 'Download' for store functions This minor fix selects the 'Download' radio button by default if the function has a label with `com.openfaas.ui.ext`. Closes #827 Signed-off-by: Ken Fukuyama --- gateway/assets/index.html | 4 ++-- gateway/assets/script/bootstrap.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gateway/assets/index.html b/gateway/assets/index.html index 739add10..8ac8dc48 100644 --- a/gateway/assets/index.html +++ b/gateway/assets/index.html @@ -158,8 +158,8 @@ Text - JSON - Download + JSON + Download diff --git a/gateway/assets/script/bootstrap.js b/gateway/assets/script/bootstrap.js index ede2affe..fdbd74fc 100644 --- a/gateway/assets/script/bootstrap.js +++ b/gateway/assets/script/bootstrap.js @@ -225,7 +225,11 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f $scope.invocationResponse = ""; $scope.invocationStatus = ""; $scope.invocationInProgress = false; - $scope.invocation.contentType = "text"; + if (fn.labels && fn.labels['com.openfaas.ui.ext']) { + $scope.invocation.contentType = "binary"; + } else { + $scope.invocation.contentType = "text"; + } $scope.invocation.roundTripDuration = ""; } };