[jb] Auto select the first cluster if possible at init
@@ -2664,6 +2664,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
};
self.createCluster = function() {
+ if (self.interface().indexOf('dataeng') != -1) {
$.post("/metadata/api/dataeng/create_cluster/", {
"cluster_name": "cluster_name",
"cdh_version": "CDH515",
@@ -2677,8 +2678,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
$(document).trigger("info", ko.mapping.toJSON(data));
self.updateJobs();
});
- }
-
+ } else {
self.createDataWarehouseCluster = function() {
$.post("/metadata/api/analytic_db/create_cluster/", {
"cluster_name": "cluster_name",
@@ -2694,6 +2694,8 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
self.updateJobs();
});
}
+ }
+ }
self.control = function (action) {
if (action == 'rerun') {
@@ -2764,8 +2766,16 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
self.clusterType = ko.observable();
self.isMini = ko.observable(false);
+ self.availableComputes = ko.observableArray();
+ self.availableComputes.subscribe(function(newValue) {
+ if (newValue.length > 0 && !self.compute()) {
+ self.compute(self.availableComputes()[0]);
+ }
+ });
self.compute = ko.observable();
+ ContextCatalog.getComputes({ sourceType: 'jobs' }).done(self.availableComputes);
+
self.availableInterfaces = ko.pureComputed(function () {
var jobsInterfaceCondition = function () {
return self.appConfig() && self.appConfig()['browser'] && self.appConfig()['browser']['interpreter_names'].indexOf('yarn') != -1 && self.clusterType() != '${ ANALYTIC_DB }' && (!self.compute() || self.compute()['type'].indexOf('altus') == -1);
