2022-07-17 18:16:00 +00:00
|
|
|
<!--
|
2024-02-01 19:32:43 +00:00
|
|
|
Copyright (C) 2024 Nicola Murino
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
This WebUI uses the KeenThemes Mega Bundle, a proprietary theme:
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
https://keenthemes.com/products/templates-mega-bundle
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
KeenThemes HTML/CSS/JS components are allowed for use only within the
|
|
|
|
SFTPGo product and restricted to be used in a resealable HTML template
|
|
|
|
that can compete with KeenThemes products anyhow.
|
|
|
|
|
|
|
|
This WebUI is allowed for use only within the SFTPGo product and
|
|
|
|
therefore cannot be used in derivative works/products without an
|
|
|
|
explicit grant from the SFTPGo Team (support@sftpgo.com).
|
2022-07-17 18:16:00 +00:00
|
|
|
-->
|
2022-07-11 06:17:36 +00:00
|
|
|
{{template "base" .}}
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- define "page_body"}}
|
|
|
|
<div class="card shadow-sm">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="{{.Title}}" class="card-title section-title"></h3>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- template "errmsg" .Error}}
|
2022-07-11 06:17:36 +00:00
|
|
|
<form id="eventrule_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
2024-02-01 19:32:43 +00:00
|
|
|
|
2022-07-11 06:17:36 +00:00
|
|
|
<div class="form-group row">
|
2024-02-01 19:32:43 +00:00
|
|
|
<label for="idName" data-i18n="general.name" class="col-md-3 col-form-label">Name</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<input id="idName" type="text" placeholder="" name="name" value="{{.Rule.Name}}" maxlength="255" autocomplete="off"
|
|
|
|
spellcheck="false" required {{if eq .Mode 2}}class="form-control-plaintext readonly-input" readonly{{else}}class="form-control"{{end}} />
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idStatus" data-i18n="general.status" class="col-md-3 col-form-label">Status</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idStatus" name="status" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
|
|
|
<option data-i18n="general.active" value="1" {{- if eq .Rule.Status 1 }} selected{{- end}}>Active</option>
|
|
|
|
<option data-i18n="general.inactive" value="0" {{- if eq .Rule.Status 0 }} selected{{- end}}>Inactive</option>
|
2023-01-19 17:33:04 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idDescription" data-i18n="general.description" class="col-md-3 col-form-label">Description</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<input id="idDescription" type="text" class="form-control" name="description" value="{{.Rule.Description}}" maxlength="255">
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idTrigger" data-i18n="rules.trigger" class="col-md-3 col-form-label">Trigger</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idTrigger" name="trigger" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
2022-07-11 06:17:36 +00:00
|
|
|
{{- range .TriggerTypes}}
|
2024-02-01 19:32:43 +00:00
|
|
|
<option value="{{.Value}}" {{if eq $.Rule.Trigger .Value }}selected{{end}} data-i18n="{{.Name}}"></option>
|
2022-07-11 06:17:36 +00:00
|
|
|
{{- end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row trigger trigger-fs mt-10">
|
|
|
|
<label for="idFsEvents" data-i18n="rules.triggers.fs_events" class="col-md-3 col-form-label">Fs events</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idFsEvents" name="fs_events" class="form-select" data-control="i18n-select2" data-hide-search="true" data-close-on-select="false" multiple>
|
2022-07-11 06:17:36 +00:00
|
|
|
{{- range $event := .FsEvents}}
|
|
|
|
<option value="{{$event}}" {{- range $.Rule.Conditions.FsEvents }}{{- if eq . $event}}selected{{- end}}{{- end}}>{{$event}}</option>
|
|
|
|
{{- end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row trigger trigger-provider mt-10">
|
|
|
|
<label for="idProviderEvents" data-i18n="rules.triggers.provider_events" class="col-md-3 col-form-label">Provider events</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idProviderEvents" name="provider_events" class="form-select" data-control="i18n-select2" data-hide-search="true" data-close-on-select="false" multiple>
|
2022-07-11 06:17:36 +00:00
|
|
|
{{- range $event := .ProviderEvents}}
|
|
|
|
<option value="{{$event}}" {{- range $.Rule.Conditions.ProviderEvents }}{{- if eq . $event}}selected{{- end}}{{- end}}>{{$event}}</option>
|
|
|
|
{{- end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row trigger trigger-idp mt-10">
|
|
|
|
<label for="idIDPEvent" data-i18n="general.type" class="col-md-3 col-form-label">IDP Login event</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idIDPEvent" name="idp_login_event" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
|
|
|
<option value="0" data-i18n="ip_list.any" {{if eq .Rule.Conditions.IDPLoginEvent 0}}selected{{end}}>Any</option>
|
|
|
|
<option value="1" data-i18n="rules.idp_logins.user" {{if eq .Rule.Conditions.IDPLoginEvent 1}}selected{{end}}>User login</option>
|
|
|
|
<option value="2" data-i18n="rules.idp_logins.admin" {{if eq .Rule.Conditions.IDPLoginEvent 2}}selected{{end}}>Admin login</option>
|
2023-03-22 18:02:54 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card trigger trigger-schedule mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="rules.triggers.schedule" class="card-title section-title-inner">Schedules</h3>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="schedules">
|
|
|
|
{{template "infomsg" "rules.scheduler_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="schedules">
|
|
|
|
{{- range $idx, $val := .Rule.Conditions.Schedules}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.hour" type="text" class="form-control" name="schedule_hour" value="{{$val.Hours}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.day_of_week" type="text" class="form-control" name="schedule_day_of_week" value="{{$val.DayOfWeek}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.day_of_month" type="text" class="form-control" name="schedule_day_of_month" value="{{$val.DayOfMonth}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.month" type="text" class="form-control" name="schedule_month" value="{{$val.Month}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.hour" type="text" class="form-control" name="schedule_hour" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.day_of_week" type="text" class="form-control" name="schedule_day_of_week" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.day_of_month" type="text" class="form-control" name="schedule_day_of_month" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
|
|
<input data-i18n="[placeholder]general.month" type="text" class="form-control" name="schedule_month" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- if .IsShared}}
|
|
|
|
<div class="form-group row align-items-center trigger trigger-schedule mt-10">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="form-check form-switch form-check-custom form-check-solid">
|
|
|
|
<input class="form-check-input" type="checkbox" id="idConcurrentExecution" name="concurrent_execution" {{if .Rule.Conditions.Options.ConcurrentExecution}}checked{{end}}/>
|
|
|
|
<label data-i18n="rules.concurrent_run" class="form-check-label fw-semibold text-gray-800" for="idConcurrentExecution">
|
|
|
|
Concurrent execution
|
|
|
|
</label>
|
|
|
|
</div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- end}}
|
2022-07-11 06:17:36 +00:00
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row trigger trigger-fs mt-10">
|
|
|
|
<label for="idFsProtocols" data-i18n="rules.protocol_filters" class="col-md-3 col-form-label">Protocol filters</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idFsProtocols" name="fs_protocols" class="form-select" data-control="i18n-select2" data-close-on-select="false" multiple aria-describedby="idFsProtocolsHelp">
|
2022-07-11 06:17:36 +00:00
|
|
|
{{- range $p := .Protocols}}
|
|
|
|
<option value="{{$p}}" {{- range $.Rule.Conditions.Options.Protocols }}{{- if eq . $p}}selected{{- end}}{{- end}}>{{$p}}</option>
|
|
|
|
{{- end}}
|
|
|
|
</select>
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="idFsProtocolsHelp" data-i18n="rules.no_filter" class="form-text"></div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group row trigger trigger-provider mt-10">
|
|
|
|
<label for="idProviderObjects" data-i18n="rules.object_filters" class="col-md-3 col-form-label">Object filters</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idProviderObjects" name="provider_objects" class="form-select" data-control="i18n-select2" data-close-on-select="false" multiple aria-describedby="idProviderObjectsHelp">
|
2022-07-11 06:17:36 +00:00
|
|
|
{{- range $p := .ProviderObjects}}
|
|
|
|
<option value="{{$p}}" {{- range $.Rule.Conditions.Options.ProviderObjects }}{{- if eq . $p}}selected{{- end}}{{- end}}>{{$p}}</option>
|
|
|
|
{{- end}}
|
|
|
|
</select>
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="idProviderObjectsHelp" data-i18n="rules.no_filter" class="form-text"></div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card trigger trigger-fs trigger-provider trigger-schedule trigger-on-demand trigger-idp mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="rules.name_filters" class="card-title section-title-inner">Name filters</h3>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="name_filters">
|
|
|
|
{{template "infomsg" "rules.name_filters_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="name_filters">
|
|
|
|
{{- range $idx, $val := .Rule.Conditions.Options.Names}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="name_pattern" value="{{$val.Pattern}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_name_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match" {{if $val.InverseMatch}}selected{{end}}>Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="name_pattern" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_name_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match">Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card trigger trigger-fs trigger-schedule trigger-on-demand mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="rules.group_name_filters" class="card-title section-title-inner">Group name filters</h3>
|
2022-09-04 15:48:09 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="group_name_filters">
|
|
|
|
{{template "infomsg" "rules.group_name_filters_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="group_name_filters">
|
|
|
|
{{- range $idx, $val := .Rule.Conditions.Options.GroupNames}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="group_name_pattern" value="{{$val.Pattern}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_group_name_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match" {{if $val.InverseMatch}}selected{{end}}>Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="group_name_pattern" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_group_name_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match">Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2022-09-04 15:48:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-09-04 15:48:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card trigger trigger-fs trigger-schedule trigger-provider trigger-on-demand mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="rules.role_name_filters" class="card-title section-title-inner">Role name filters</h3>
|
2022-12-03 16:47:43 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="role_name_filters">
|
|
|
|
{{template "infomsg" "rules.role_name_filters_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="role_name_filters">
|
|
|
|
{{- range $idx, $val := .Rule.Conditions.Options.RoleNames}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="role_name_pattern" value="{{$val.Pattern}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_role_name_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match" {{if $val.InverseMatch}}selected{{end}}>Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="role_name_pattern" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_role_name_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match">Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2022-12-03 16:47:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-12-03 16:47:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card trigger trigger-fs mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="rules.path_filters" class="card-title section-title-inner">Path filters</h3>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="path_filters">
|
|
|
|
{{template "infomsg" "rules.path_filters_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="path_filters">
|
|
|
|
{{- range $idx, $val := .Rule.Conditions.Options.FsPaths}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="fs_path_pattern" value="{{$val.Pattern}}" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_fs_path_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match" {{if $val.InverseMatch}}selected{{end}}>Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
|
|
<input type="text" class="form-control" name="fs_path_pattern" value="" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
|
|
<select name="type_fs_path_pattern" data-i18n="[data-placeholder]general.mode" class="form-select select-repetear" data-hide-search="true" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="inverse" data-i18n="rules.inverse_match">Inverse match</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card trigger trigger-fs mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="rules.file_size_limits" class="card-title section-title-inner">
|
|
|
|
File size limits
|
|
|
|
</h3>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
{{template "infomsg" "rules.file_size_limits_help"}}
|
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idFsMinSize" data-i18n="rules.min_size" class="col-md-3 col-form-label">Min size</label>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<input id="idFsMinSize" type="text" class="form-control" name="fs_min_size" value="{{HumanizeBytes .Rule.Conditions.Options.MinFileSize}}" />
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="col-md-1"></div>
|
|
|
|
<label for="idFsMaxSize" data-i18n="rules.max_size" class="col-md-2 col-form-label">Max size</label>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<input id="idFsMaxSize" type="text" class="form-control" name="fs_max_size" value="{{HumanizeBytes .Rule.Conditions.Options.MaxFileSize}}" />
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="card mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="title.event_actions" class="card-title section-title-inner">Actions</h3>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-02-01 19:32:43 +00:00
|
|
|
<div id="actions">
|
|
|
|
{{template "infomsg" "rules.actions_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="actions">
|
|
|
|
{{- range $idx, $val := .Rule.Actions}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-6 mt-3 mt-md-8">
|
|
|
|
<select name="action_name" data-i18n="[data-placeholder]rules.action_placeholder" class="form-select select-repetear" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
{{- range $.Actions}}
|
|
|
|
<option value="{{.Name}}" {{if eq $val.Name .Name}}selected{{end}}>{{.Name}}</option>
|
|
|
|
{{- end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-5 mt-3 mt-md-8">
|
|
|
|
<select name="action_options" class="form-select select-repetear" data-i18n="[data-placeholder]general.options" data-close-on-select="false" data-allow-clear="true" data-hide-search="true" multiple>
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="2" data-i18n="rules.option_stop_on_failure" {{if $val.Options.StopOnFailure}}selected{{end}}>Stop on failure</option>
|
|
|
|
<option value="3" data-i18n="rules.option_execute_sync" {{if $val.Options.ExecuteSync}}selected{{end}}>Execute sync</option>
|
|
|
|
<option value="1" data-i18n="rules.option_failure_action" {{if $val.Options.IsFailureAction}}selected{{end}}>Is failure action</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-6 mt-3 mt-md-8">
|
|
|
|
<select name="action_name" data-i18n="[data-placeholder]rules.action_placeholder" class="form-select select-repetear" data-allow-clear="true">
|
|
|
|
<option value=""></option>
|
|
|
|
{{- range $.Actions}}
|
|
|
|
<option value="{{.Name}}">{{.Name}}</option>
|
|
|
|
{{- end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-5 mt-3 mt-md-8">
|
|
|
|
<select name="action_options" class="form-select select-repetear" data-i18n="[data-placeholder]general.options" data-close-on-select="false" data-allow-clear="true" data-hide-search="true" multiple>
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="2" data-i18n="rules.option_stop_on_failure">Stop on failure</option>
|
|
|
|
<option value="3" data-i18n="rules.option_execute_sync">Execute sync</option>
|
|
|
|
<option value="1" data-i18n="rules.option_failure_action">Is failure action</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger ps-5 pe-4">
|
|
|
|
<i class="ki-duotone ki-trash fs-2">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
<div class="d-flex justify-content-end mt-12">
|
|
|
|
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
|
|
|
<button type="submit" id="form_submit" class="btn btn-primary px-10" name="form_action" value="submit">
|
|
|
|
<span data-i18n="general.submit" class="indicator-label">
|
|
|
|
Submit
|
|
|
|
</span>
|
|
|
|
<span data-i18n="general.wait" class="indicator-progress">
|
|
|
|
Please wait...
|
|
|
|
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
|
|
|
</span>
|
|
|
|
</button>
|
2022-07-11 06:17:36 +00:00
|
|
|
</div>
|
2024-02-01 19:32:43 +00:00
|
|
|
|
2022-07-11 06:17:36 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- end}}
|
2022-07-11 06:17:36 +00:00
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- define "extra_js"}}
|
|
|
|
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/formrepeater/formrepeater.bundle.js"></script>
|
|
|
|
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
2022-07-11 06:17:36 +00:00
|
|
|
function onTriggerChanged(val){
|
|
|
|
$('.trigger').hide();
|
|
|
|
switch (val) {
|
|
|
|
case '1':
|
|
|
|
$('.trigger-fs').show();
|
|
|
|
break;
|
|
|
|
case '2':
|
|
|
|
$('.trigger-provider').show();
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
$('.trigger-schedule').show();
|
|
|
|
break;
|
2022-08-11 18:09:53 +00:00
|
|
|
case '4':
|
2022-08-12 15:37:29 +00:00
|
|
|
case '5':
|
2023-01-21 14:41:24 +00:00
|
|
|
break;
|
|
|
|
case '6':
|
|
|
|
$('.trigger-on-demand').show();
|
2022-08-11 18:09:53 +00:00
|
|
|
break;
|
2023-03-22 18:02:54 +00:00
|
|
|
case '7':
|
|
|
|
$('.trigger-idp').show();
|
|
|
|
break;
|
2022-07-11 06:17:36 +00:00
|
|
|
default:
|
|
|
|
console.log(`unsupported event trigger type: ${val}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-01 19:32:43 +00:00
|
|
|
$(document).on("i18nload", function(){
|
2022-07-11 06:17:36 +00:00
|
|
|
onTriggerChanged('{{.Rule.Trigger}}');
|
|
|
|
});
|
2024-02-01 19:32:43 +00:00
|
|
|
|
|
|
|
$(document).on("i18nshow", function(){
|
|
|
|
initRepeater('#schedules');
|
|
|
|
initRepeater('#name_filters');
|
|
|
|
initRepeater('#group_name_filters');
|
|
|
|
initRepeater('#role_name_filters');
|
|
|
|
initRepeater('#path_filters');
|
|
|
|
initRepeater('#actions');
|
|
|
|
initRepeaterItems();
|
|
|
|
|
|
|
|
$('#idTrigger').on("change", function(){
|
|
|
|
onTriggerChanged(this.value);
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#eventrule_form').submit(function (event) {
|
|
|
|
let submitButton = document.querySelector('#form_submit');
|
|
|
|
submitButton.setAttribute('data-kt-indicator', 'on');
|
|
|
|
submitButton.disabled = true;
|
|
|
|
});
|
|
|
|
});
|
2022-07-11 06:17:36 +00:00
|
|
|
</script>
|
2024-02-01 19:32:43 +00:00
|
|
|
{{- end}}
|