You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/05/15 07:21:53 UTC
[24/52] [abbrv] incubator-kylin git commit: new model GUI
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a2f4d320/webapp/app/partials/modelDesigner/model_measures.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/modelDesigner/model_measures.html b/webapp/app/partials/modelDesigner/model_measures.html
index 88b7baf..74bf9ae 100644
--- a/webapp/app/partials/modelDesigner/model_measures.html
+++ b/webapp/app/partials/modelDesigner/model_measures.html
@@ -17,19 +17,13 @@
-->
<!-- Measures Summary -->
-<div class="dataTables_wrapper form-inline no-footer" ng-if="model.metrics.length > 0">
- <div class="row">
- <span class="nav-search input-icon input-icon-right" style="margin-left: 22px;">
- <input type="text" placeholder="Filter ..." class="nav-search-input" ng-model="state.dimensionFilter"/>
- <i class="ace-icon fa fa-search nav-search-icon"></i>
- </span>
- </div>
- <table class="table table-striped table-hover">
+<div class="dataTables_wrapper form-inline no-footer">
+
+ <table ng-if="state.mode=='view'" class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Column</th>
- <th ng-if="state.mode=='edit'">Actions</th>
</tr>
</thead>
<tbody>
@@ -42,144 +36,18 @@
<!--Name -->
<span tooltip="measure name..">{{measure}}</span>
</td>
- <td ng-if="state.mode=='edit'">
- <!--Edit Button -->
- <button class="btn btn-xs btn-info" ng-click="addNewMeasure(measure)">
- <i class="fa fa-pencil"></i>
- </button>
- <!--Remove Button -->
- <button class="btn btn-xs btn-danger" ng-click="removeElement(cubeMetaFrame.measures, measure)">
- <i class="fa fa-trash-o"></i>
- </button>
- </td>
</tr>
</tbody>
</table>
-</div>
-
-<!--Add Measures Button-->
-<div class="form-group">
- <button class="btn btn-sm btn-info" ng-click="addNewMeasure()" ng-show="state.mode=='edit' && !newMeasure">
- <i class="fa fa-plus"></i> Measure
- </button>
-</div>
-
-<!--Edit Measure-->
-<ng-form name="edit_mes_form">
-<div class="box box-solid" ng-if="newMeasure">
- <div class="box-header">
- <h4 class="box-title text-info">Edit Measure</h4>
- </div>
- <div class="box-body">
- <div class="row">
- <div class="col-xs-8">
- <!--Name-->
- <div class="form-group">
- <div class="row">
- <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default"><b>Name</b></label>
- <div class="col-xs-12 col-sm-6">
- <input type="text" placeholder="Name.." class="form-control"
- tooltip="measure name.." tooltip-trigger="focus"
- ng-model="newMeasure.name" required />
- </div>
- </div>
- </div>
- <!--Expression-->
- <div class="form-group">
- <div class="row">
- <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default"><b>Expression</b></label>
- <div class="col-xs-12 col-sm-6">
- <select class="form-control"
- ng-init="newMeasure.function.expression = (!!newMeasure.function.expression)?newMeasure.function.expression:cubeConfig.dftSelections.measureExpression" chosen ng-model="newMeasure.function.expression" required
- ng-change="measureReturnTypeUpdate();"
- ng-options="me as me for me in cubeConfig.measureExpressions">
- <option value=""></option>
- </select>
- </div>
- </div>
- </div>
- <!--Param Type-->
- <div class="form-group">
- <div class="row">
- <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default"><b>Param Type</b></label>
- <div class="col-xs-12 col-sm-6">
- <select class="form-control" ng-if="newMeasure.function.expression != 'COUNT'"
- ng-init="newMeasure.function.parameter.type=(!!newMeasure.function.parameter.type)?newMeasure.function.parameter.type: 'column' "
- chosen ng-model="newMeasure.function.parameter.type" required
- ng-options="mpt as mpt for mpt in cubeConfig.measureParamType">
- <option value=""></option>
- </select>
- <span class="font-color-default"
- ng-if="newMeasure.function.expression == 'COUNT'"
- ng-init="newMeasure.function.parameter.type= 'constant' "><b> constant</b>
- </span>
- </div>
- </div>
- </div>
- <!--Param Value-->
- <div class="form-group">
- <div class="row">
- <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default"><b>Param Value</b></label>
- <div class="col-xs-12 col-sm-6">
- <span class="font-color-default"
- ng-if="newMeasure.function.parameter.type == 'constant'"
- ng-init="newMeasure.function.parameter.value = 1"><b> 1</b></span>
- <select class="form-control" chosen
- ng-if="newMeasure.function.parameter.type == 'column'"
- ng-model="newMeasure.function.parameter.value"
- ng-change="measureReturnTypeUpdate();"
- ng-options="columns.name as columns.name for columns in getColumnsByTable(metaModel.model.fact_table)" >
- <option value="">-- Select a Fact Table Column --</option>
- </select>
- </div>
- </div>
- </div>
- <!--Return Type-->
- <div class="form-group">
- <div class="row">
- <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default"><b>Return Type</b></label>
- <div class="col-xs-12 col-sm-6">
- <select class="form-control"
- ng-if="newMeasure.function.expression == 'COUNT_DISTINCT'"
- ng-init="newMeasure.function.returntype = (!!newMeasure.function.returntype)?newMeasure.function.returntype:cubeConfig.dftSelections.distinctDataType.value"
- chosen ng-model="newMeasure.function.returntype" required
- ng-options="ddt.value as ddt.name for ddt in cubeConfig.distinctDataTypes">
- <option value=""></option>
- </select>
- <span class="font-color-default"
- ng-if="newMeasure.function.expression != 'COUNT_DISTINCT'"
- ><b> {{newMeasure.function.returntype | uppercase}}</b>
- </span>
- </div>
- </div>
- </div>
- </div>
-
- <!--Tips-->
- <div class="col-xs-4">
- <div class="box box-solid">
- <div class="box-header">
- <h4 class="box-title">Tips</h4>
- </div>
- <div class="box-body">
- <div class="row">
- <div class="col-xs-12">
- <ol class="text-info">
- <li>All cubes have to contain one measure for Count(1), suggest use "_Count_" as name (Has been generated automatically)</li>
- <li>Only accept single column in param value with "Column" type</li>
- <li>Distinct Count is approximate, please indicate Error Rate, higher accuracy degree accompanied with larger storage size and longer build time</li>
- </ol>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="box-footer">
- <button class="btn btn-sm btn-info" ng-disabled="edit_mes_form.$invalid"
- ng-click="saveNewMeasure()" ng-show="state.mode=='edit'">OK</button>
- <button class="btn btn-link" ng-click="clearNewMeasure()">Cancel</button>
+ <div ng-if="state.mode=='edit'" class="form-group" style="width: 100%">
+ <h3 class="box-title">Select your measures</h3>
+ <select style="width: 100%"
+ ng-model="model.metrics" chosen multiple
+ ng-change=""
+ ng-options="measure.name as measure.name for measure in getColumnsByTable(model.fact_table)">
+ <option value=""></option>
+ </select>
</div>
</div>
+
</ng-form>
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a2f4d320/webapp/app/partials/models/model_edit.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/models/model_edit.html b/webapp/app/partials/models/model_edit.html
index 82d0348..d0c9814 100644
--- a/webapp/app/partials/models/model_edit.html
+++ b/webapp/app/partials/models/model_edit.html
@@ -24,8 +24,7 @@
<form role="form" name="cube_form" novalidate>
<!-- This margin in order to align with table tree in left part -->
<div style="margin-top: 20px;">
- <div ng-include="'partials/models/model_schema.html'" ng-controller="ModelSchemaCtrl"
- ng-init="state={mode:'edit', modelName: routeParams.modelName}">
+ <div ng-include="'partials/models/model_schema.html'" ng-controller="ModelSchemaCtrl">
</div>
</div>
</form>
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/a2f4d320/webapp/app/partials/models/model_schema.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/models/model_schema.html b/webapp/app/partials/models/model_schema.html
index ab9564a..0cd0b5e 100644
--- a/webapp/app/partials/models/model_schema.html
+++ b/webapp/app/partials/models/model_schema.html
@@ -18,7 +18,7 @@
<div class="box box-primary">
<div class="box-header widget-header-blue widget-header-flat">
- <h4 class="box-title text-info">Cube Designer</h4>
+ <h4 class="box-title text-info">Model Designer</h4>
</div>
<div class="box-body">
<ng-form name="design_form" ng-submit="">
@@ -43,21 +43,21 @@
<div class="col-xs-8">
<p style="color: #808080;text-align: left;"><b>Note:</b> inputs with <span style="color: lightblue">light blue</span> border are mandatory.</p>
<div>
- <a href="cubes" class="pull-left"><i class="fa fa-arrow-left"></i> Back to My Cubes</a>
+ <a href="models" class="pull-left"><i class="fa fa-arrow-left"></i> Back to My Models</a>
</div>
</div>
<div class="col-xs-4">
- <button class="btn btn-prev" ng-click="preView()" ng-show="curStep.title!='Cube Info'">
+ <button class="btn btn-prev" ng-click="preView()" ng-show="curStep.title!='Model Info'">
<i class="ace-icon fa fa-arrow-left"></i>
Prev
</button>
<button id="nextButton" class="btn btn-success btn-next" ng-click="nextView()" ng-disabled="design_form.$invalid"
- ng-show="curStep.title!='Overview'">
+ ng-show="curStep.title!='Settings'">
Next
<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
</button>
- <button class="btn btn-primary" ng-click="prepareCube();saveCube(design_form)" ng-disabled="design_form.$invalid"
- ng-if="curStep.title=='Overview' && state.mode=='edit'">
+ <button class="btn btn-primary" ng-click="prepareModel();saveModel(design_form)" ng-disabled="design_form.$invalid"
+ ng-if="curStep.title=='Settings' && state.mode=='edit'">
Save
</button>
</div>