2016-09-14 08:54:30 +00:00
<!-- page content -->
<div class="right_col" role="main">
<div class="page-title">
<div class="title_left"><h3>Peer</h3></div>
<div class="title_right">
</div>
</div>
<div class="clearfix"></div>
2016-09-24 09:00:27 +00:00
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="x_panel">
2016-09-20 12:14:13 +00:00
<div class="x_title">
2016-09-25 16:02:56 +00:00
<h2><i class="fa fa-plus-square-o"></i> Add Node</h2>
2016-09-24 09:00:27 +00:00
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
2016-09-20 12:14:13 +00:00
</li>
2016-09-24 09:00:27 +00:00
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Settings 1</a>
</li>
<li><a href="#">Settings 2</a>
</li>
</ul>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
2016-09-20 12:14:13 +00:00
</li>
2016-09-24 09:00:27 +00:00
</ul>
<div class="clearfix"></div>
2016-09-20 12:14:13 +00:00
</div>
<div class="x_content">
2016-09-24 09:00:27 +00:00
<form class="form-horizontal form-label-left" action="/node/add" method="post" novalidate>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Host Name <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="name" class="form-control col-md-7 col-xs-12" data-validate-length-range="10" data-validate-words="1" name="host_name" placeholder="Host Name" required="required" type="text"
data-toggle="tooltip" data-placement="top" title="Put node's representative name">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ip">Host IP <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="ip" class="form-control col-md-7 col-xs-12" data-validate-length-range="10" data-validate-words="1" name="host_ip" placeholder="127.0.0.1" required="required" type="text"
data-toggle="tooltip" data-placement="top" title="Put node's ip">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">User Name <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="occupation" type="text" name="user_name" placeholder="root" required="required" data-validate-length-range="5,20" class="form-control col-md-7 col-xs-12"
data-toggle="tooltip" data-placement="top" title="Put user name for ssh connection. client must have ssh key">
</div>
</div>
<div class="item form-group">
<label for="password" class="control-label col-md-3">User Password <span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="password" type="password" name="user_password" placeholder="secret" data-validate-length="1,10" class="form-control col-md-7 col-xs-12" required="required"
data-toggle="tooltip" data-placement="top" title="Put user password for ssh connection. client must have ssh key">
</div>
</div>
<!--<div class="ln_solid"></div>-->
<div class="form-group">
<div class="col-md-6 col-md-offset-3">
<button type="submit" class="btn btn-primary">Cancel</button>
<button id="send" type="submit" class="btn btn-success">Add</button>
</div>
</div>
</form>
2016-09-20 12:14:13 +00:00
</div>
</div>
2016-09-24 09:00:27 +00:00
</div>
2016-09-25 16:02:56 +00:00
<div class="col-md-6 col-sm-6 col-xs-6">
2016-09-14 08:54:30 +00:00
<div class="x_panel">
<div class="x_title">
2016-09-25 16:02:56 +00:00
<h2><i class="fa fa-align-left"></i> Node List <small>Try hovering over the rows</small></h2>
2016-09-14 08:54:30 +00:00
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Settings 1</a>
</li>
<li><a href="#">Settings 2</a>
</li>
</ul>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Host Name</th>
2016-09-20 12:14:13 +00:00
<th>Host IP</th>
<th>User Name</th>
<th>Date</th>
2016-09-24 09:00:27 +00:00
<!-- <th></th>-->
2016-09-20 12:14:13 +00:00
<th></th>
2016-09-14 08:54:30 +00:00
</tr>
</thead>
<tbody>
2016-09-20 12:14:13 +00:00
<%@nodes.each do |t|%>
2016-09-14 08:54:30 +00:00
<tr>
2016-09-20 12:14:13 +00:00
<th scope="row"><%=t.id%></th>
<td><%=t.host_name%></td>
<td><%=t.host_ip%></td>
<td><%=t.user_name%></td>
<td><%=t.created_at%></td>
2016-09-24 09:00:27 +00:00
<!-- <td><i class="fa fa-pencil"></i></td>-->
2016-09-20 12:14:13 +00:00
<td><a href="/node/delete/<%=t.id%>"><i class="fa fa-trash"></i></a></td>
2016-09-14 08:54:30 +00:00
</tr>
<%end%>
</tbody>
</table>
</div>
</div>
</div>
</div>
2016-09-25 16:02:56 +00:00
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="x_panel">
<div class="x_title">
<h2><i class="fa fa-align-left"></i> Node List</h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Settings 1</a>
</li>
<li><a href="#">Settings 2</a>
</li>
</ul>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<!-- start accordion -->
<div class="accordion" id="accordion1" role="tablist" aria-multiselectable="true">
<div class="panel">
<a class="panel-heading" role="tab" id="headingOne1" data-toggle="collapse" data-parent="#accordion1" href="#collapseOne1" aria-expanded="true" aria-controls="collapseOne">
<h4 class="panel-title">Collapsible Group Item #1</h4>
</a>
<div id="collapseOne1" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel">
<a class="panel-heading collapsed" role="tab" id="headingTwo1" data-toggle="collapse" data-parent="#accordion1" href="#collapseTwo1" aria-expanded="false" aria-controls="collapseTwo">
<h4 class="panel-title">Collapsible Group Item #2</h4>
</a>
<div id="collapseTwo1" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<p><strong>Collapsible Item 2 data</strong>
</p>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
</div>
</div>
</div>
</div>
<!-- end of accordion -->
</div>
</div>
</div>
</div>
2016-09-14 08:54:30 +00:00
</div>
<!-- /page content -->
2016-09-20 12:14:13 +00:00
<script>
2016-09-24 09:00:27 +00:00
// initialize the validator function
validator.message['date'] = 'not a real date';
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
// validate a field on "blur" event, a 'select' on 'change' event & a '.reuired' classed multifield on 'keyup':
$('form')
.on('blur', 'input[required], input.optional, select.required', validator.checkField)
.on('change', 'select.required', validator.checkField)
.on('keypress', 'input[required][pattern]', validator.keypress);
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
$('.multi.required')
.on('keyup blur', 'input', function() {
validator.checkField.apply($(this).siblings().last()[0]);
});
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
// bind the validation to the form submit event
//$('#send').click('submit');//.prop('disabled', true);
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
$('form').submit(function(e) {
e.preventDefault();
var submit = true;
// evaluate the form using generic validaing
if (!validator.checkAll($(this))) {
2016-09-20 12:14:13 +00:00
submit = false;
2016-09-24 09:00:27 +00:00
}
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
if (submit)
this.submit();
return false;
});
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
/* FOR DEMO ONLY */
$('#vfields').change(function() {
$('form').toggleClass('mode2');
}).prop('checked', false);
2016-09-20 12:14:13 +00:00
2016-09-24 09:00:27 +00:00
$('#alerts').change(function() {
validator.defaults.alerts = (this.checked) ? false : true;
if (this.checked)
$('form .alert').remove();
}).prop('checked', false);
</script>