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 <kenfdev@gmail.com>
This commit is contained in:
Ken Fukuyama
2018-08-23 21:17:22 +09:00
committed by Alex Ellis
parent b3a71b456a
commit b73e14be92
2 changed files with 7 additions and 3 deletions

View File

@ -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 = "";
}
};