The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-integrations/client/views/integrationsOutgoing.html

149 lines
6.9 KiB

<template name="integrationsOutgoing">
<div class="permissions-manager">
{{#if hasPermission}}
<a href="{{pathFor "admin-integrations"}}"><i class="icon-angle-left"></i> {{_ "Back_to_integrations"}}</a><br><br>
<div class="rocket-form">
<div class="section">
<div class="section-content">
<div class="input-line double-col">
<label>{{_ "Enabled"}}</label>
<div>
<label><input type="radio" name="enabled" value="1" checked="{{$eq data.enabled true}}" /> {{_ "True"}}</label>
<label><input type="radio" name="enabled" value="0" checked="{{$neq data.enabled true}}" /> {{_ "False"}}</label>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Name"}} ({{_ "optional"}})</label>
<div>
<input type="text" name="name" value="{{data.name}}" placeholder="{{_ 'Optional'}}" />
<div class="settings-description">{{_ "You_should_name_it_to_easily_manage_your_integrations"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Channel"}} ({{_ "optional"}})</label>
<div>
<input type="text" name="channel" value="{{data.channel}}" placeholder="{{_ 'User_or_channel_name'}}" />
<div class="settings-description">{{_ "Optional channel to listen on"}}</div>
<div class="settings-description">{{{_ "Start_with_s_for_user_or_s_for_channel_Eg_s_or_s" "@" "#" "@john" "#general"}}}</div>
<div class="settings-description">{{{_ "Integrations_for_all_channels"}}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Trigger_Words"}} ({{_ "optional"}})</label>
<div>
<input type="text" name="triggerWords" value="{{join data.triggerWords ','}}" />
<div class="settings-description">{{_ "When a line starts with one of these words, post to the URL(s) below"}}</div>
<div class="settings-description">{{_ "Separate multiple words with commas"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "URLs"}}</label>
<div>
<textarea name="urls" style="height: 100px;">{{join data.urls "\n"}}</textarea>
<div class="settings-description">{{_ "Enter as many URLs as you like, one per line, please"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Impersonate_user"}}</label>
<div>
<label><input type="radio" name="impersonateUser" value="1" checked="{{$eq data.impersonateUser true}}" /> {{_ "True"}}</label>
<label><input type="radio" name="impersonateUser" value="0" checked="{{$neq data.impersonateUser true}}" /> {{_ "False"}}</label>
<div class="settings-description">{{_ "Impersonate_user_description"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Post_as"}}</label>
<div>
<input type="text" name="username" value="{{data.username}}" />
<div class="settings-description">{{_ "Choose_the_username_that_this_integration_will_post_as"}}</div>
<div class="settings-description">{{_ "Should_exists_a_user_with_this_username"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Alias"}} ({{_ "optional"}})</label>
<div>
<input type="text" name="alias" value="{{data.alias}}" placeholder="{{_ 'Optional'}}" />
<div class="settings-description">{{_ "Choose_the_alias_that_will_appear_before_the_username_in_messages"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Avatar_URL"}} ({{_ "optional"}})</label>
<div>
<input type="url" name="avatar" value="{{data.avatar}}" placeholder="{{_ 'Optional'}}" />
<div class="settings-description">{{_ "You_can_change_a_different_avatar_too"}}</div>
<div class="settings-description">{{_ "Should_be_a_URL_of_an_image"}}</div>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Emoji"}} ({{_ "optional"}})</label>
<div>
<input type="text" name="emoji" value="{{data.emoji}}" placeholder="{{_ 'Optional'}}" />
<div class="settings-description">{{_ "You_can_use_an_emoji_as_avatar"}}</div>
<div class="settings-description">{{{_ "Example_s" ":ghost:"}}}</div>
</div>
</div>
<div class="input-line double-col">
<label>Token ({{_ "optional"}})</label>
<div>
<input type="text" name="token" value="{{data.token}}" />
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Script_Enabled"}}</label>
<div>
<label><input type="radio" name="scriptEnabled" value="1" checked="{{$eq data.scriptEnabled true}}" /> {{_ "True"}}</label>
<label><input type="radio" name="scriptEnabled" value="0" checked="{{$neq data.scriptEnabled true}}" /> {{_ "False"}}</label>
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Script"}}</label>
<div>
<div class="code-mirror-box">
<div class="title">
{{_ "Script"}}
</div>
{{> CodeMirror name="script" options=editorOptions code=data.script }}
<div class="buttons">
<button class="button button-primary button-fullscreen">
Full Screen
</button>
<button class="button button-primary button-restore">
Exit Full Screen
</button>
</div>
</div>
{{#if data.scriptError}}
<div class="code-error-box">
<div class="title">
{{data.scriptError.name}}
</div>
<pre>{{data.scriptError.message}}</pre>
</div>
{{/if}}
</div>
</div>
<div class="input-line double-col">
<label>{{_ "Responding"}}</label>
<div>
<div class="settings-description">{{{_ "If the handler wishes to post a response back into the channel, the following JSON should be returned as the body of the response:"}}}</div>
<pre><code class="hljs json json-example">{{{exampleJson}}}</code></pre>
<div class="settings-description">{{{_ "Empty bodies or bodies with an empty text property will simply be ignored. Non-200 responses will be retried a reasonable number of times. A response will be posted using the alias and avatar specified above. You can override these informations as in the example above."}}}</div>
</div>
</div>
<div class="input-line message-example">
{{#nrr nrrargs 'message' example}}{{/nrr}}
</div>
</div>
</div>
<div class="submit">
{{#if data.token}}
<button class="button red delete"><i class="icon-trash"></i><span>{{_ "Delete"}}</span></button>
{{/if}}
<button class="button save"><i class="icon-send"></i><span>{{_ "Save_changes"}}</span></button>
</div>
</div>
{{else}}
{{_ "Not_authorized"}}
{{/if}}
</div>
</template>