2016-10-06 20:34:07 +02:00
|
|
|
<div id="bot-settings" class="settings-section" data-name="your-bots">
|
2017-04-15 05:25:53 +02:00
|
|
|
<div class="bot-settings-form">
|
2018-06-13 17:31:58 +02:00
|
|
|
{{#unless page_params.is_guest}}
|
2017-07-05 21:50:23 +02:00
|
|
|
<div class="tip">
|
2020-05-26 05:15:21 +02:00
|
|
|
{{#tr this}}Looking for our <a href="/integrations" target="_blank" rel="noopener noreferrer">Integrations</a> or <a href="/api" rel="noopener noreferrer" target="_blank">API</a> documentation?{{/tr}}
|
2017-07-05 21:50:23 +02:00
|
|
|
</div>
|
2018-01-29 16:10:54 +01:00
|
|
|
<div class="tip bot-settings-tip"></div>
|
2016-10-05 02:19:14 +02:00
|
|
|
|
2017-05-30 16:12:02 +02:00
|
|
|
<div>
|
2017-06-10 12:32:06 +02:00
|
|
|
<span>{{t 'Download config of all active outgoing webhook bots in Zulip Botserver format.' }}</span>
|
2018-05-29 10:18:06 +02:00
|
|
|
<a type="submit" download="{{botserverrc}}" id= "download_botserverrc" class="btn" title="{{t 'Download botserverrc' }}">
|
2018-07-03 01:47:09 +02:00
|
|
|
<i class="fa fa-download sea-green" aria-hidden="true"></i>
|
2017-05-30 16:12:02 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
2018-06-13 17:31:58 +02:00
|
|
|
{{/unless}}
|
2017-05-30 16:12:02 +02:00
|
|
|
|
2017-04-15 05:25:53 +02:00
|
|
|
<ul class="nav nav-tabs nav-justified" id="bots_lists_navbar">
|
2017-07-05 13:07:46 +02:00
|
|
|
<li class="active active-bots-tab"><a>{{t "Active bots" }}</a></li>
|
2017-04-15 05:25:53 +02:00
|
|
|
<li class="inactive-bots-tab"><a>{{t "Inactive bots" }}</a></li>
|
2018-06-13 16:59:15 +02:00
|
|
|
<li class="add-a-new-bot-tab {{#unless can_create_new_bots}}hide{{/unless}}"><a>{{t "Add a new bot" }}</a></li>
|
2017-04-15 05:25:53 +02:00
|
|
|
</ul>
|
2017-02-25 20:14:47 +01:00
|
|
|
|
2017-07-11 15:05:15 +02:00
|
|
|
<ol class="bots_list required-text" id="active_bots_list" data-empty="{{t 'You have no active bots.' }}">
|
2017-04-15 05:25:53 +02:00
|
|
|
</ol>
|
2017-02-25 20:14:47 +01:00
|
|
|
|
2017-07-11 15:05:15 +02:00
|
|
|
<ol class="bots_list required-text" id="inactive_bots_list" data-empty="{{t 'You have no inactive bots.' }}">
|
2017-04-15 05:25:53 +02:00
|
|
|
</ol>
|
2017-02-25 20:14:47 +01:00
|
|
|
|
2017-04-15 05:25:53 +02:00
|
|
|
<div id="bot_table_error" class="alert alert-error hide"></div>
|
2016-10-05 02:19:14 +02:00
|
|
|
|
2017-06-29 07:38:53 +02:00
|
|
|
<div id="add-a-new-bot-form">
|
2018-01-29 16:10:54 +01:00
|
|
|
<form id="create_bot_form"
|
2018-06-13 16:59:15 +02:00
|
|
|
class="form-horizontal no-padding {{#unless can_create_new_bots}}hide{{/unless}}">
|
2017-04-15 05:25:53 +02:00
|
|
|
<div class="new-bot-form">
|
2017-05-30 19:19:48 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<label for="bot_type">
|
|
|
|
{{t "Bot type" }}
|
2018-07-03 01:47:09 +02:00
|
|
|
<i class="fa fa-question-circle settings-info-icon bot_type_tooltip" aria-hidden="true" data-toggle="tooltip"
|
2018-04-05 08:38:46 +02:00
|
|
|
title='{{t "Incoming webhooks can only send messages." }}'></i>
|
2017-05-30 19:19:48 +02:00
|
|
|
</label>
|
|
|
|
<select name="bot_type" id="create_bot_type">
|
2017-11-22 23:58:58 +01:00
|
|
|
{{#each page_params.bot_types}}
|
|
|
|
{{#if this.allowed}}
|
|
|
|
<option value="{{this.type_id}}">{{this.name}}</option>
|
|
|
|
{{/if}}
|
|
|
|
{{/each}}
|
2017-05-30 19:19:48 +02:00
|
|
|
</select>
|
|
|
|
</div>
|
2018-03-05 16:18:52 +01:00
|
|
|
<div class="input-group" id="service_name_list">
|
|
|
|
<label for="select_service_name">{{t "Bot"}}</label>
|
|
|
|
<select name="service_name" id="select_service_name">
|
|
|
|
{{#each page_params.realm_embedded_bots}}
|
|
|
|
<option value="{{this.name}}">{{this.name}}</option>
|
|
|
|
{{/each}}
|
|
|
|
</select>
|
|
|
|
</div>
|
2017-04-15 05:25:53 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<label for="create_bot_name">{{t "Full name" }}</label>
|
|
|
|
<input type="text" name="bot_name" id="create_bot_name" class="required"
|
2018-04-03 10:07:23 +02:00
|
|
|
maxlength=100 placeholder="{{t 'Cookie Bot' }}" value="" />
|
2017-04-15 05:25:53 +02:00
|
|
|
<div><label for="create_bot_name" generated="true" class="text-error"></label></div>
|
|
|
|
</div>
|
|
|
|
<div class="input-group">
|
2019-09-17 23:55:35 +02:00
|
|
|
<label for="bot_short_name">{{t "Bot email (a-z, 0-9, and dashes only)" }}</label>
|
2017-04-15 05:25:53 +02:00
|
|
|
<input type="text" name="bot_short_name" id="create_bot_short_name" class="required bot_local_part"
|
2018-04-03 10:07:23 +02:00
|
|
|
placeholder="{{t 'cookie' }}" value="" />
|
2017-04-15 05:25:53 +02:00
|
|
|
-bot@{{ page_params.realm_bot_domain }}
|
|
|
|
<div>
|
|
|
|
<label for="create_bot_short_name" generated="true" class="text-error"></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-03 18:35:12 +02:00
|
|
|
<div id="payload_url_inputbox">
|
|
|
|
<div class="input-group">
|
2017-12-30 16:32:36 +01:00
|
|
|
<label for="create_payload_url">{{t "Endpoint URL" }}</label>
|
2017-07-03 18:35:12 +02:00
|
|
|
<input type="text" name="payload_url" id="create_payload_url"
|
2018-05-23 16:20:12 +02:00
|
|
|
maxlength=2083 placeholder="https://hostname.example.com" value="" />
|
2017-07-03 18:35:12 +02:00
|
|
|
<div><label for="create_payload_url" generated="true" class="text-error"></label></div>
|
|
|
|
</div>
|
|
|
|
<div class="input-group">
|
|
|
|
<label for="interface_type">{{t "Outgoing webhook message format" }}</label>
|
|
|
|
<select name="interface_type" id="create_interface_type">
|
|
|
|
<option value="1">Zulip</option>
|
|
|
|
<option value="2">{{t "Slack compatible" }}</option>
|
|
|
|
</select>
|
|
|
|
<div><label for="create_interface_type" generated="true" class="text-error"></label></div>
|
|
|
|
</div>
|
2017-06-10 18:43:31 +02:00
|
|
|
</div>
|
2018-01-07 19:24:14 +01:00
|
|
|
<div id="config_inputbox">
|
2018-02-01 11:28:08 +01:00
|
|
|
{{#each page_params.realm_embedded_bots as |bot index|}}
|
|
|
|
{{#each bot.config as |config_value config_key|}}
|
2019-07-11 04:05:28 +02:00
|
|
|
{{> ../embedded_bot_config_item botname=bot.name key=config_key value=config_value}}
|
2018-02-01 11:28:08 +01:00
|
|
|
{{/each}}
|
|
|
|
{{/each}}
|
2018-01-07 19:24:14 +01:00
|
|
|
</div>
|
2017-04-15 05:25:53 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<div id="bot_avatar_file"></div>
|
2019-03-09 17:43:48 +01:00
|
|
|
<input type="file" name="bot_avatar_file_input" class="notvisible" id="bot_avatar_file_input" value="{{t 'Upload profile picture' }}" />
|
2019-05-08 07:44:37 +02:00
|
|
|
<button class="button white rounded small btn-danger" style="display: none;" id="bot_avatar_clear_button">{{t "Clear profile picture" }}</button>
|
2019-03-09 17:43:48 +01:00
|
|
|
<button class="button white rounded" id="bot_avatar_upload_button">{{t "Customize profile picture" }}</button> ({{t "Optional" }})
|
2017-04-15 05:25:53 +02:00
|
|
|
</div>
|
|
|
|
<p>
|
|
|
|
<div id="bot_avatar_file_input_error" class="text-error"></div>
|
|
|
|
</p>
|
2017-06-29 07:38:53 +02:00
|
|
|
<button type="submit" class="button white rounded sea-green" id="create_bot_button">
|
2017-03-18 10:44:00 +01:00
|
|
|
{{t 'Create bot' }}
|
|
|
|
</button>
|
2018-02-14 09:29:33 +01:00
|
|
|
<div class="create_bot_spinner"></div>
|
2017-04-15 05:25:53 +02:00
|
|
|
</div>
|
|
|
|
</form>
|
2016-10-05 02:19:14 +02:00
|
|
|
</div>
|
|
|
|
|
2017-04-15 05:25:53 +02:00
|
|
|
</div>
|
2016-10-05 02:19:14 +02:00
|
|
|
</div>
|