Skip to content

Commit

Permalink
feat(web): add private-database logs to customer module (#13574)
Browse files Browse the repository at this point in the history
ref: MANAGER-15356

Signed-off-by: Romain Jamet <[email protected]>
Co-authored-by: CDS Translator Agent <[email protected]>
  • Loading branch information
rjamet-ovh and ovh-cds authored Nov 14, 2024
1 parent 261eef1 commit 6095a9d
Show file tree
Hide file tree
Showing 39 changed files with 381 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class PrivateDatabaseCtrl {
databaseLink,
hasConfiguration,
logsLink,
isLogsToCustomerFeatureAvailable,
metricsLink,
Hosting,
PrivateDatabase,
Expand All @@ -47,6 +48,7 @@ export default class PrivateDatabaseCtrl {
this.hasConfiguration = hasConfiguration;
this.hostingService = Hosting;
this.logsLink = logsLink;
this.isLogsToCustomerFeatureAvailable = isLogsToCustomerFeatureAvailable;
this.metricsLink = metricsLink;
this.privateDatabaseExtensionService = PrivateDatabaseExtension;
this.privateDatabaseService = PrivateDatabase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,15 @@
<span data-translate="privateDatabase_tab_METRICS"></span>
</oui-header-tabs-item>
<oui-header-tabs-item
data-ng-if="database.serviceInfos.status !== 'expired'"
data-ng-if=":: ctrl.isLogsToCustomerFeatureAvailable && database.serviceInfos.status !== 'expired'"
href="{{ ctrl.logsLink }}"
active="ctrl.currentActiveLink() === ctrl.logsLink"
>
<span data-translate="privateDatabase_tab_LOGS"></span>
<span
class="oui-badge oui-badge_s oui-badge_success"
data-translate="privateDatabase_beta_status"
></span>
</oui-header-tabs-item>
<oui-header-tabs-item
data-ng-if="database.serviceInfos.status !== 'expired' && !isLegacyDatabase() && !hasConfiguration"
Expand All @@ -254,6 +258,7 @@
</oui-header-tabs>
</div>
<div ui-view></div>
<div data-ui-view="privateDatabaseLogsView"></div>
</div>

<div id="currentAction" class="modal fade currentAction" role="dialog">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import routing from './private-database.routing';

import configuration from '../configuration/configuration.module';
import database from '../database/database.module';
import logs from '../logs/logs.module';
import logs from '../logs/private-database-logs.module';
import metrics from '../metrics/metrics.module';
import orderCloudDb from '../order/clouddb';
import state from '../state/state.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export default /* @ngInject */ ($stateProvider) => {
currentActiveLink: /* @ngInject */ ($state, $transition$) => () =>
$state.href($state.current.name, $transition$.params()),
breadcrumb: /* @ngInject */ (serviceName) => serviceName,
isLogsToCustomerFeatureAvailable: /* @ngInject */ (ovhFeatureFlipping) =>
ovhFeatureFlipping
.checkFeatureAvailability('private-database:logs-to-customer')
.then((feature) =>
feature.isFeatureAvailable('private-database:logs-to-customer'),
),
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Beim Einrichten der Erweiterung ist ein Fehler aufgetreten.",
"privateDatabase_tabs_list_extensions_disable_success": "Die Erweiterung wurde erfolgreich deaktiviert.",
"privateDatabase_tabs_list_extensions_disable_error": "Bei der Deaktivierung der Erweiterung ist ein Fehler aufgetreten.",
"privateDatabase_order_sql_period_sub_title": "Wie lange möchten Sie sie benutzen? "
"privateDatabase_order_sql_period_sub_title": "Wie lange möchten Sie sie benutzen? ",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "An error has occurred enabling your extension.",
"privateDatabase_tabs_list_extensions_disable_success": "Extension correctly disabled.",
"privateDatabase_tabs_list_extensions_disable_error": "An error has occurred disabling the extension.",
"privateDatabase_order_sql_period_sub_title": "How long do you want to use it for?"
"privateDatabase_order_sql_period_sub_title": "How long do you want to use it for?",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -502,5 +502,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Se ha producido un error al activar la extensión.",
"privateDatabase_tabs_list_extensions_disable_success": "La extensión se ha desactivado correctamente.",
"privateDatabase_tabs_list_extensions_disable_error": "Se ha producido un error al desactivar la extensión.",
"privateDatabase_order_sql_period_sub_title": "¿Por cuánto tiempo quiere utilizarlas?"
"privateDatabase_order_sql_period_sub_title": "¿Por cuánto tiempo quiere utilizarlas?",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Une erreur est survenue lors de l'action de l'extension.",
"privateDatabase_tabs_list_extensions_disable_success": "Extension correctement désactivée.",
"privateDatabase_tabs_list_extensions_disable_error": "Une erreur est survenue lors de la désactivation de l'extension.",
"privateDatabase_order_sql_period_sub_title": "Combien de temps désirez-vous l'utiliser ?"
"privateDatabase_order_sql_period_sub_title": "Combien de temps désirez-vous l'utiliser ?",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Une erreur est survenue lors de l'action de l'extension.",
"privateDatabase_tabs_list_extensions_disable_success": "Extension correctement désactivée.",
"privateDatabase_tabs_list_extensions_disable_error": "Une erreur est survenue lors de la désactivation de l'extension.",
"privateDatabase_order_sql_period_sub_title": "Combien de temps désirez-vous l'utiliser ?"
"privateDatabase_order_sql_period_sub_title": "Combien de temps désirez-vous l'utiliser ?",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Si è verificato un errore durante l'attivazione dell'estensione.",
"privateDatabase_tabs_list_extensions_disable_success": "Estensione disattivata correttamente.",
"privateDatabase_tabs_list_extensions_disable_error": "Si è verificato un errore durante la disattivazione dell'estensione.",
"privateDatabase_order_sql_period_sub_title": "Per quanto tempo vuoi utilizzarla?"
"privateDatabase_order_sql_period_sub_title": "Per quanto tempo vuoi utilizzarla?",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Wystąpił błąd podczas aktywowania rozszerzenia.",
"privateDatabase_tabs_list_extensions_disable_success": "Rozszerzenie poprawnie dezaktywowane.",
"privateDatabase_tabs_list_extensions_disable_error": "Wystąpił błąd podczas aktywowania rozszerzenia.",
"privateDatabase_order_sql_period_sub_title": "Jak długo chcesz korzystać z bazy?"
"privateDatabase_order_sql_period_sub_title": "Jak długo chcesz korzystać z bazy?",
"privateDatabase_beta_status": "Wersja beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"privateDatabase_tabs_list_extensions_enable_error": "Erro ao processar ativação da extensão",
"privateDatabase_tabs_list_extensions_disable_success": "Extensão desativada",
"privateDatabase_tabs_list_extensions_disable_error": "Erro ao processar desativação da extensão",
"privateDatabase_order_sql_period_sub_title": "Durante quanto tempo deseja utilizá-las?"
"privateDatabase_order_sql_period_sub_title": "Durante quanto tempo deseja utilizá-las?",
"privateDatabase_beta_status": "Beta"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import angular from 'angular';
import '@uirouter/angularjs';
import 'oclazyload';

const moduleName = 'ovhManagerPrivateDatabaseLogsDataStreamsLazyLoading';

angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config(
/* @ngInject */ ($stateProvider) => {
$stateProvider.state(
'app.private-database.dashboard.logs.data-streams.**',
{
url: '',
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

return import('./private-database-data-streams.module').then(
(mod) => {
return $ocLazyLoad.inject(mod.default || mod);
},
);
},
},
);
},
);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import controller from './private-database-data-streams.controller';
import template from './private-database-data-streams.template.html';

export default {
bindings: {
projectId: '<',
kind: '<',
goBack: '<',
trackClick: '<',
},
controller,
template,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS = {
LISTING_PAGE: 'web::private-database::dashboard::logs::data-streams',
ADD_DATA_STREAM:
'web::private-database::dashboard::logs::data-streams::add-datastream',
GO_BACK:
'web::private-database::dashboard::logs::data-streams::back-previous-page',
LDP_DETAIL:
'web::private-database::dashboard::logs::data-streams::ldp-detail',
SUBSCRIBE: 'web::private-database::dashboard::logs::data-streams::subscribe',
UNSUBSCRIBE:
'web::private-database::dashboard::logs::data-streams::unsubscribe',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS } from './private-database-data-streams.constants';

export default class PrivateDatabasedataStreamsCtrl {
/* @ngInject */
constructor($stateParams) {
this.$stateParams = $stateParams;
}

$onInit() {
this.productId = this.$stateParams.productId;
this.PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS = PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS;
this.logSubscriptionApiData = {
url: `/hosting/privateDatabase/${this.productId}/log/subscription`,
params: {
kind: this.kind,
},
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import angular from 'angular';
import '@uirouter/angularjs';
import 'angular-translate';

import component from './private-database-data-streams.component';
import routing from './private-database-data-streams.routing';

const moduleName = 'ovhManagerPrivateDatabaseDataStreams';
angular
.module(moduleName, ['pascalprecht.translate', 'ui.router'])
.config(routing)
.component('privateDatabaseDataStreams', component)
.run(/* @ngTranslationsInject:json ../translations */);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS } from './private-database-data-streams.constants';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.private-database.dashboard.logs.data-streams', {
url: '',
params: {
kind: null,
},
views: {
'[email protected]':
'privateDatabaseDataStreams',
},
atInternet: {
rename: PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS.LISTING_PAGE,
},
resolve: {
breadcrumb: () => null,
kind: /* @ngInject */ ($transition$) => $transition$.params().kind,
goBack: /* @ngInject */ ($state, kind, trackClick) => () => {
trackClick(PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS.GO_BACK);
$state.go(
'app.private-database.dashboard.logs',
{ kind },
{ reload: true },
);
},
},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div data-ovh-alert></div>

<log-to-customer-list
data-log-subscription-api-data="$ctrl.logSubscriptionApiData"
data-description="{{ 'private_database_data_streams_description_' + $ctrl.kind | translate }}"
data-go-back="$ctrl.goBack"
data-tracking-hits="$ctrl.PRIVATE_DATABASE_DATA_STREAMS_TRACKING_HITS"
data-track-click="$ctrl.trackClick"
>
</log-to-customer-list>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import angular from 'angular';
import '@uirouter/angularjs';
import 'oclazyload';

const moduleName = 'ovhManagerPrivateDatabaseLogsLazyLoading';

angular.module(moduleName, ['ui.router', 'oc.lazyLoad']).config(
/* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.private-database.dashboard.logs.**', {
url: '/logs',
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

return import('./private-database-logs.module').then((mod) =>
$ocLazyLoad.inject(mod.default || mod),
);
},
});
},
);

export default moduleName;

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import template from './private-database-logs.template.html';
import controller from './private-database-logs.controller';

export default {
bindings: {
projectId: '<',
goToListingPage: '<',
logKindsList: '<',
kind: '<',
trackClick: '<',
},
template,
controller,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export const PRIVATE_DATABASE_LOGS_SERVICE_GUIDE_LINK = {
DEFAULT:
'https://help.ovhcloud.com/csm/en-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062040',
FR:
'https://help.ovhcloud.com/csm/fr-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062007',
DE:
'https://help.ovhcloud.com/csm/de-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062033',
ES:
'https://help.ovhcloud.com/csm/es-es-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062037',
WE:
'https://help.ovhcloud.com/csm/en-ie-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062032',
IE:
'https://help.ovhcloud.com/csm/en-ie-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062032',
IT:
'https://help.ovhcloud.com/csm/it-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062041',
PL:
'https://help.ovhcloud.com/csm/pl-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062043',
PT:
'https://help.ovhcloud.com/csm/pt-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062035',
GB:
'https://help.ovhcloud.com/csm/en-gb-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062031',
CA:
'https://help.ovhcloud.com/csm/en-ca-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062034',
QC:
'https://help.ovhcloud.com/csm/fr-ca-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062008',
WS:
'https://help.ovhcloud.com/csm/es-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062042',
AU:
'https://help.ovhcloud.com/csm/en-au-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062036',
SG:
'https://help.ovhcloud.com/csm/en-sg-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062039',
ASIA:
'https://help.ovhcloud.com/csm/asia-web-cloud-db-retrieve-logs?id=kb_article_view&sysparm_article=KB0062038',
};

export const PRIVATE_DATABASE_LOGS_KINDS_KEYS = {
dbms: ['message'],
};

export const PRIVATE_DATABASE_LOGS_TRACKING_HITS = {
LOGS_PAGE: 'web::private-database::dashboard::logs',
TRANSFER: 'web::private-database::dashboard::logs::subscribe',
STOP_TRANSFER: 'web::private-database::dashboard::logs::unsubscribe',
SUBSCRIBE_OTHER_ACCOUNT:
'web::private-database::dashboard::logs::subscribe-other-datastream',
CREATE_ACCOUNT: 'web::private-database::dashboard::logs::create-account',
CREATE_DATA_STREAM:
'web::private-database::dashboard::logs::create-data-stream',
GRAYLOG_WATCH: 'web::private-database::dashboard::logs::graylog',
};
Loading

0 comments on commit 6095a9d

Please sign in to comment.