<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->

  <script type="text/ng-template" id="addHiveTable.html">
    <div class="modal-header">
      <h4>Load Table Metadata</h4>
    </div>
    <div class="modal-body">
      <span><strong>Project: </strong>{{ $parent.projectName!=null?$parent.projectName:'NULL'}}</span>
      <label for="tables"> Table Names:(Separate with comma)</label>
            <textarea ng-model="$parent.tableNames" class="form-control" id="tables"
                      placeholder="table1,table2  By default,system will choose 'Default' as database,you can specify database like this 'database.table'"></textarea>
      <label ng-if="sourceType === '0'"> <input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
    </div>
    <div class="modal-footer">
      <button class="btn btn-primary" ng-click="add()">Sync</button>
      <button class="btn btn-primary" ng-click="cancel()">Cancel</button>
    </div>
  </script>

  <script type="text/ng-template" id="addStreamingSource.html">

    <div class="modal-header">
      <div class="box-header">
        <h3 class="box-title">Streaming Table And Cluster Info</h3>

        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" ng-click="cancel()" data-widget="remove"><i class="fa fa-times"></i></button>
        </div>
      </div>
    </div>

    <div class="modal-body streaming-source" style="height: 660px;overflow-y:auto;">
        <div ng-show="steps.curStep==1" ng-include="'partials/tables/loadStreamingTable.html'"></div>
        <div ng-show="steps.curStep==2" ng-include="'partials/cubeDesigner/streamingConfig.html'"></div>
    </div>
    <div class="modal-footer">
      <div class="row">
        <div class="col-xs-8">
          <div>
          </div>
        </div>
        <div class="col-xs-4">
          <button class="btn btn-prev" ng-click="previewStep();" ng-show="steps.curStep==2">
            <i class="ace-icon fa fa-arrow-left"></i>
            Prev
          </button>
          <button id="nextButton" class="btn btn-success btn-next"  ng-click="nextStep();" ng-show="steps.curStep==1">
            Next
            <i class="ace-icon fa fa-arrow-right icon-on-right"></i>
          </button>
          <button class="btn btn-primary" ng-click="syncStreamingSchema()" ng-show="steps.curStep==2">
            Submit
          </button>
        </div>
      </div>
    </div>
  </script>


<script type="text/ng-template" id="addStreamingSourceV2.html">
  <div ng-show="steps.curStep==1" ng-include="'partials/tables/loadStreamingSourceConfig.html'"></div>
  <div ng-show="steps.curStep==2" ng-include="'partials/tables/loadStreamingTableConfig.html'"></div>
</script>

<script type="text/ng-template" id="editStreamingSource.html">

  <div class="modal-header">
    <div class="box-header">
      <h3 class="box-title">Streaming Table And Cluster Info</h3>

      <div class="box-tools pull-right">
        <button type="button" class="btn btn-box-tool" ng-click="cancel()" data-widget="remove"><i class="fa fa-times"></i></button>
      </div>
    </div>
  </div>

  <div class="modal-body streaming-source" style="height: 660px;overflow-y:auto;">
    <div ng-include="'partials/cubeDesigner/streamingConfig.html'"></div>
  </div>
  <div class="modal-footer">
    <div class="row">
      <div class="col-xs-8">
        <div>
        </div>
      </div>
      <div class="col-xs-4">
        <button class="btn btn-primary" ng-click="updateStreamingSchema()">
          Submit
        </button>
      </div>
    </div>
  </div>
</script>

<script type="text/ng-template" id="reloadTable.html">
  <div class="modal-header">
    <h4>Reload Table Metadata</h4>
  </div>
  <div class="modal-body">
    <span><strong>Project: {{ $parent.projectName!=null?$parent.projectName:'NULL'}}</strong></span><br/>
    <label for="tables"> Are you sure to reload table {{selectTable}} ?</label><br/>
    <label ng-if="sourceType === '0'"><input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
  </div>
  <div class="modal-footer">
    <button class="btn btn-primary" ng-click="confirmReload()">Sync</button>
    <button class="btn btn-primary" ng-click="cancel()">Cancel</button>
  </div>
</script>
