Skip to content
This repository has been archived by the owner on Apr 20, 2020. It is now read-only.

Commit

Permalink
version 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCrankHank committed Sep 17, 2015
1 parent 434c1f6 commit 77fb83d
Show file tree
Hide file tree
Showing 11 changed files with 387 additions and 6 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ Take a look at the github releases for detailed information about the features.
## Bugs in 0.5.2:
- [ ] Reload page after session disconnect
- [ ] Delete lun: check if line contains default parameter
- [ ] Session: After overwrite, you have to login again
After session expire logout, you have to login twice
- [ ] Session:
- [ ] After overwrite, you have to login again
- [ ] After session expire logout, you have to login twice
- [ ] Error while submitting

## Roadmap
Expand Down Expand Up @@ -105,11 +106,11 @@ In version 0.7:
- [ ] Create complete documentation on https://readthedocs.org/
- [ ] Use unity testing

In version 0.8:
* In version 0.8:
- [ ] Support for DRBD (show status)
- [ ] Support for HA Clusters (Corosync & Pacemaker, only for iet)

In version 0.9:
* In version 0.9:
- [ ] Support for nfs

## More
Expand Down
Binary file removed app/config.db
Binary file not shown.
7 changes: 7 additions & 0 deletions app/models/doc/target/add_acl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: alexander.hank
* Date: 28.08.2015
* Time: 19:43
*/
7 changes: 7 additions & 0 deletions app/models/doc/target/get_acls.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: alexander.hank
* Date: 29.08.2015
* Time: 14:49
*/
7 changes: 7 additions & 0 deletions app/models/doc/target/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: alexander.hank
* Date: 30.08.2015
* Time: 19:02
*/
55 changes: 55 additions & 0 deletions app/views/permissions/adduser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<div class="workspacedirect">
<div class="container">
<div class="panel panel-default">
<ol class='panel-heading breadcrumb'>
<li><a href='#'>Targets</a></li>
<li><a href='#'>Configure</a></li>
<li class='active'>Add user</li>
</ol>

<div class="panel-body">
<button id="adduserbutton" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> Add</button>

<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default active">
<input type="Radio" id="addusertypeincomingcheckbox" name="type" value="Incoming" checked="checked"> Incoming
</label>
<label class="btn btn-default">
<input id="addusertypeoutgoingcheckbox" type="Radio" name="type" value="Outgoing"> Outgoing
</label>
</div>
</div>
<div class="table-responsive">
<table id="addusertable" class="table table-striped searchabletable">
<thead>
<tr>
<th class="col-md-1"><span class="glyphicon glyphicon glyphicon-ok green glyphicon-20"></span>
</th>
<th class="col-md-11">Username</th>
</tr>
</thead>
<?php if (is_array($data['user'])) { ?>
<tbody id="addusertablebody">
<?php foreach ($data['user'] as $row) { ?>
<tr>
<td hidden class="userid"><?php echo htmlspecialchars($row['id']); ?></td>
<td class="col-md-1"><input class="addusercheckbox" type="checkbox"></td>
<td class="col-md-11"><?php echo htmlspecialchars($row['username']); ?></td>
</tr>
<?php } ?>
</tbody>
<?php } ?>
</table>
</div>
</div>
</div>

