working in list management
This commit is contained in:
@@ -27,38 +27,38 @@
|
||||
<fieldset>
|
||||
<legend>IMAP protocol</legend>
|
||||
<label>
|
||||
<input type="text" name="imap_host" value="«data.imap.host»" id="imap_host" />
|
||||
<input type="text" name="imap_host" value="«data.imap_host»" id="imap_host" />
|
||||
Hostname
|
||||
</label>
|
||||
<label>
|
||||
<input type="number" name="imap_port" value="«data.imap.port»" id="imap_port" />
|
||||
<input type="number" name="imap_port" value="«data.imap_port»" id="imap_port" />
|
||||
Port
|
||||
</label>
|
||||
<label>
|
||||
<input type="text" name="imap_user" value="«data.imap.user»" id="imap_user" />
|
||||
<input type="text" name="imap_user" value="«data.imap_user»" id="imap_user" />
|
||||
Username
|
||||
</label>
|
||||
<label>
|
||||
<input type="password" name="imap_pass" value="«data.imap.pass»" id="imap_pass" />
|
||||
<input type="password" name="imap_pass" value="«data.imap_pass»" id="imap_pass" />
|
||||
Password
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>SMTP protocol</legend>
|
||||
<label>
|
||||
<input type="text" name="smtp_host" value="«data.smtp.host»" id="smtp_host" />
|
||||
<input type="text" name="smtp_host" value="«data.smtp_host»" id="smtp_host" />
|
||||
Hostname
|
||||
</label>
|
||||
<label>
|
||||
<input type="number" name="smtp_port" value="«data.smtp.port»" id="smtp_port" />
|
||||
<input type="number" name="smtp_port" value="«data.smtp_port»" id="smtp_port" />
|
||||
Port
|
||||
</label>
|
||||
<label>
|
||||
<input type="text" name="smtp_user" value="«data.smtp.user»" id="smtp_user" />
|
||||
<input type="text" name="smtp_user" value="«data.smtp_user»" id="smtp_user" />
|
||||
Username
|
||||
</label>
|
||||
<label>
|
||||
<input type="password" name="smtp_pass" value="«data.smtp.pass»" id="smtp_pass" />
|
||||
<input type="password" name="smtp_pass" value="«data.smtp_pass»" id="smtp_pass" />
|
||||
Password
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
@@ -1,7 +1,38 @@
|
||||
function dropList(email){
|
||||
console.log('dopList('+email+')');
|
||||
}
|
||||
function loadListList(){
|
||||
$.getJSON("/api/list/list", showListList);
|
||||
}
|
||||
|
||||
function loadUserList(){
|
||||
$.getJSON("/api/user/list", showUserList);
|
||||
}
|
||||
|
||||
function showListList(data){
|
||||
for (let i in data.lists){
|
||||
let list = data.lists[i];
|
||||
let row = $('<tr/>');
|
||||
let drop = $('<button/>').text('drop list').click(() => dropList(list.email))
|
||||
$('<td/>').text(list.name).appendTo(row);
|
||||
$('<td/>').text(list.email).appendTo(row);
|
||||
$('<td/>').text(list.state).appendTo(row);
|
||||
drop.appendTo($('<td/>')).appendTo(row);
|
||||
$('<td/>').text(list.imap_host).appendTo(row);
|
||||
$('<td/>').text(list.imap_port).appendTo(row);
|
||||
$('<td/>').text(list.imap_user).appendTo(row);
|
||||
$('<td/>').text(list.smtp_host).appendTo(row);
|
||||
$('<td/>').text(list.smtp_port).appendTo(row);
|
||||
$('<td/>').text(list.smtp_user).appendTo(row);
|
||||
row.appendTo('#listlist');
|
||||
}
|
||||
if (data.user.name == 'Admin'){
|
||||
$('a[href=register]').show();
|
||||
} else {
|
||||
$('a[href=register]').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function showUserList(data){
|
||||
for (let i in data.users){
|
||||
let user = data.users[i];
|
||||
|
||||
@@ -2,9 +2,21 @@
|
||||
<legend>List of mailinglists</legend>
|
||||
<table id="listlist">
|
||||
<tr>
|
||||
<th>List name</th>
|
||||
<th>List email</th>
|
||||
<th>Details</th>
|
||||
<th colspan="4">List</th>
|
||||
<th colspan="3">IMAP</th>
|
||||
<th colspan="3">SMTP</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>State</th>
|
||||
<th>Actions</th>
|
||||
<th>Host</th>
|
||||
<th>Port</th>
|
||||
<th>User</th>
|
||||
<th>Host</th>
|
||||
<th>Port</th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</table>
|
||||
<a href="add_list">Add new mailing list</a>
|
||||
|
||||
Reference in New Issue
Block a user