Change field type

Change field type from text to button or listbox.
This commit is contained in:
Hiroyuki Eguchi 2017-01-29 09:33:37 +09:00
parent e21b5ea671
commit c34df76c7a
8 changed files with 74 additions and 20 deletions

View File

@ -6,10 +6,14 @@
<translate>Method</translate> <translate>Method</translate>
<span class="hz-icon-required fa fa-asterisk"></span> <span class="hz-icon-required fa fa-asterisk"></span>
</label> </label>
<input name="learning-method" type="text" class="form-control" id="learning-method" <div class="form-field">
ng-model="model.newLearningSpec.method" <div class="btn-group">
ng-required="true" <label class="btn btn-default"
placeholder="{$ 'Currently, a predict method is only supported.'|translate $}"> ng-repeat="option in ctrl.learningMethodOptions"
ng-model="model.newLearningSpec.method"
uib-btn-radio="option.value">{$ ::option.label $}</label>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">

View File

@ -32,5 +32,11 @@
]; ];
function createLearningSpecController($scope, gettext) { function createLearningSpecController($scope, gettext) {
var ctrl = this;
ctrl.learningMethodOptions = [
{ label: gettext('Predict'), value: 'predict' }
];
} }
})(); })();

View File

@ -19,10 +19,14 @@
<translate>Dataset Format</translate> <translate>Dataset Format</translate>
<span class="hz-icon-required fa fa-asterisk"></span> <span class="hz-icon-required fa fa-asterisk"></span>
</label> </label>
<input name="model_evaluation-dataset-format" type="text" class="form-control" id="model_evaluation-dataset-format" <div class="form-field">
ng-model="model.newModelEvaluationSpec.dataset_format" <div class="btn-group">
ng-required="true" <label class="btn btn-default"
placeholder="{$ 'Dataset Format (csv or libsvm or text).'|translate $}"> ng-repeat="option in ctrl.model_evaluationFormatOptions"
ng-model="model.newModelEvaluationSpec.dataset_format"
uib-btn-radio="option.value">{$ ::option.label $}</label>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">

View File

@ -32,5 +32,12 @@
]; ];
function createModelEvaluationSpecController($scope, gettext) { function createModelEvaluationSpecController($scope, gettext) {
var ctrl = this;
ctrl.model_evaluationFormatOptions = [
{ label: gettext('CSV'), value: 'csv' },
{ label: gettext('LibSVM'), value: 'libsvm' },
{ label: gettext('Text'), value: 'text' }
];
} }
})(); })();

View File

@ -6,10 +6,11 @@
<translate>Model Type</translate> <translate>Model Type</translate>
<span class="hz-icon-required fa fa-asterisk"></span> <span class="hz-icon-required fa fa-asterisk"></span>
</label> </label>
<input name="model-model-type" type="text" class="form-control" id="model-model-type" <select class="form-control"
ng-model="model.newModelSpec.model_type" ng-model="model.newModelSpec.model_type"
ng-required="true" ng-options="item for item in ctrl.modelTypeOptions">
placeholder="{$ 'Prediction Model Type'|translate $}"> </select>
</div>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
@ -41,10 +42,14 @@
<translate>Dataset Format</translate> <translate>Dataset Format</translate>
<span class="hz-icon-required fa fa-asterisk"></span> <span class="hz-icon-required fa fa-asterisk"></span>
</label> </label>
<input name="model-dataset-format" type="text" class="form-control" id="model-dataset-format" <div class="form-field">
ng-model="model.newModelSpec.dataset_format" <div class="btn-group">
ng-required="true" <label class="btn btn-default"
placeholder="{$ 'Dataset Format (csv or libsvm or text).'|translate $}"> ng-repeat="option in ctrl.modelFormatOptions"
ng-model="model.newModelSpec.dataset_format"
uib-btn-radio="option.value">{$ ::option.label $}</label>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">

View File

@ -32,5 +32,23 @@
]; ];
function createModelSpecController($scope, gettext) { function createModelSpecController($scope, gettext) {
var ctrl = this;
ctrl.modelTypeOptions = [
'LogisticRegression',
'DecisionTreeRegression',
'LinearRegression',
'KMeans',
'Recommendation',
'Word2Vec',
'FPGrowth'
];
ctrl.modelFormatOptions = [
{ label: gettext('CSV'), value: 'csv' },
{ label: gettext('LibSVM'), value: 'libsvm' },
{ label: gettext('Text'), value: 'text' }
];
} }
})(); })();

View File

@ -6,10 +6,14 @@
<translate>Spark Version</translate> <translate>Spark Version</translate>
<span class="hz-icon-required fa fa-asterisk"></span> <span class="hz-icon-required fa fa-asterisk"></span>
</label> </label>
<input name="template-spark-version" type="text" class="form-control" id="template-spark-version" <div class="form-field">
ng-model="model.newTemplateSpec.spark_version" <div class="btn-group">
ng-required="true" <label class="btn btn-default"
placeholder="{$ 'Version of Apache Spark.'|translate $}"> ng-repeat="option in ctrl.templateVersionOptions"
ng-model="model.newTemplateSpec.spark_version"
uib-btn-radio="option.value">{$ ::option.label $}</label>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">

View File

@ -32,5 +32,11 @@
]; ];
function createTemplateSpecController($scope, gettext) { function createTemplateSpecController($scope, gettext) {
var ctrl = this;
ctrl.templateVersionOptions = [
{ label: gettext('1.6.0'), value: '1.6.0' }
];
} }
})(); })();