wazuh-kibana-app/public/templates/settings/settings-api.html

131 lines
8.4 KiB
HTML
Raw Normal View History

2018-11-05 10:18:36 +00:00
<div layout="column" layout-align="start stretch" ng-if="ctrl.tab === 'api' && !ctrl.load">
2018-06-11 09:22:02 +00:00
2018-07-02 08:55:57 +00:00
<!-- Headline -->
<div layout="column" layout-padding>
<span class="font-size-18"><i class="fa fa-fw fa-tasks" aria-hidden="true"></i> API configuration</span>
<span class="md-subheader">Use Wazuh API settings to connect the Kibana plugin to your Wazuh manager or cluster</span>
2018-07-02 08:55:57 +00:00
</div>
<!-- End headline -->
2018-06-13 10:02:38 +00:00
<!-- API configuration card section -->
<div layout="row" layout-align="start start">
<md-card flex class="wz-md-card">
<md-card-content>
<!-- API entries headings section -->
2018-07-02 08:55:57 +00:00
<div layout="row" class="wz-padding-bottom-14">
2018-06-13 10:02:38 +00:00
<p flex="15" class="wz-text-bold">Cluster</p>
<p flex="20" class="wz-text-bold">Manager</p>
<p flex="15" class="wz-text-bold">API URL</p>
<p flex="15" class="wz-text-bold">API Port</p>
<p flex="15" class="wz-text-bold">User</p>
<p flex="20" class="wz-text-bold">Actions</p>
</div>
<!-- End API entries headings section -->
2018-06-11 09:22:02 +00:00
2018-06-13 10:02:38 +00:00
<!-- API entries list section -->
2018-11-05 10:18:36 +00:00
<div ng-repeat="entry in ctrl.apiEntries">
2018-06-13 10:02:38 +00:00
<!-- API entry -->
<div layout="row" layout-align="space-between center" class="wz-padding-top-10 wz-padding-bottom-14">
<p flex="15">
2018-11-05 10:18:36 +00:00
<i ng-show="(entry._id === ctrl.currentDefault)" tooltip="This is the default Manager" tooltip-placement="right" class="fa fa-star wz-color-orange" aria-hidden="true"></i> {{entry._source.cluster_info.cluster}}</p>
2018-06-13 10:02:38 +00:00
<p flex="20">{{entry._source.cluster_info.manager}}</p>
<p flex="15">{{entry._source.url}}</p>
<p flex="15">{{entry._source.api_port}}</p>
<p flex="15">{{entry._source.api_user}}</p>
<p flex="20">
2018-11-05 10:18:36 +00:00
<i ng-click="ctrl.setDefault(entry)" tooltip="Set as default Manager" class="fa fa-star font-size-18 cursor-pointer" aria-hidden="true"></i>
<i ng-click="ctrl.removeManager(entry)" tooltip="Remove manager" class="fa fa-trash wz-margin-left-7 cursor-pointer" aria-hidden="true"></i>
<i ng-click="ctrl.checkManager(entry)" tooltip="Check connection" class="fa fa-refresh wz-margin-left-7 cursor-pointer" aria-hidden="true"></i>
<i ng-click="ctrl.toggleEditor(entry)" tooltip="Edit" class="fa fa-pencil wz-margin-left-7 cursor-pointer" aria-hidden="true"></i>
2018-06-13 10:02:38 +00:00
</p>
2018-06-11 09:22:02 +00:00
</div>
2018-06-13 10:02:38 +00:00
<!-- End API entry -->
<!-- Edit API form -->
2018-11-05 10:18:36 +00:00
<div layout="row" layout-align="space-between center" ng-if="ctrl.showEditForm[entry._id] && ctrl.isEditing">
<form flex ng-submit="ctrl.updateSettings(entry)" layout="column" layout-align="start stretch" class="margin-top-30">
2018-06-13 10:02:38 +00:00
<!-- Input section -->
<md-input-container class="wz-input-container">
<label>Username</label>
2018-11-05 10:18:36 +00:00
<input ng-model="ctrl.formUpdate.user" ng-init="formUpdate.user=entry._source.api_user" type="text" placeholder="" aria-label="username"
2018-06-13 10:02:38 +00:00
required/>
</md-input-container>
<md-input-container class="wz-input-container">
<label>Password</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formUpdate.password" type="password" placeholder="" aria-label="password" required/>
2018-06-13 10:02:38 +00:00
</md-input-container>
<md-input-container class="wz-input-container">
<label>URL</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formUpdate.url" ng-init="formUpdate.url=entry._source.url" type="url" placeholder="http(s)://" aria-label="full url"
2018-06-13 10:02:38 +00:00
required/>
</md-input-container>
<md-input-container class="wz-input-container">
<label>Port</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formUpdate.port" ng-init="formUpdate.port=entry._source.api_port" type="text" placeholder="" aria-label="port"
2018-06-13 10:02:38 +00:00
required/>
</md-input-container>
<!-- Button and errors section -->
2018-11-12 16:47:36 +00:00
<div layout="row" layout-align="center center" ng-if="ctrl.messageError">
<p class="color-f9">{{ctrl.messageErrorUpdate}}</p>
2018-06-13 10:02:38 +00:00
</div>
<div layout="row" layout-align="center center">
<md-button type="submit" class="wz-button md-raised md-primary" aria-label="Update API button">
<i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Update Wazuh API entry
2018-06-13 10:02:38 +00:00
</md-button>
</div>
</form>
2018-06-11 09:22:02 +00:00
</div>
2018-06-13 10:02:38 +00:00
<!-- End edit API form -->
2018-06-11 09:22:02 +00:00
</div>
2018-06-13 10:02:38 +00:00
<!-- End API entries list section -->
<!-- Add API button section -->
2018-11-12 16:47:36 +00:00
<div ng-show="!ctrl.isUpdating()" layout="row" layout-align="center center" class="wz-padding-top-10">
<md-button ng-click="ctrl.switch()" class="wz-button md-raised md-primary"
2018-06-13 10:02:38 +00:00
aria-label="Add new API button">
<i class="fa fa-plus-circle fa-fw" aria-hidden="true"></i> Add new Wazuh API entry
2018-06-11 09:22:02 +00:00
</md-button>
</div>
2018-06-13 10:02:38 +00:00
<!-- End add API button section -->
<!-- Add API section-->
2018-11-12 16:47:36 +00:00
<div layout="row" ng-show="!currentAPI || (ctrl.addManagerContainer && !ctrl.isEditing)">
2018-06-13 10:02:38 +00:00
<!-- Add API form -->
2018-11-12 16:47:36 +00:00
<form flex ng-submit="ctrl.saveSettings()" layout="column" layout-align="start stretch"
2018-06-13 10:02:38 +00:00
class="margin-top-30">
<!-- Input section -->
<md-input-container class="wz-input-container">
<label>Username</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formData.user" type="text" placeholder="" aria-label="username" required/>
2018-06-13 10:02:38 +00:00
</md-input-container>
<md-input-container class="wz-input-container">
<label>Password</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formData.password" type="password" placeholder="" aria-label="password" required/>
2018-06-13 10:02:38 +00:00
</md-input-container>
<md-input-container class="wz-input-container">
<label>URL</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formData.url" type="url" placeholder="http(s)://" aria-label="full url" required/>
2018-06-13 10:02:38 +00:00
</md-input-container>
<md-input-container class="wz-input-container">
<label>Port</label>
2018-11-12 16:47:36 +00:00
<input ng-model="ctrl.formData.port" type="text" placeholder="" aria-label="port" required/>
2018-06-13 10:02:38 +00:00
</md-input-container>
<!-- Button and errors section -->
2018-11-12 16:47:36 +00:00
<div layout="row" layout-align="center center" ng-if="ctrl.messageError">
<p class="color-f9">{{ctrl.messageError}}</p>
2018-06-13 10:02:38 +00:00
</div>
<div layout="row" layout-align="center center">
<md-button type="submit" class="wz-button md-raised md-primary" aria-label="Save API button">
<i class="fa fa-floppy-o fa-fw" aria-hidden="true"></i> Save Wazuh API entry
2018-06-13 10:02:38 +00:00
</md-button>
</div>
</form>
<!-- End add API form -->
</div>
<!-- End add API section-->
</md-card-content>
</md-card>
</div>
<!-- End API configuration card section -->
2018-06-13 10:02:38 +00:00
</div>