<script>
require(['common'], function () {
require(['pages/adduser'], function (methods) {
methods.add_event_handler_adduserbutton();
methods.enable_filter_table_plugin();
});
});
</script>
</div>
74 changes: 74 additions & 0 deletions public/js/pages/adduser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
define(['jquery', 'mylibs', 'sweetalert'], function ($, mylibs, swal) {
var methods;

return methods = {
enable_filter_table_plugin: function() {
$(document).ready(function(){
// Enable filter table plugin
$('.searchabletable').filterTable({minRows:0});
});
},
add_event_handler_adduserbutton: function () {
$(document).ready(function () {
$(document).once('click', '#adduserbutton', function () {
var selector_targetselection = $('#targetselection');
var iqn = selector_targetselection.find("option:selected").val();
var defaultvalue = selector_targetselection.find('#default').val();

if (iqn == defaultvalue) {
swal({
title: 'Error',
type: 'error',
text: 'Please select a iqn!'
});
} else if (!$(".addusercheckbox:checked").val()) {
swal({
title: 'Error',
type: 'error',
text: 'Please select a user!'
});
} else {
// Select radio
var type = $("input[name='type']:checked").val();

// loop through checkboxes
$(".addusercheckbox:checked").each(function () {
var $this = $(this);
var id = $this.closest('tr').find('.userid').text();

var data = {
"iqn": iqn,
"type": type,
"id": id
};

var request = mylibs.doajax("/phpietadmin/permission/adduser", data);

request.done(function () {
if (request.readyState == 4 && request.status == 200) {
if (request.responseText == "Success") {
// uncheck all the checkbox
$this.removeAttr('checked');

swal({
title: 'Success',
type: 'success'
});
} else {
swal({
title: 'Error',
type: 'error',
text: request.responseText
});
}
mylibs.loadconfiguretargetbody('/phpietadmin/permission/adduser', iqn);
}
});
});

}
});
});
}
};
});
51 changes: 51 additions & 0 deletions public/js/pages/deletelun.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
define(['jquery', 'mylibs', 'sweetalert'], function($, mylibs, swal) {
var Methods;
return Methods = {
add_event_handler_deletelunbutton: function() {
$(document).ready(function(){
$(document).once('click', '#deletelunbutton', function() {
var deletelunlunselection = $('#deletelunlunselection');
var iqn = $('#targetselection').find("option:selected").val();

var data = {
"iqn": iqn,
"lun": deletelunlunselection.find('option:selected').val(),
"path": deletelunlunselection.find('option:selected').attr('name')
};

var request = mylibs.doajax("/phpietadmin/targets/deletelun", data);

request.done(function () {
if (request.readyState == 4 && request.status == 200) {
if (request.responseText == "Success") {
swal({
title: 'Success',
type: 'success'
},
function () {
// remove selected element
deletelunlunselection.find('option:selected').remove();

if((deletelunlunselection.has('option').length) == 0) {
$('#configuretargetbody').replaceWith('<div id="configuretargetbody">' +
'<div class = "container">' +
'<div class="alert alert-danger" role="alert"><h3 align="center">Error - No luns available</h3></div>' +
'</div>' +
'</div>')
}
});
} else {
swal({
title: 'Error',
type: 'error',
text: request.responseText
});
}

}
})
});
});
}
};
});
71 changes: 71 additions & 0 deletions public/js/pages/deletesession.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
define(['jquery', 'mylibs', 'sweetalert', 'qtip'], function($, mylibs, swal, qtip) {
var methods;

return methods = {
add_qtip_sessiondeletebutton: function() {
$(document).ready(function(){
$('.sessiondeletebutton').qtip({
content: {
text: 'Normally the initiator immediately reconnects. ' +
'To disconnect an initiator permanently you have to deleted the acl allowing the connection ' +
'before deleting the session.'
},
style: {
classes: 'qtip-youtube'
}
});
});
},
add_event_handler_sessiondeletebutton: function() {
$(document).ready(function(){
$(document).once('click', '.sessiondeletebutton', function() {
var data = {
iqn: $('#targetselection').find("option:selected").val(),
cid: $(this).closest('tr').find('.cid').text(),
sid: $(this).closest('tr').find('.sid').text()
};

var request = mylibs.doajax('/phpietadmin/targets/deletesession', data);

request.done(function () {
if (request.readyState == 4 && request.status == 200) {
if (request.responseText == "Success") {
swal({
title: 'Success',
type: 'success'
});
} else {
swal({
title: 'Error',
type: 'error',
text: request.responseText
});
}

var url= 'targets/deletesession';
var page = url.replace('/', '_');
url = '/phpietadmin/' + url;

var array = {
iqn: $('#targetselection').find("option:selected").val()
};

request = mylibs.doajax(url, array);

request.done(function () {
if (request.readyState == 4 && request.status == 200) {
var configuretargetbody = $('#configuretargetbody');
configuretargetbody.html('');
configuretargetbody.html(request.responseText);
configuretargetbody.removeClass();
configuretargetbody.addClass(page);
}
});

}
});
});
});
}
};
});
Loading

0 comments on commit 77fb83d

Please sign in to comment.