diff --git a/app/templates/admin.html b/app/templates/admin.html index 17208d14..daf0212d 100644 --- a/app/templates/admin.html +++ b/app/templates/admin.html @@ -29,6 +29,7 @@ Role Group + {% for user in users %} @@ -85,7 +86,12 @@ {% endfor %} - + + + + + + {% endfor %} @@ -160,6 +166,7 @@ Credentials Desciption + {% for server in servers %} @@ -254,6 +261,9 @@ {% endif %} + + + @@ -406,6 +416,7 @@ Chanel name Group + {% for telegram in telegrams %} @@ -427,6 +438,9 @@ {% endfor %} + + + @@ -594,7 +608,7 @@ Virt - + diff --git a/app/templates/base.html b/app/templates/base.html index 300aa921..5e3eb524 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -115,7 +115,7 @@ diff --git a/app/templates/servers.html b/app/templates/servers.html index 01e9076b..8c4ca164 100644 --- a/app/templates/servers.html +++ b/app/templates/servers.html @@ -28,6 +28,7 @@ Email Role + {% for user in users %} @@ -76,6 +77,9 @@ {% endfor %} + + + @@ -102,6 +106,7 @@ Credentials Desciption + {% set ssh_group = [] %} {% for server in servers %} @@ -186,6 +191,9 @@ {% endif %} + + + diff --git a/inc/users.js b/inc/users.js index 58c256d9..a1696a8e 100644 --- a/inc/users.js +++ b/inc/users.js @@ -682,6 +682,66 @@ function confirmDeleteTelegram(id) { } }); } +function cloneServer(id) { + $( "#add-server-button" ).trigger( "click" ); + if ($('#enable-'+id).is(':checked')) { + $('#enable').prop('checked', true) + } else { + $('#enable').prop('checked', false) + } + if ($('#typeip-'+id).is(':checked')) { + $('#typeip').prop('checked', true) + } else { + $('#typeip').prop('checked', false) + } + if ($('#alert-'+id).is(':checked')) { + $('#alert').prop('checked', true) + } else { + $('#alert').prop('checked', false) + } + if ($('#metrics-'+id).is(':checked')) { + $('#metrics').prop('checked', true) + } else { + $('#metrics').prop('checked', false) + } + if ($('#active-'+id).is(':checked')) { + $('#active').prop('checked', true) + } else { + $('#active').prop('checked', false) + } + $('#enable').checkboxradio("refresh"); + $('#typeip').checkboxradio("refresh"); + $('#alert').checkboxradio("refresh"); + $('#active').checkboxradio("refresh"); + $('#new-server-add').val($('#hostname-'+id).val()) + $('#new-ip').val($('#ip-'+id).val()) + $('#new-port').val($('#port-'+id).val()) + $('#desc').val($('#desc-'+id).val()) + $('#slavefor').val($('#slavefor-'+id+' option:selected').val()).change() + $('#slavefor').selectmenu("refresh"); + $('#credentials').val($('#credentials-'+id+' option:selected').val()).change() + $('#credentials').selectmenu("refresh"); + $('#new-server-group-add').val($('#servergroup-'+id+' option:selected').val()).change() + $('#new-server-group-add').selectmenu("refresh"); +} +function cloneUser(id) { + $( "#add-user-button" ).trigger( "click" ); + if ($('#activeuser-'+id).is(':checked')) { + $('#activeuser').prop('checked', true) + } else { + $('#activeuser').prop('checked', false) + } + $('#activeuser').checkboxradio("refresh"); + $('#new-role').val($('#role-'+id+' option:selected').val()).change() + $('#new-role').selectmenu("refresh"); + $('#new-group').val($('#usergroup-'+id+' option:selected').val()).change() + $('#new-group').selectmenu("refresh"); +} +function cloneTelegram(id) { + $( "#add-telegram-button" ).trigger( "click" ); + $('#telegram-token-add').val($('#telegram-token-'+id).val()) + $('#telegram-chanel-add').val($('#telegram-chanel-'+id).val()) +} function removeUser(id) { $("#user-"+id).css("background-color", "#f2dede"); $.ajax( {