|
@@ -23,122 +23,156 @@ ${layout.menubar(section='tables')}
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
<div class="container-fluid">
|
|
|
- <h1>Create a new table from file</h1>
|
|
|
|
|
- <div class="row-fluid">
|
|
|
|
|
- <div class="span3">
|
|
|
|
|
- <div class="well sidebar-nav">
|
|
|
|
|
- <ul class="nav nav-list">
|
|
|
|
|
- <li class="nav-header">Actions</li>
|
|
|
|
|
- <li><a href="${ url('beeswax.create_table.import_wizard')}">Create a new table from file</a></li>
|
|
|
|
|
- <li><a href="${ url('beeswax.create_table.create_table')}">Create a new table manually</a></li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="span9">
|
|
|
|
|
- <ul class="nav nav-pills">
|
|
|
|
|
- <li class="active"><a href="${ url('beeswax.create_table.import_wizard') }">Step 1: Choose File</a></li>
|
|
|
|
|
- <li><a href="#">Step 2: Choose Delimiter</a></li>
|
|
|
|
|
- <li><a href="#">Step 3: Define Columns</a></li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <br/>
|
|
|
|
|
- <form action="${action}" method="POST">
|
|
|
|
|
- <fieldset>
|
|
|
|
|
- <legend>Name Your Table and Choose A File</legend>
|
|
|
|
|
- <div class="clearfix">
|
|
|
|
|
- ${comps.label(file_form["name"])}
|
|
|
|
|
- <div class="input">
|
|
|
|
|
- ${comps.field(file_form["name"], attrs=dict(
|
|
|
|
|
- placeholder="table_name",
|
|
|
|
|
- klass=""
|
|
|
|
|
- ))}
|
|
|
|
|
- <span class="help-block">
|
|
|
|
|
- Name of the new table. Table names must be globally unique. Table names tend to correspond as well to the directory where the data will be stored.
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="clearfix">
|
|
|
|
|
- ${comps.label(file_form["comment"])}
|
|
|
|
|
- <div class="input">
|
|
|
|
|
- ${comps.field(file_form["comment"], attrs=dict(
|
|
|
|
|
- placeholder="Optional",
|
|
|
|
|
- klass=""
|
|
|
|
|
- ))}
|
|
|
|
|
- <span class="help-block">
|
|
|
|
|
- Use a table comment to describe your table. For example, you might mention the data's provenance, and any caveats users of this table should expect.
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="clearfix">
|
|
|
|
|
- ${comps.label(file_form["path"])}
|
|
|
|
|
- <div class="input">
|
|
|
|
|
- ${comps.field(file_form["path"], attrs=dict(
|
|
|
|
|
- placeholder="/user/user_name/data_dir",
|
|
|
|
|
- klass=""
|
|
|
|
|
- ))}
|
|
|
|
|
- <span class="help-inline"><a id="pathChooser" href="#" data-filechooser-destination="path">Choose File</a></span>
|
|
|
|
|
- <span class="help-block">
|
|
|
|
|
- The HDFS path to the file that you would like to base this new table definition on. It can be compressed (gzip) or not.
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="clearfix">
|
|
|
|
|
- ${comps.label(file_form["do_import"])}
|
|
|
|
|
- <div class="input">
|
|
|
|
|
- ${comps.field(file_form["do_import"], render_default=True, attrs=dict(
|
|
|
|
|
- klass=""
|
|
|
|
|
- ))}
|
|
|
|
|
- <span class="help-block">
|
|
|
|
|
- Check this box if you want to import the data in this file after creating the table definition. Leave it unchecked if you just want to define an empty table.
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </fieldset>
|
|
|
|
|
- <div class="actions">
|
|
|
|
|
- <input type="submit" class="btn primary" name="submit_file" value="Choose a delimiter" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <h1>Create a new table from file</h1>
|
|
|
|
|
+ <div class="row-fluid">
|
|
|
|
|
+ <div class="span3">
|
|
|
|
|
+ <div class="well sidebar-nav">
|
|
|
|
|
+ <ul class="nav nav-list">
|
|
|
|
|
+ <li class="nav-header">Actions</li>
|
|
|
|
|
+ <li><a href="${ url('beeswax.create_table.import_wizard')}">Create a new table from file</a></li>
|
|
|
|
|
+ <li><a href="${ url('beeswax.create_table.create_table')}">Create a new table manually</a></li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="span9">
|
|
|
|
|
+ <ul class="nav nav-pills">
|
|
|
|
|
+ <li class="active"><a href="${ url('beeswax.create_table.import_wizard') }">Step 1: Choose File</a></li>
|
|
|
|
|
+ <li><a id="step2" href="#">Step 2: Choose Delimiter</a></li>
|
|
|
|
|
+ <li><a href="#">Step 3: Define Columns</a></li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <form action="${action}" method="POST" class="form-horizontal">
|
|
|
|
|
+ <fieldset>
|
|
|
|
|
+ <div class="alert alert-info"><h3>Name Your Table and Choose A File</h3></div>
|
|
|
|
|
+ <div class="control-group">
|
|
|
|
|
+ ${comps.bootstrapLabel(file_form["name"])}
|
|
|
|
|
+ <div class="controls">
|
|
|
|
|
+ ${comps.field(file_form["name"],
|
|
|
|
|
+ placeholder='table_name',
|
|
|
|
|
+ show_errors=False
|
|
|
|
|
+ )}
|
|
|
|
|
+ <span class="help-inline">${unicode(file_form["name"].errors) | n}</span>
|
|
|
|
|
+ <span class="help-block">
|
|
|
|
|
+ Name of the new table. Table names must be globally unique. Table names tend to correspond as well to the directory where the data will be stored.
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="control-group">
|
|
|
|
|
+ ${comps.bootstrapLabel(file_form["comment"])}
|
|
|
|
|
+ <div class="controls">
|
|
|
|
|
+ ${comps.field(file_form["comment"],
|
|
|
|
|
+ placeholder="Optional",
|
|
|
|
|
+ klass="",
|
|
|
|
|
+ show_errors=False
|
|
|
|
|
+ )}
|
|
|
|
|
+ <span class="help-inline">${unicode(file_form["comment"].errors) | n}</span>
|
|
|
|
|
+ <span class="help-block">
|
|
|
|
|
+ Use a table comment to describe your table. For example, you might mention the data's provenance, and any caveats users of this table should expect.
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="control-group">
|
|
|
|
|
+ ${comps.bootstrapLabel(file_form["path"])}
|
|
|
|
|
+ <div class="controls">
|
|
|
|
|
+ ${comps.field(file_form["path"],
|
|
|
|
|
+ placeholder="/user/user_name/data_dir",
|
|
|
|
|
+ klass="pathChooser",
|
|
|
|
|
+ file_chooser=True,
|
|
|
|
|
+ show_errors=False
|
|
|
|
|
+ )}
|
|
|
|
|
+ <span class="help-inline">${unicode(file_form["path"].errors) | n}</span>
|
|
|
|
|
+ <span class="help-block">
|
|
|
|
|
+ The HDFS path to the file that you would like to base this new table definition on. It can be compressed (gzip) or not.
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="control-group">
|
|
|
|
|
+ ${comps.bootstrapLabel(file_form["do_import"])}
|
|
|
|
|
+ <div class="controls">
|
|
|
|
|
+ ${comps.field(file_form["do_import"], render_default=True)}
|
|
|
|
|
+ <span class="help-block">
|
|
|
|
|
+ Check this box if you want to import the data in this file after creating the table definition. Leave it unchecked if you just want to define an empty table.
|
|
|
|
|
+ <div id="fileWillBeMoved" class="alert">
|
|
|
|
|
+ <strong>Warning!</strong> The selected file is going to be moved during the import.
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </fieldset>
|
|
|
|
|
+ <div class="form-actions">
|
|
|
|
|
+ <input type="submit" class="btn primary" name="submit_file" value="Next" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="chooseFile" class="modal hide fade">
|
|
<div id="chooseFile" class="modal hide fade">
|
|
|
- <div class="modal-header">
|
|
|
|
|
- <a href="#" class="close" data-dismiss="modal">×</a>
|
|
|
|
|
- <h3>Choose a file</h3>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="modal-body">
|
|
|
|
|
- <div id="filechooser">
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="modal-footer">
|
|
|
|
|
- </div>
|
|
|
|
|
-</div>
|
|
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <a href="#" class="close" data-dismiss="modal">×</a>
|
|
|
|
|
+ <h3>Choose a file</h3>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <div id="filechooser">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-footer">
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<style>
|
|
<style>
|
|
|
- #filechooser {
|
|
|
|
|
- min-height:100px;
|
|
|
|
|
- overflow-y:scroll;
|
|
|
|
|
- margin-top:10px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ #filechooser {
|
|
|
|
|
+ min-height: 100px;
|
|
|
|
|
+ overflow-y: scroll;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pathChooser {
|
|
|
|
|
+ border-radius: 3px 0 0 3px;
|
|
|
|
|
+ border-right: 0;
|
|
|
|
|
+ margin-right: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .fileChooserBtn {
|
|
|
|
|
+ border-radius: 0 3px 3px 0;
|
|
|
|
|
+ margin-left: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #fileWillBeMoved {
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
- $(document).ready(function(){
|
|
|
|
|
- $("#pathChooser").click(function(){
|
|
|
|
|
- var _destination = $(this).attr("data-filechooser-destination");
|
|
|
|
|
- $("#filechooser").jHueFileChooser({
|
|
|
|
|
- onFileChoose: function(filePath){
|
|
|
|
|
- $("input[name='"+_destination+"']").val(filePath);
|
|
|
|
|
- $("#chooseFile").modal("hide");
|
|
|
|
|
- },
|
|
|
|
|
- createFolder: false
|
|
|
|
|
- });
|
|
|
|
|
- $("#chooseFile").modal("show");
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ $(document).ready(function(){
|
|
|
|
|
+ $(".fileChooserBtn").click(function(e){
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ var _destination = $(this).attr("data-filechooser-destination");
|
|
|
|
|
+ $("#filechooser").jHueFileChooser({
|
|
|
|
|
+ initialPath: $("input[name='"+_destination+"']").val(),
|
|
|
|
|
+ onFileChoose: function(filePath){
|
|
|
|
|
+ $("input[name='"+_destination+"']").val(filePath);
|
|
|
|
|
+ $("#chooseFile").modal("hide");
|
|
|
|
|
+ },
|
|
|
|
|
+ createFolder: false
|
|
|
|
|
+ });
|
|
|
|
|
+ $("#chooseFile").modal("show");
|
|
|
|
|
+ });
|
|
|
|
|
+ $("#id_do_import").change(function(){
|
|
|
|
|
+ if ($(this).is(":checked")){
|
|
|
|
|
+ $("#fileWillBeMoved").show();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $("#fileWillBeMoved").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ $("#step2").click(function(e){
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ $("input[name='submit_file']").click();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-${commonfooter()}
|
|
|
|
|
|
|
+${commonfooter()}
|