Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1520 from ovh-ux/develop
Browse files Browse the repository at this point in the history
Release v7.28.0
  • Loading branch information
antleblanc authored Jul 24, 2019
2 parents cdc1dad + 14bf185 commit 6433e7c
Show file tree
Hide file tree
Showing 26 changed files with 272 additions and 84 deletions.
19 changes: 15 additions & 4 deletions client/app/dbaas/logs/detail/aliases/logs-aliases.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ class LogsAliasesService {
* @memberof LogsAliasesService
*/
createAlias(serviceName, alias) {
return this.AliasApiService.create({ serviceName }, alias)
return this.AliasApiService.create({ serviceName },
{
description: alias.description,
optionId: alias.optionId,
suffix: alias.suffix,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand All @@ -216,7 +221,11 @@ class LogsAliasesService {
* @memberof LogsAliasesService
*/
updateAlias(serviceName, alias) {
return this.AliasApiService.update({ serviceName, aliasId: alias.aliasId }, alias)
return this.AliasApiService.update({ serviceName, aliasId: alias.aliasId },
{
description: alias.description,
optionId: alias.optionId,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand All @@ -226,7 +235,8 @@ class LogsAliasesService {
}

attachStream(serviceName, alias, stream) {
return this.AliasApiService.linkStream({ serviceName, aliasId: alias.aliasId }, stream)
return this.AliasApiService.linkStream({ serviceName, aliasId: alias.aliasId },
{ streamId: stream.streamId })
.$promise
.then(operation => this.LogsHelperService.handleOperation(
serviceName,
Expand All @@ -249,7 +259,8 @@ class LogsAliasesService {
}

attachIndex(serviceName, alias, index) {
return this.AliasApiService.linkIndex({ serviceName, aliasId: alias.aliasId }, index)
return this.AliasApiService.linkIndex({ serviceName, aliasId: alias.aliasId },
{ indexId: index.indexId })
.$promise
.then(operation => this.LogsHelperService.handleOperation(
serviceName,
Expand Down
29 changes: 25 additions & 4 deletions client/app/dbaas/logs/detail/dashboards/logs-dashboards.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ class LogsDashboardsService {
* @memberof LogsDashboardsService
*/
createDashboard(serviceName, dashboard) {
return this.DashboardsApiService.create({ serviceName }, dashboard)
return this.DashboardsApiService.create({ serviceName },
{
description: dashboard.description,
optionId: dashboard.optionId,
title: dashboard.title,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand All @@ -184,8 +189,8 @@ class LogsDashboardsService {
* @memberof LogsDashboardsService
*/
duplicateDashboard(serviceName, dashboard, dashboardId) {
if (!dashboard.streamId) { delete dashboard.streamId; } // eslint-disable-line
return this.DashboardsApiService.duplicate({ serviceName, dashboardId }, dashboard)
return this.DashboardsApiService.duplicate({ serviceName, dashboardId },
this.constructor.transformDashboardToDuplicate(dashboard))
.$promise
.then((operation) => {
this.resetAllCache();
Expand All @@ -204,7 +209,12 @@ class LogsDashboardsService {
*/
updateDashboard(serviceName, dashboard) {
return this.DashboardsApiService
.update({ serviceName, DashboardId: dashboard.dashboardId }, dashboard)
.update({ serviceName, dashboardId: dashboard.dashboardId },
{
title: dashboard.title,
description: dashboard.description,
optionId: dashboard.optionId,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand Down Expand Up @@ -258,6 +268,17 @@ class LogsDashboardsService {
return url;
}

static transformDashboardToDuplicate(dashboard) {
const toDuplicate = {
description: dashboard.description,
optionId: dashboard.optionId,
streamId: dashboard.streamId,
title: dashboard.title,
};
if (!dashboard.streamId) { delete toDuplicate.streamId; } // eslint-disable-line
return toDuplicate;
}

resetAllCache() {
this.AccountingAapiService.resetAllCache();
this.DashboardsApiService.resetAllCache();
Expand Down
16 changes: 12 additions & 4 deletions client/app/dbaas/logs/detail/home/logs-home.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ class LogsHomeService {
start: Math.max(moment().subtract(this.LogsConstants.DATA_STORAGE.TIME_PERIOD_MONTHS, 'month').unix() * 1000, moment(this.createdAt).unix() * 1000),
queries: [{
metric: this.LogsConstants.DATA_STORAGE.METRICS.SUM,
aggregator: this.LogsConstants.DATA_STORAGE.AGGREGATORS.MAX,
aggregator: this.LogsConstants.DATA_STORAGE.AGGREGATORS.ZIMSUM,
downsample: this.LogsConstants.DATA_STORAGE.DOWNSAMPLING_MODE['24H_MAX'],
},
{
metric: this.LogsConstants.DATA_STORAGE.METRICS.COUNT,
aggregator: this.LogsConstants.DATA_STORAGE.AGGREGATORS.MAX,
aggregator: this.LogsConstants.DATA_STORAGE.AGGREGATORS.ZIMSUM,
downsample: this.LogsConstants.DATA_STORAGE.DOWNSAMPLING_MODE['24H_MAX'],
}],
};
Expand Down Expand Up @@ -192,7 +192,11 @@ class LogsHomeService {
* @memberof LogsHomeService
*/
updateDisplayName(serviceName, service) {
return this.LogsLexiService.update({ serviceName }, service)
return this.LogsLexiService.update({ serviceName },
{
displayName: service.displayName,
isCapped: service.isCapped,
})
.$promise.then((operation) => {
this.resetAllCache();
return this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'logs_home_display_name_update_success', { })
Expand All @@ -213,7 +217,11 @@ class LogsHomeService {
* @memberof LogsHomeService
*/
updateCappedPlan(serviceName, service) {
return this.LogsLexiService.update({ serviceName }, service)
return this.LogsLexiService.update({ serviceName },
{
displayName: service.displayName,
isCapped: service.isCapped,
})
.$promise.then((operation) => {
this.resetAllCache();
return this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'logs_home_capped_update_success', { });
Expand Down
13 changes: 11 additions & 2 deletions client/app/dbaas/logs/detail/index/logs-index.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ class LogsIndexService {
}

createIndex(serviceName, object) {
return this.IndexApiService.post({ serviceName }, object).$promise
return this.IndexApiService.post({ serviceName },
{
alertNotifyEnabled: object.alertNotifyEnabled,
optionId: object.optionId,
suffix: object.suffix,
}).$promise
.then((operation) => {
this.resetAllCache();
return this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'logs_index_create_success', { name: object.suffix });
Expand All @@ -99,7 +104,11 @@ class LogsIndexService {
}

updateIndex(serviceName, index, indexInfo) {
return this.IndexApiService.put({ serviceName, indexId: index.indexId }, indexInfo)
return this.IndexApiService.put({ serviceName, indexId: index.indexId },
{
description: indexInfo.description,
alertNotifyEnabled: indexInfo.alertNotifyEnabled,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand Down
13 changes: 11 additions & 2 deletions client/app/dbaas/logs/detail/inputs/logs-inputs.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,11 @@ class LogsInputsService {

updateFlowgger(serviceName, input, flowgger) {
return this.InputsApiLexiService
.updateFlowgger({ serviceName, inputId: input.info.inputId }, flowgger)
.updateFlowgger({ serviceName, inputId: input.info.inputId },
{
logFormat: flowgger.logFormat,
logFraming: flowgger.logFraming,
})
.$promise
.then((operation) => {
this.InputsApiAapiService.resetAllCache();
Expand All @@ -408,7 +412,12 @@ class LogsInputsService {

updateLogstash(serviceName, input, logstash) {
return this.InputsApiLexiService
.updateLogstash({ serviceName, inputId: input.info.inputId }, logstash)
.updateLogstash({ serviceName, inputId: input.info.inputId },
{
filterSection: logstash.filterSection,
inputSection: logstash.inputSection,
patternSection: logstash.patternSection,
})
.$promise
.then((operation) => {
this.InputsApiAapiService.resetAllCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class LogsOfferCtrl {
loaderFunction: () => this.LogsOrderService.saveOrder(this.serviceName, this.offerDetail)
.then(response => this.$window.open(response.order.url, '_target'))
.catch(() => this.CucControllerHelper.scrollPageToTop())
.finally(() => this.back()),
.finally(() => this.goToHomePage()),
});
this.savingOffer.load();
}
Expand Down
2 changes: 1 addition & 1 deletion client/app/dbaas/logs/detail/offer/logs-offer.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
data-ng-click="ctrl.saveOffer()"></button>
<a class="oui-button oui-button_link"
data-translate="common_cancel"
data-ng-click="ctrl.back()"></a>
data-ng-click="ctrl.goToHomePage()"></a>
</div>
</div>
</div>
20 changes: 17 additions & 3 deletions client/app/dbaas/logs/detail/roles/logs-roles.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ class LogsRolesService {
}

addRole(serviceName, object) {
return this.RolesApiService.create({ serviceName }, object).$promise
return this.RolesApiService.create({ serviceName },
{
description: object.description,
name: object.name,
optionId: object.optionId,
}).$promise
.then((operation) => {
this.resetAllCache();
return this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'logs_role_add_success', { name: object.name });
Expand All @@ -171,7 +176,12 @@ class LogsRolesService {
}

updateRole(serviceName, roleId, object) {
return this.RolesApiService.update({ serviceName, roleId }, object).$promise
return this.RolesApiService.update({ serviceName, roleId },
{
description: object.description,
name: object.name,
optionId: object.optionId,
}).$promise
.then((operation) => {
this.resetAllCache();
return this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'logs_role_update_success', { name: object.name });
Expand All @@ -196,7 +206,11 @@ class LogsRolesService {
}

createMember(serviceName, roleId, userDetails) {
return this.MembersApiService.create({ serviceName, roleId }, userDetails).$promise
return this.MembersApiService.create({ serviceName, roleId },
{
note: userDetails.note,
username: userDetails.username,
}).$promise
.then((operation) => {
this.resetAllCache();
return this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'logs_role_member_add_success', { name: userDetails.username });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ class LogsStreamsAlertsService {
* @memberof LogsStreamsAlertsService
*/
addAlert(serviceName, streamId, alert) {
return this.AlertsApiService.post({ serviceName, streamId }, alert).$promise
return this.AlertsApiService.post({ serviceName, streamId },
{
backlog: alert.backlog,
conditionType: alert.conditionType,
constraintType: alert.constraintType,
field: alert.field,
grace: alert.grace,
queryFilter: alert.queryFilter,
repeatNotificationsEnabled: alert.repeatNotificationsEnabled,
threshold: alert.threshold,
thresholdType: alert.thresholdType,
time: alert.time,
title: alert.title,
value: alert.value,
}).$promise
.then(operation => this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'streams_alerts_add_success', { alertName: alert.title }))
.catch(err => this.LogsHelperService.handleError('streams_alerts_add_error', err, { alertName: alert.title }));
}
Expand Down Expand Up @@ -136,7 +150,21 @@ class LogsStreamsAlertsService {
*/
updateAlert(serviceName, streamId, alert) {
return this.AlertsApiService
.put({ serviceName, streamId, alertId: alert.alertId }, alert).$promise
.put({ serviceName, streamId, alertId: alert.alertId },
{
backlog: alert.backlog,
conditionType: alert.conditionType,
constraintType: alert.constraintType,
field: alert.field,
grace: alert.grace,
queryFilter: alert.queryFilter,
repeatNotificationsEnabled: alert.repeatNotificationsEnabled,
threshold: alert.threshold,
thresholdType: alert.thresholdType,
time: alert.time,
title: alert.title,
value: alert.value,
}).$promise
.then(operation => this.LogsHelperService.handleOperation(serviceName, operation.data || operation, 'streams_alerts_update_success', { alertName: alert.title }))
.catch(err => this.LogsHelperService.handleError('streams_alerts_update_error', err, { alertName: alert.title }));
}
Expand Down
39 changes: 32 additions & 7 deletions client/app/dbaas/logs/detail/streams/follow/streams-follow.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,38 @@
</div>

<oui-action-menu text="{{ ::'common_actions' | translate}}" align="start">
<oui-action-menu-item text="{{ ::'logs_streams_follow_copy_address' | translate}}" on-click="ctrl.copyAddress()"></oui-action-menu-item>
<oui-action-menu-item data-ng-if="!ctrl.isConnectionClosed()" text="{{ ::'logs_streams_follow_close_connection' | translate}}" on-click="ctrl.closeConnection()"></oui-action-menu-item>
<oui-action-menu-item text="{{ ::'logs_streams_follow_download_client' | translate}}" href="https://github.com/ovh/ldp-tail/releases" external></oui-action-menu-item>
<oui-action-menu-item data-ng-if="ctrl.isConnectionClosed()" text="{{ ::'logs_streams_follow_open_connection' | translate}}" on-click="ctrl.openConnection()"></oui-action-menu-item>
<oui-action-menu-item text="{{ ::'logs_streams_follow_test_gelf' | translate}}" on-click="ctrl.testFlow(ctrl.LogsStreamsFollowService.testTypeEnum.GELF)"></oui-action-menu-item>
<oui-action-menu-item text="{{ ::'logs_streams_follow_test_ltsv' | translate}}" on-click="ctrl.testFlow(ctrl.LogsStreamsFollowService.testTypeEnum.LTSV)"></oui-action-menu-item>
<oui-action-menu-item text="{{ ::'logs_streams_follow_test_rfc' | translate}}" on-click="ctrl.testFlow(ctrl.testFlow(ctrl.LogsStreamsFollowService.testTypeEnum.RFC5424))"></oui-action-menu-item>
<oui-action-menu-item data-on-click="ctrl.copyAddress()">
<span data-translate="logs_streams_follow_copy_address"></span>
</oui-action-menu-item>
<oui-action-menu-item
data-ng-if="!ctrl.isConnectionClosed()"
data-on-click="ctrl.closeConnection()">
<span data-translate="logs_streams_follow_close_connection"></span>
</oui-action-menu-item>
<oui-action-menu-item
data-href="https://github.com/ovh/ldp-tail/releases" external>
<span data-translate="logs_streams_follow_download_client"></span>
</oui-action-menu-item>
<oui-action-menu-item
data-ng-if="ctrl.isConnectionClosed()"
data-on-click="ctrl.openConnection()">
<span data-translate="logs_streams_follow_open_connection"></span>
</oui-action-menu-item>
<oui-action-menu-item
data-ng-if="ctrl.stream.data.info.isEditable"
data-on-click="ctrl.testFlow(ctrl.LogsStreamsFollowService.testTypeEnum.GELF)">
<span data-translate="logs_streams_follow_test_gelf"></span>
</oui-action-menu-item>
<oui-action-menu-item
data-ng-if="ctrl.stream.data.info.isEditable"
data-on-click="ctrl.testFlow(ctrl.LogsStreamsFollowService.testTypeEnum.LTSV)">
<span data-translate="logs_streams_follow_test_ltsv"></span>
</oui-action-menu-item>
<oui-action-menu-item
data-ng-if="ctrl.stream.data.info.isEditable"
data-on-click="ctrl.testFlow(ctrl.testFlow(ctrl.LogsStreamsFollowService.testTypeEnum.RFC5424))">
<span data-translate="logs_streams_follow_test_rfc"></span>
</oui-action-menu-item>
</oui-action-menu>

<oui-spinner data-ng-if="ctrl.LogsStreamsFollowService.waitingForMessages"></oui-spinner>
Expand Down
30 changes: 28 additions & 2 deletions client/app/dbaas/logs/detail/streams/logs-streams.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,20 @@ class LogsStreamsService {
* @memberof LogsStreamsService
*/
createStream(serviceName, stream) {
return this.StreamsApiService.create({ serviceName }, stream)
return this.StreamsApiService.create({ serviceName },
{
coldStorageCompression: stream.coldStorageCompression,
coldStorageContent: stream.coldStorageContent,
coldStorageEnabled: stream.coldStorageEnabled,
coldStorageNotifyEnabled: stream.coldStorageNotifyEnabled,
coldStorageRetention: stream.coldStorageRetention,
coldStorageTarget: stream.coldStorageTarget,
description: stream.description,
indexingEnabled: stream.indexingEnabled,
optionId: stream.optionId,
title: stream.title,
webSocketEnabled: stream.webSocketEnabled,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand All @@ -231,7 +244,20 @@ class LogsStreamsService {
* @memberof LogsStreamsService
*/
updateStream(serviceName, stream) {
return this.StreamsApiService.update({ serviceName, streamId: stream.streamId }, stream)
return this.StreamsApiService.update({ serviceName, streamId: stream.streamId },
{
coldStorageCompression: stream.coldStorageCompression,
coldStorageContent: stream.coldStorageContent,
coldStorageEnabled: stream.coldStorageEnabled,
coldStorageNotifyEnabled: stream.coldStorageNotifyEnabled,
coldStorageRetention: stream.coldStorageRetention,
coldStorageTarget: stream.coldStorageTarget,
description: stream.description,
indexingEnabled: stream.indexingEnabled,
optionId: stream.optionId,
title: stream.title,
webSocketEnabled: stream.webSocketEnabled,
})
.$promise
.then((operation) => {
this.resetAllCache();
Expand Down
Loading

0 comments on commit 6433e7c

Please sign in to comment.