clone-image.html 6.75 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
<style>
 .table-condensed > thead > tr > th,
 .table-condensed > tbody > tr > th,
 .table-condensed > tfoot > tr > th,
 .table-condensed > thead > tr > td,
 .table-condensed > tbody > tr > td,
 .table-condensed > tfoot > tr > td {
     padding-top: 2px;
     padding-bottom: 2px;
 }
</style>
<div class='row'>
  <div class='col-lg-10 col-lg-offset-1
              col-md-10 col-md-offset-1
              col-sm-10 col-sm-offset-1
              col-xs-12'>
    <div class='panel panel-default'>
      <div class='panel-heading'>
 	<% if (isadmin && window.ISEMULAB) { %>
	  <a href="../newimageid_ez.php3?imageid=<%= window.BASEIMAGE_UUID %>&classic=1"
	     class='btn btn-primary btn-xs pull-right'
             style='margin-right: 10px; margin-top: -4px;'
	     data-toggle='tooltip'
	     title="Classic new image page"
             type='button'>Classic</a>
	<% } %>
        <h3 class='panel-title'>Clone Image</h3>
      </div>
      <div class='panel-body'>
	<center>
	  <h4>Create a new disk image based on image
	    <%- window.BASEIMAGE_NAME %></h4>
	</center>
	<span id="general_error" style="color:red;"></span>
	<form id='clone-image-form'
              class='form-horizontal' role='form'>
	  <div class='row'>
	    <div class='col-sm-12'>
	      <% if (projects.length == 1) { %>
		<div class="form-group">
		  <input name="image_pid" readonly
			 id="image_pid"
			 value="<%- projects[0][0] %>"
			 class="form-control format-me"
			 data-label="Project"
			 data-key="image_pid">
		</div>
	      <% } else { %>
		<div class="form-group">
		  <select name="image_pid"
			  id="image_pid"
			  class='form-control format-me'
			  data-key="image_pid"
			  data-label="Project"
			  placeholder='Please Select'>
		    <option value=''>Please Select</option>
		    <% _.each(projects, function(value, key) { %>
		      <option 
			  <% if (_.has(formfields, 'image_pid') &&
			    formfields.image_pid == key) { %>
			  selected
			  <% } %>
			  value='<%= key %>'> <%= key %>
		      </option>
		    <% }); %>
		  </select>
		</div>
	      <% } %>
	      <% if (projects.length == 1 && projects[0].length == 1) { %>
		<div class="form-group">
		  <input name="image_gid" readonly
			 id="image_gid"
			 value="<%- projects[0][0] %>"
			 class="form-control format-me"
			 data-label="Group"
			 data-key="image_gid">
		</div>
	      <% } else { %>
		<div class="form-group">
		  <div class="format-me"
		       id="image_gid"
		       data-label="Group"
		       data-key="image_gid">
		    <input name="image_gid" readonly
			   class="form-control"
			   placeholder="Please select Project first"
			   value="">
		  </div>
		</div>
	      <% } %>
	      <div class="form-group">
		<input name="imagename"
		       value=""
		       class="form-control format-me"
		       data-key="imagename"
		       data-label="Image Name"
		       placeholder="alphanumeric, no spaces" type="text">
	      </div>
	      <div class="form-group">
		<input name="description"
		       value="<%- formfields.description %>"
		       class="form-control format-me"
		       data-key="description"
		       data-label="Description"
		       placeholder="short pithy sentence" type="text">
	      </div>
	      <div class="form-group">
		<input name="OS" readonly
		       value="<%- formfields.os %>"
		       class="form-control format-me"
		       data-key="OS"
		       data-label="Operating System"
		       type="text">
	      </div>
	      <div class="form-group">
		<input name="os_version"
		       value="<%- formfields.os_version %>"
		       class="form-control format-me"
		       data-key="os_version"
		       data-label="OS Version"
		       placeholder="eg: 4.3, 7.2, etc." type="text">
	      </div>
	      <div class="form-group">
		<div id="shared-global"
		     class='format-me'
		     data-key="shared-global"
		     data-label="Shared/Global"
		     data-help='<dl class=horizontal>
		       <dt>Shared</dt>
		       <dd>Images that are marked shared can be used by all
		       subgroups of the project the image belongs to. When not
		       shared, the image is accessible only by experiments
		       created in the same subgroup as the image.</dd>
		       <dt>Global</dt>
		       <dd>Images that are marked global can be used by any
		       user in any project or subgroup. Global implies shared
		       so if you mark an image as global, we will uncheck
		       shared.</dd></dl>'>
		  <span class="radios">
		    <label class="radio-inline"> 
		      <input type="radio" name="shared-global"
			     value="shared"
			     id="shared-global-radio-shared"> Shared 
		    </label> 
		    <label class="radio-inline"> 
		      <input type="radio" name="shared-global"
			     value="global"
 			     id="shared-global-radio-global"> Global 
		    </label> 
		    <label class="radio-inline"> 
		      <input type="radio" name="shared-global"
			     value="none"
			     id="shared-global-radio-neither"> Neither 
		    </label> 
		  </span>
		</div>
	      </div>
	      <div class="form-group">
		<div class="format-me"
		     data-key="wholedisk"
161 162 163 164 165 166 167 168 169
		     data-label="Whole Disk"
		     data-help="Check this box if you need to capture more
			   then just the primary partition of your disk.
			   For example, you created a file system on
			   parition two, and want to include that in
			   your new disk image. 
			   <b><em>Do not check this box if you do not
			   need to do this or 
			   do not know what this means!</em></b>">
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
		  <label class="checkbox-inline"> 
		    <input type="checkbox" 
			   <% if (formfields.wholedisk) { %>
			     disabled checked
			   <% } %>
			   value="yep"
			   name="wholedisk">Yes</label>
		</div>
	      </div>
	      <div class="form-group">
		<input name="node_id"
		       <% if (window.NODE !== undefined) { %>
		       value="<%- window.NODE %>"
		       <% } %>
		       class="form-control format-me"
		       data-key="node_id"
		       data-label="Node ID"
		       <% if (isadmin && window.NODE === undefined) { %>
		       placeholder="node is optional for administrators"
		       <% } %>
		       type="text">
	      </div>
	      <div class="form-group">
		<div class="format-me" 
		     data-key="baseimage"
		     data-label="Base Image"
		     style="height: 34px;
			    padding-top: 7px; padding-bottom: 7px;">
		  <a href="show-image.php?imageid=<%- window.BASEIMAGE_UUID %>"
		     target="_blank">
		    <%- window.BASEIMAGE_NAME %>:<%- window.BASEIMAGE_VERSION %>
		  </a>  
		</div>
	      </div>
	    </div>
	  </div>
	  <input type='hidden' name='baseimage_uuid'
		 value='<%= window.BASEIMAGE_UUID %>'>
	</form>
        <button class='btn btn-primary btn-sm pull-right'
                id='clone-image-button'
                type='submit' name='clone'>Clone
	</button>
      </div>
    </div>
  </div>
</div>
<!-- place to hang the modals for now -->
<div id='oops_div'></div>
<div id='waitwait_div'></div>