<div data-ng-include="'/themes/adminLTE/unl_data/pages/constant/header.html'" data-ng-controller="HeaderController">
</div>
<div class="wrapper">
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        User management
        <small>here you can manage unl users</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#/main"><i class="fa fa-home"></i></a></li>
        <li><i class="fa fa-wrench"></i> Management</li>
        <li class="active"><i class="fa fa-group"></i> User management</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content row">
      <!-- /.content -->
      <div class="col-xs-12">
        <div class="box">
          <div class="box-header">
            <h3 class="box-title">Database of users</h3>
            <div class="box-tools">
              <div class="btn-group">
                <button type="button" class="btn btn-success btn-flat btn-sm" data-ng-click="openModal('adduser')">+Add
                  user</button>
              </div>
            </div>
          </div>
          <!-- /.box-header -->
          <div class="box-body table-responsive no-padding">
            <table class="table table-hover table-striped">
              <tbody>
                <tr>
                  <th>Username</th>
                  <th>Email</th>
                  <th>Name</th>
                  <th>Role</th>
                  <th>Last session time</th>
                  <th>Last session ip</th>
                  <th>Current folder</th>
                  <th>Current lab</th>
                  <th>POD</th>
                  <th>Actions</th>
                </tr>
                <tr data-ng-repeat="(x,y) in userdata">
                  <td>{{x}}</td>
                  <td>{{y.email}}</td>
                  <td>{{y.name}}</td>
                  <td>{{y.role}}</td>
                  <td>{{ (y.session === null ) ? 'N/A' : timeConverter(y.session) }}</td>
                  <td>{{ (y.ip === null) ? 'N/A' : y.ip}}</td>
                  <td>{{ (y.folder === null) ? 'N/A' : y.folder }}</td>
                  <td>{{ (y.lab === null) ? 'N/A' : y.lab }}</td>
                  <td>{{y.pod}}</td>
                  <td>
                    <button class="btn btn-xs btn-primary" ng-click="openModal('edituser', y.username)"
                      title="Edit Cloud">
                      <i class="fa fa-edit"></i>
                    </button>
                    <button class="btn btn-xs btn-danger" ng-click="deleteUser( y.username )" title="Delete Cloud">
                      <i class="fa fa-trash"></i>
                    </button>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <!-- /.box-body -->
        </div>
        <!-- /.box -->
      </div>
      <!-- /.content -->
    </section>
  </div>
  <!-- /.content-wrapper -->
  <!-- Main Footer -->
  <!-- <div data-ng-include="'/themes/adminLTE/unl_data/pages/constant/footer.html'"> -->
</div>
<!-- ./wrapper -->
<!-- AdminLTE App -->
<link rel="stylesheet" href="/themes/adminLTE/dist/css/skins/skin-blue.min.css">
<script src="/themes/adminLTE/dist/js/app.js"></script>