mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-09 16:25:15 +03:00
eventmanager: add support for pre-* actions
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -259,7 +259,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script src="{{.StaticURL}}/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$("body").on("click", ".add_new_group_field_btn", function () {
|
||||
var index = $(".form_field_groups_outer").find("form_field_groups_outer_row").length;
|
||||
let index = $(".form_field_groups_outer").find(".form_field_groups_outer_row").length;
|
||||
while (document.getElementById("idGroup"+index) != null){
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script src="{{.StaticURL}}/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$("body").on("click", ".add_new_header_field_btn", function () {
|
||||
var index = $(".form_field_http_headers_outer").find(".form_field_http_headers_outer_row").length;
|
||||
let index = $(".form_field_http_headers_outer").find(".form_field_http_headers_outer_row").length;
|
||||
while (document.getElementById("idHTTPHeaderKey"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -815,7 +815,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_query_field_btn", function () {
|
||||
var index = $(".form_field_http_query_outer").find(".form_field_http_query_outer_row").length;
|
||||
let index = $(".form_field_http_query_outer").find(".form_field_http_query_outer_row").length;
|
||||
while (document.getElementById("idHTTPQueryKey"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -842,7 +842,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_cmd_env_field_btn", function () {
|
||||
var index = $(".form_field_cmd_env_outer").find(".form_field_cmd_env_outer_row").length;
|
||||
let index = $(".form_field_cmd_env_outer").find(".form_field_cmd_env_outer_row").length;
|
||||
while (document.getElementById("idCMDEnvKey"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -869,7 +869,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_data_retention_field_btn", function () {
|
||||
var index = $(".form_field_data_retention_outer").find(".form_field_data_retention_outer_row").length;
|
||||
let index = $(".form_field_data_retention_outer").find(".form_field_data_retention_outer_row").length;
|
||||
while (document.getElementById("idFolderRetentionPath"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -903,7 +903,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_fs_rename_field_btn", function () {
|
||||
var index = $(".form_field_fs_rename_outer").find(".form_field_fs_rename_outer_row").length;
|
||||
let index = $(".form_field_fs_rename_outer").find(".form_field_fs_rename_outer_row").length;
|
||||
while (document.getElementById("idFsRenameSource"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -930,7 +930,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_fs_copy_field_btn", function () {
|
||||
var index = $(".form_field_fs_copy_outer").find(".form_field_fs_copy_outer_row").length;
|
||||
let index = $(".form_field_fs_copy_outer").find(".form_field_fs_copy_outer_row").length;
|
||||
while (document.getElementById("idFsCopySource"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -957,7 +957,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_http_part_field_btn", function () {
|
||||
var index = $(".form_field_http_part_outer").find(".form_field_http_part_outer_row").length;
|
||||
let index = $(".form_field_http_part_outer").find(".form_field_http_part_outer_row").length;
|
||||
while (document.getElementById("idHTTPPartName"+index) != null){
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<b>Actions</b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h6 class="card-title mb-4">One or more actions to execute. The "Execute sync" options is only supported for upload events</h6>
|
||||
<h6 class="card-title mb-4">One or more actions to execute. The "Execute sync" options is supported for upload events and required for pre-* events</h6>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12 form_field_action_outer">
|
||||
{{range $idx, $val := .Rule.Actions}}
|
||||
@@ -505,7 +505,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script src="{{.StaticURL}}/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$("body").on("click", ".add_new_schedule_field_btn", function () {
|
||||
var index = $(".form_field_schedules_outer").find(".form_field_schedules_outer_row").length;
|
||||
let index = $(".form_field_schedules_outer").find(".form_field_schedules_outer_row").length;
|
||||
while (document.getElementById("idScheduleHour"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_name_pattern_field_btn", function () {
|
||||
var index = $(".form_field_names_outer").find(".form_field_names_outer_row").length;
|
||||
let index = $(".form_field_names_outer").find(".form_field_names_outer_row").length;
|
||||
while (document.getElementById("idNamePattern"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -567,7 +567,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_group_name_pattern_field_btn", function () {
|
||||
var index = $(".form_field_group_names_outer").find(".form_field_group_names_outer_row").length;
|
||||
let index = $(".form_field_group_names_outer").find(".form_field_group_names_outer_row").length;
|
||||
while (document.getElementById("idGroupNamePattern"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_role_name_pattern_field_btn", function () {
|
||||
var index = $(".form_field_role_names_outer").find(".form_field_role_names_outer_row").length;
|
||||
let index = $(".form_field_role_names_outer").find(".form_field_role_names_outer_row").length;
|
||||
while (document.getElementById("idRoleNamePattern"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -627,7 +627,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_fs_path_pattern_field_btn", function () {
|
||||
var index = $(".form_field_fs_paths_outer").find("form_field_fs_paths_outer_row").length;
|
||||
let index = $(".form_field_fs_paths_outer").find(".form_field_fs_paths_outer_row").length;
|
||||
while (document.getElementById("idFsPathPattern"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -657,7 +657,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_action_field_btn", function () {
|
||||
var index = $(".form_field_action_outer").find("form_field_action_outer_row").length;
|
||||
let index = $(".form_field_action_outer").find(".form_field_action_outer_row").length;
|
||||
while (document.getElementById("idActionName"+index) != null){
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
onFilesystemChanged('{{.Folder.FsConfig.Provider.Name}}');
|
||||
|
||||
$("body").on("click", ".add_new_tpl_folder_field_btn", function () {
|
||||
var index = $(".form_field_tpl_folders_outer").find(".form_field_tpl_folder_outer_row").length;
|
||||
let index = $(".form_field_tpl_folders_outer").find(".form_field_tpl_folder_outer_row").length;
|
||||
while (document.getElementById("idTplFolder"+index) != null){
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
{{define "shared_user_group"}}
|
||||
<script type="text/javascript">
|
||||
$("body").on("click", ".add_new_dirperms_field_btn", function () {
|
||||
var index = $(".form_field_dirperms_outer").find(".form_field_dirperms_outer_row").length;
|
||||
let index = $(".form_field_dirperms_outer").find(".form_field_dirperms_outer_row").length;
|
||||
while (document.getElementById("idSubDirPermsPath"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_vfolder_field_btn", function () {
|
||||
var index = $(".form_field_vfolders_outer").find(".form_field_vfolder_outer_row").length;
|
||||
let index = $(".form_field_vfolders_outer").find(".form_field_vfolder_outer_row").length;
|
||||
while (document.getElementById("idVolderPath" + index) != null) {
|
||||
index++;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_bwlimit_field_btn", function () {
|
||||
var index = $(".form_field_bwlimits_outer").find(".form_field_bwlimits_outer_row").length;
|
||||
let index = $(".form_field_bwlimits_outer").find(".form_field_bwlimits_outer_row").length;
|
||||
while (document.getElementById("idBandwidthLimitSources"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_dtlimit_field_btn", function () {
|
||||
var index = $(".form_field_dtlimits_outer").find(".form_field_dtlimits_outer_row").length;
|
||||
let index = $(".form_field_dtlimits_outer").find(".form_field_dtlimits_outer_row").length;
|
||||
while (document.getElementById("idDataTransferLimitSources"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -190,7 +190,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_pattern_field_btn", function () {
|
||||
var index = $(".form_field_patterns_outer").find(".form_field_patterns_outer_row").length;
|
||||
let index = $(".form_field_patterns_outer").find(".form_field_patterns_outer_row").length;
|
||||
while (document.getElementById("idPatternPath"+index) != null){
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -1129,7 +1129,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_pk_field_btn", function () {
|
||||
var index = $(".form_field_pk_outer").find(".form_field_pk_outer_row").length;
|
||||
let index = $(".form_field_pk_outer").find(".form_field_pk_outer_row").length;
|
||||
while (document.getElementById("idPublicKey"+index) != null){
|
||||
index++;
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
});
|
||||
|
||||
$("body").on("click", ".add_new_tpl_user_field_btn", function () {
|
||||
var index = $(".form_field_tpl_users_outer").find(".form_field_tpl_user_outer_row").length;
|
||||
let index = $(".form_field_tpl_users_outer").find(".form_field_tpl_user_outer_row").length;
|
||||
while (document.getElementById("idTplUsername"+index) != null){
|
||||
index++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user