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

View File

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

View File

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

View File

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

View File

@ -32,5 +32,23 @@
];
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>
<span class="hz-icon-required fa fa-asterisk"></span>
</label>
<input name="template-spark-version" type="text" class="form-control" id="template-spark-version"
ng-model="model.newTemplateSpec.spark_version"
ng-required="true"
placeholder="{$ 'Version of Apache Spark.'|translate $}">
<div class="form-field">
<div class="btn-group">
<label class="btn btn-default"
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 class="col-xs-12">

View File

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