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

Commit 77fb83d

Browse files
author
MrCrankHank
committed
version 0.5.3
1 parent 434c1f6 commit 77fb83d

File tree

11 files changed

+387
-6
lines changed

11 files changed

+387
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ Take a look at the github releases for detailed information about the features.
2727
## Bugs in 0.5.2:
2828
- [ ] Reload page after session disconnect
2929
- [ ] Delete lun: check if line contains default parameter
30-
- [ ] Session: After overwrite, you have to login again
31-
After session expire logout, you have to login twice
30+
- [ ] Session:
31+
- [ ] After overwrite, you have to login again
32+
- [ ] After session expire logout, you have to login twice
3233
- [ ] Error while submitting
3334

3435
## Roadmap
@@ -105,11 +106,11 @@ In version 0.7:
105106
- [ ] Create complete documentation on https://readthedocs.org/
106107
- [ ] Use unity testing
107108

108-
In version 0.8:
109+
* In version 0.8:
109110
- [ ] Support for DRBD (show status)
110111
- [ ] Support for HA Clusters (Corosync & Pacemaker, only for iet)
111112

112-
In version 0.9:
113+
* In version 0.9:
113114
- [ ] Support for nfs
114115

115116
## More

app/config.db

-22 KB
Binary file not shown.

app/models/doc/target/add_acl.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: alexander.hank
5+
* Date: 28.08.2015
6+
* Time: 19:43
7+
*/

app/models/doc/target/get_acls.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: alexander.hank
5+
* Date: 29.08.2015
6+
* Time: 14:49
7+
*/

app/models/doc/target/settings.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: alexander.hank
5+
* Date: 30.08.2015
6+
* Time: 19:02
7+
*/

app/views/permissions/adduser.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<div class="workspacedirect">
2+
<div class="container">
3+
<div class="panel panel-default">
4+
<ol class='panel-heading breadcrumb'>
5+
<li><a href='#'>Targets</a></li>
6+
<li><a href='#'>Configure</a></li>
7+
<li class='active'>Add user</li>
8+
</ol>
9+
10+
<div class="panel-body">
11+
<button id="adduserbutton" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> Add</button>
12+
13+
<div class="btn-group" data-toggle="buttons">
14+
<label class="btn btn-default active">
15+
<input type="Radio" id="addusertypeincomingcheckbox" name="type" value="Incoming" checked="checked"> Incoming
16+
</label>
17+
<label class="btn btn-default">
18+
<input id="addusertypeoutgoingcheckbox" type="Radio" name="type" value="Outgoing"> Outgoing
19+
</label>
20+
</div>
21+
</div>
22+
<div class="table-responsive">
23+
<table id="addusertable" class="table table-striped searchabletable">
24+
<thead>
25+
<tr>
26+
<th class="col-md-1"><span class="glyphicon glyphicon glyphicon-ok green glyphicon-20"></span>
27+
</th>
28+
<th class="col-md-11">Username</th>
29+
</tr>
30+
</thead>
31+
<?php if (is_array($data['user'])) { ?>
32+
<tbody id="addusertablebody">
33+
<?php foreach ($data['user'] as $row) { ?>
34+
<tr>
35+
<td hidden class="userid"><?php echo htmlspecialchars($row['id']); ?></td>
36+
<td class="col-md-1"><input class="addusercheckbox" type="checkbox"></td>
37+
<td class="col-md-11"><?php echo htmlspecialchars($row['username']); ?></td>
38+
</tr>
39+
<?php } ?>
40+
</tbody>
41+
<?php } ?>
42+
</table>
43+
</div>
44+
</div>
45+
</div>
46+
47+
<script>
48+
require(['common'], function () {
49+
require(['pages/adduser'], function (methods) {
50+
methods.add_event_handler_adduserbutton();
51+
methods.enable_filter_table_plugin();
52+
});
53+
});
54+
</script>
55+
</div>

public/js/pages/adduser.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
define(['jquery', 'mylibs', 'sweetalert'], function ($, mylibs, swal) {
2+
var methods;
3+
4+
return methods = {
5+
enable_filter_table_plugin: function() {
6+
$(document).ready(function(){
7+
// Enable filter table plugin
8+
$('.searchabletable').filterTable({minRows:0});
9+
});
10+
},
11+
add_event_handler_adduserbutton: function () {
12+
$(document).ready(function () {
13+
$(document).once('click', '#adduserbutton', function () {
14+
var selector_targetselection = $('#targetselection');
15+
var iqn = selector_targetselection.find("option:selected").val();
16+
var defaultvalue = selector_targetselection.find('#default').val();
17+
18+
if (iqn == defaultvalue) {
19+
swal({
20+
title: 'Error',
21+
type: 'error',
22+
text: 'Please select a iqn!'
23+
});
24+
} else if (!$(".addusercheckbox:checked").val()) {
25+
swal({
26+
title: 'Error',
27+
type: 'error',
28+
text: 'Please select a user!'
29+
});
30+
} else {
31+
// Select radio
32+
var type = $("input[name='type']:checked").val();
33+
34+
// loop through checkboxes
35+
$(".addusercheckbox:checked").each(function () {
36+
var $this = $(this);
37+
var id = $this.closest('tr').find('.userid').text();
38+
39+
var data = {
40+
"iqn": iqn,
41+
"type": type,
42+
"id": id
43+
};
44+
45+
var request = mylibs.doajax("/phpietadmin/permission/adduser", data);
46+
47+
request.done(function () {
48+
if (request.readyState == 4 && request.status == 200) {
49+
if (request.responseText == "Success") {
50+
// uncheck all the checkbox
51+
$this.removeAttr('checked');
52+
53+
swal({
54+
title: 'Success',
55+
type: 'success'
56+
});
57+
} else {
58+
swal({
59+
title: 'Error',
60+
type: 'error',
61+
text: request.responseText
62+
});
63+
}
64+
mylibs.loadconfiguretargetbody('/phpietadmin/permission/adduser', iqn);
65+
}
66+
});
67+
});
68+
69+
}
70+
});
71+
});
72+
}
73+
};
74+
});

