<commit_before><h1 class="page-header">Create Container</h1>

<form method="POST" action="/create_container">
	<div class="form-group">
		<label for="name" class="control-label">Name</label>
		<input type="text" class="form-control" id="name" name="name" value="<%= name rescue '' %>">

		<label for="hostname" class="control-label">Hostname</label>
		<input type="text" class="form-control" id="hostname" name="hostname" value="<%= hostname rescue '' %>">

		<label for="description" class="control-label">Description</label>
		<input type="text" class="form-control" id="description" name="description" value="<%= description rescue '' %>">

		<label for="distro_id" class="control-label">Distro</label>
		<select size="1" class="form-control" id="distro_id" name="distro_id">
			<% distros.each{ |distro| %>
				<% selected = if distro_id.to_i == distro.id then "selected" else "" end rescue "" %>
				<option value="<%= distro.id %>" <%= selected %>><%= distro.name %></option>
			<% } %>
		</select>

		<label for="storage_type" class="control-label">Storage Type</label>
		<select size="1" class="form-control" id="storage_type" name="storage_type">
			<% LxcManager::Container::StorageType.constants.each{ |storage_type| %>
				<% selected = if LxcManager::Container::StorageType.const_get(storage_type) == storage_type then "selected" else "" end rescue "" %>
				<option value="<%= LxcManager::Container::StorageType.const_get(storage_type) %>" <%= selected %>><%= LxcManager::Container::StorageType.const_get(storage_type) %></option>
			<% } %>
		</select>

		<label for="size_gb" class="control-label">Size [GB]</label>
		<input type="text" class="form-control" id="size_gb" name="size_gb" value="<%= size_gb rescue '' %>">
	</div>

	<a type="button" class="btn btn-default" href="javascript:history.back();">Cancel</a>
	<button type="submit" class="btn btn-primary" data-toggle="modal" data-target="#waitReloadModal">Submit</button>
</form><commit_msg>fix create_container.erb to keep storage_type when error occur<commit_after><h1 class="page-header">Create Container</h1>

<form method="POST" action="/create_container">
	<div class="form-group">
		<label for="name" class="control-label">Name</label>
		<input type="text" class="form-control" id="name" name="name" value="<%= name rescue '' %>">

		<label for="hostname" class="control-label">Hostname</label>
		<input type="text" class="form-control" id="hostname" name="hostname" value="<%= hostname rescue '' %>">

		<label for="description" class="control-label">Description</label>
		<input type="text" class="form-control" id="description" name="description" value="<%= description rescue '' %>">

		<label for="distro_id" class="control-label">Distro</label>
		<select size="1" class="form-control" id="distro_id" name="distro_id">
			<% distros.each{ |distro| %>
				<% selected = if distro_id.to_i == distro.id then "selected" else "" end rescue "" %>
				<option value="<%= distro.id %>" <%= selected %>><%= distro.name %></option>
			<% } %>
		</select>

		<label for="storage_type" class="control-label">Storage Type</label>
		<select size="1" class="form-control" id="storage_type" name="storage_type">
			<% LxcManager::Container::StorageType.constants.each{ |st| %>
				<% selected = if LxcManager::Container::StorageType.const_get(st) == storage_type then "selected" else "" end rescue "" %>
				<option value="<%= LxcManager::Container::StorageType.const_get(st) %>" <%= selected %>><%= LxcManager::Container::StorageType.const_get(st) %></option>
			<% } %>
		</select>

		<label for="size_gb" class="control-label">Size [GB]</label>
		<input type="text" class="form-control" id="size_gb" name="size_gb" value="<%= size_gb rescue '' %>">
	</div>

	<a type="button" class="btn btn-default" href="javascript:history.back();">Cancel</a>
	<button type="submit" class="btn btn-primary" data-toggle="modal" data-target="#waitReloadModal">Submit</button>
</form>
{'fraction_non_alphanumeric': 0.20944402132520945, 'fraction_numerical': 0.002030972328002031, 'mean_word_length': 6.282809611829944, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7313437', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1261, 'n_words': 244}