public/js/pages/deletelun.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
define(['jquery', 'mylibs', 'sweetalert'], function($, mylibs, swal) {
2+
var Methods;
3+
return Methods = {
4+
add_event_handler_deletelunbutton: function() {
5+
$(document).ready(function(){
6+
$(document).once('click', '#deletelunbutton', function() {
7+
var deletelunlunselection = $('#deletelunlunselection');
8+
var iqn = $('#targetselection').find("option:selected").val();
9+
10+
var data = {
11+
"iqn": iqn,
12+
"lun": deletelunlunselection.find('option:selected').val(),
13+
"path": deletelunlunselection.find('option:selected').attr('name')
14+
};
15+
16+
var request = mylibs.doajax("/phpietadmin/targets/deletelun", data);
17+
18+
request.done(function () {
19+
if (request.readyState == 4 && request.status == 200) {
20+
if (request.responseText == "Success") {
21+
swal({
22+
title: 'Success',
23+
type: 'success'
24+
},
25+
function () {
26+
// remove selected element
27+
deletelunlunselection.find('option:selected').remove();
28+
29+
if((deletelunlunselection.has('option').length) == 0) {
30+
$('#configuretargetbody').replaceWith('<div id="configuretargetbody">' +
31+
'<div class = "container">' +
32+
'<div class="alert alert-danger" role="alert"><h3 align="center">Error - No luns available</h3></div>' +
33+
'</div>' +
34+
'</div>')
35+
}
36+
});
37+
} else {
38+
swal({
39+
title: 'Error',
40+
type: 'error',
41+
text: request.responseText
42+
});
43+
}
44+
45+
}
46+
})
47+
});
48+
});
49+
}
50+
};
51+
});

public/js/pages/deletesession.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
define(['jquery', 'mylibs', 'sweetalert', 'qtip'], function($, mylibs, swal, qtip) {
2+
var methods;
3+
4+
return methods = {
5+
add_qtip_sessiondeletebutton: function() {
6+
$(document).ready(function(){
7+
$('.sessiondeletebutton').qtip({
8+
content: {
9+
text: 'Normally the initiator immediately reconnects. ' +
10+
'To disconnect an initiator permanently you have to deleted the acl allowing the connection ' +
11+
'before deleting the session.'
12+
},
13+
style: {
14+
classes: 'qtip-youtube'
15+
}
16+
});
17+
});
18+
},
19+
add_event_handler_sessiondeletebutton: function() {
20+
$(document).ready(function(){
21+
$(document).once('click', '.sessiondeletebutton', function() {
22+
var data = {
23+
iqn: $('#targetselection').find("option:selected").val(),
24+
cid: $(this).closest('tr').find('.cid').text(),
25+
sid: $(this).closest('tr').find('.sid').text()
26+
};
27+
28+
var request = mylibs.doajax('/phpietadmin/targets/deletesession', data);
29+
30+
request.done(function () {
31+
if (request.readyState == 4 && request.status == 200) {
32+
if (request.responseText == "Success") {
33+
swal({
34+
title: 'Success',
35+
type: 'success'
36+
});
37+
} else {
38+
swal({
39+
title: 'Error',
40+
type: 'error',
41+
text: request.responseText
42+
});
43+
}
44+
45+
var url= 'targets/deletesession';
46+
var page = url.replace('/', '_');
47+
url = '/phpietadmin/' + url;
48+
49+
var array = {
50+
iqn: $('#targetselection').find("option:selected").val()
51+
};
52+
53+
request = mylibs.doajax(url, array);
54+
55+
request.done(function () {
56+
if (request.readyState == 4 && request.status == 200) {
57+
var configuretargetbody = $('#configuretargetbody');
58+
configuretargetbody.html('');
59+
configuretargetbody.html(request.responseText);
60+
configuretargetbody.removeClass();
61+
configuretargetbody.addClass(page);
62+
}
63+
});
64+
65+
}
66+
});
67+
});
68+
});
69+
}
70+
};
71+
});

0 commit comments

Comments
 (0)