Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default class HostingCdnController {
/* @ngInject */
constructor($stateParams, serviceName) {
this.$stateParams = $stateParams;
this.serviceName = serviceName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div data-ui-view="cdnView"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import routing from './hosting-cdn.routing';

import shared from './shared/hosting-cdn-shared-settings.module';
import order from './order/hosting-cdn-order.module';
import logs from './logs';

const moduleName = 'ovhManagerHostingCdn';

angular.module(moduleName, [order, shared]).config(routing);
angular
.module(moduleName, [order, shared, logs])
.config(routing)
.run(/* @ngTranslationsInject:json ./translations */);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import template from './hosting-cdn.html';
import controller from './hosting-cdn.controller';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.hosting.dashboard.cdn', {
url: '/cdn',
abstract: true,
redirectTo: 'app.hosting.dashboard.cdn.logs',
views: {
'@app.hosting.dashboard': {
template,
controller,
controllerAs: '$ctrl',
},
},
resolve: {
breadcrumb: () => 'CDN',
},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import template from './data-streams.template.html';

export const name = 'cdnDedicatedLogsDataStreams';

export default {
bindings: {
kind: '<',
url: '<',
goBack: '<',
trackClick: '<',
apiVersion: '<',
trackingHits: '<',
logKinds: '<',
logSubscriptionApiData: '=',
},
template,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default class HostingCdnLogsDataStreamsController {
/* @ngInject */
constructor(
trackClick,
trackingHits,
url,
apiVersion,
kind,
goBack,
logKinds,
logSubscriptionApiData,
) {
this.trackClick = trackClick;
this.trackingHits = trackingHits;
this.url = url;
this.apiVersion = apiVersion;
this.kind = kind;
this.goBack = goBack;
this.logKinds = logKinds;
this.logSubscriptionApiData = logSubscriptionApiData;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import template from './data-streams.template.html';
import controller from './data-streams.controller';
import {
CDN_HOSTING_DATA_STREAMS_TRACKING_HITS,
LOGS_TRACKING_CONTEXT,
} from '../logs.constants';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.hosting.dashboard.cdn.logs.data-streams', {
url: '/data-streams',
params: {
kind: null,
},
views: {
'cdnView@app.hosting.dashboard.cdn': {
template,
controller,
controllerAs: '$ctrl',
},
},
atInternet: {
rename: CDN_HOSTING_DATA_STREAMS_TRACKING_HITS.LISTING_PAGE,
...LOGS_TRACKING_CONTEXT,
},
resolve: {
breadcrumb: () => null,
url: /* @ngInject */ ($stateParams) =>
`/hosting/web/${$stateParams.productId}/cdn/log/subscription`,
trackingHits: () => CDN_HOSTING_DATA_STREAMS_TRACKING_HITS,
kind: /* @ngInject */ ($transition$) => $transition$.params().kind,
logSubscriptionApiData: /* @ngInject */ (url, kind) => ({
url,
params: { kind },
}),
goBack: /* @ngInject */ ($state, trackClick) => (kind) => {
trackClick(CDN_HOSTING_DATA_STREAMS_TRACKING_HITS.GO_BACK);
return $state.go(
'app.hosting.dashboard.cdn.logs',
{ kind },
{ reload: true },
);
},
},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div data-ovh-alert></div>
<log-to-customer-list
data-log-subscription-api-data="$ctrl.logSubscriptionApiData"
data-description="{{:: 'cdn_logs_data_streams_description' | translate }}"
data-go-back=":: $ctrl.goBack"
data-tracking-hits=":: $ctrl.trackingHits"
data-track-click=":: $ctrl.trackClick"
data-api-version=":: $ctrl.apiVersion"
data-log-kinds-list=":: $ctrl.logKinds"
>
</log-to-customer-list>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import angular from 'angular';
import uiRouter from '@uirouter/angularjs';
import '@ovh-ux/ng-translate-async-loader';
import 'angular-translate';
import '@ovh-ux/ui-kit';
import ovhManagerLogToCustomer from '@ovh-ux/manager-log-to-customer';

import routing from './data-streams.routing';
import controller from './data-streams.controller';

const moduleName = 'hostingCdnLogsDataStreams';

angular
.module(moduleName, [
uiRouter,
'ngTranslateAsyncLoader',
'oui',
'pascalprecht.translate',
ovhManagerLogToCustomer,
])
.controller('HostingCdnLogsDataStreamsController', controller)
.config(routing)
.run(/* @ngTranslationsInject:json ./translations */);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "Wenn Sie die Sicherheits-Logs in Ihrem Kunden-Account abonnieren, werden diese auf die Logs Data Platform übertragen. Diese Plattform bietet Zugriff auf erweiterte Funktionen wie Warnungen, das Durchführen von Suchen oder die Verwaltung der Aufbewahrung."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "Once you subscribe, your customer account’s security logs will be sent to the Logs Data Platform. This platform gives you access to advanced features such as alerting, searching, and retention management."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "Al suscribirse a los logs de seguridad de su cuenta de cliente, estos serán transferidos a la Logs Data Platform. Esta plataforma le permite acceder a funcionalidades avanzadas como la gestión de las alertas, la ejecución de las búsquedas o la gestión de las retenciones."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "En vous abonnant aux logs de sécurité de votre compte client, ceux-ci seront transférés vers la plateforme Logs Data Platform. Cette plateforme vous donne accès à des fonctionnalités avancées telles que l'alerte, l'exécution de recherches et la gestion de la rétention."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "En vous abonnant aux logs de sécurité de votre compte client, ceux-ci seront transférés vers la plateforme Logs Data Platform. Cette plateforme vous donne accès à des fonctionnalités avancées telles que l'alerte, l'exécution de recherches et la gestion de la rétention."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "Abbonandoti ai log di sicurezza del tuo account cliente, questi verranno trasferiti verso la soluzione Logs Data Platform. Questa piattaforma offre accesso a funzionalità avanzate come alert, esecuzione di ricerche e gestione delle retention."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "Po zasubskrybowaniu logów bezpieczeństwa konta klienta, logi zostaną przeniesione na platformę Logs Data Platform. Platforma zapewnia dostęp do zaawansowanych funkcji, takich jak alerty, wyszukiwanie lub zarządzanie czasem przechowywania."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_data_streams_description": "Ao subscrever os logs de segurança da sua conta de cliente, estes serão transferidos para a plataforma Logs Data Platform. Esta plataforma dá-lhe acesso a funcionalidades avançadas tais como o alerta, a execução de pesquisas e a gestão da retenção."
}
29 changes: 29 additions & 0 deletions packages/manager/apps/web/client/app/hosting/cdn/logs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import angular from 'angular';
import uiRouter from '@uirouter/angularjs';
import '@ovh-ux/ng-translate-async-loader';
import 'angular-translate';
import '@ovh-ux/ui-kit';
import ovhManagerLogToCustomer from '@ovh-ux/manager-log-to-customer';

import routing from './logs.routing';
import service from './logs.service';
import controller from './logs.controller';
import dataStreams from './data-streams';

const moduleName = 'hostingCdnLogs';

angular
.module(moduleName, [
uiRouter,
'ngTranslateAsyncLoader',
'oui',
'pascalprecht.translate',
ovhManagerLogToCustomer,
dataStreams,
])
.controller('HostingCdnLogsController', controller)
.service('hostingCdnLogsService', service)
.config(routing)
.run(/* @ngTranslationsInject:json ./translations */);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const CDN_HOSTING_LOG_KEYS = ['message'];

export const LOGS_TRACKING_CONTEXT = {
page_theme: 'Network',
level2: 99,
};

const logsPrefix = 'network::cdn-dedicated::::logs';
export const CDN_HOSTING_LOGS_TRACKING_HITS = {
LOGS_PAGE: logsPrefix,
TRANSFER: `${logsPrefix}::subscribe`,
STOP_TRANSFER: `${logsPrefix}::unsubscribe`,
CREATE_ACCOUNT: `${logsPrefix}::create-account`,
CREATE_DATA_STREAM: `${logsPrefix}::create-data-stream`,
SUBSCRIBE_OTHER_ACCOUNT: `${logsPrefix}::subscribe-other-datastream`,
GRAYLOG_WATCH: `${logsPrefix}::graylog`,
};

const dataStreamsPrefix = `${logsPrefix}::data-streams`;
export const CDN_HOSTING_DATA_STREAMS_TRACKING_HITS = {
LISTING_PAGE: dataStreamsPrefix,
ADD_DATA_STREAM: `${dataStreamsPrefix}::add-datastream`,
GO_BACK: `${dataStreamsPrefix}::back-previous-page`,
LDP_DETAIL: `${dataStreamsPrefix}::ldp-detail`,
SUBSCRIBE: `${dataStreamsPrefix}::subscribe`,
UNSUBSCRIBE: `${dataStreamsPrefix}::unsubscribe`,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export default class HostingCdnLogsController {
/* @ngInject */
constructor(
$translate,
trackClick,
trackingHits,
url,
apiVersion,
kind,
description,
goToListingPage,
logKinds,
logKindsKeys,
logServiceGuideLink,
) {
this.$translate = $translate;
this.trackClick = trackClick;
this.trackingHits = trackingHits;
this.url = url;
this.apiVersion = apiVersion;
this.kind = kind;
this.description = description;
this.goToListingPage = goToListingPage;
this.logKinds = logKinds;
this.logKindsKeys = logKindsKeys;
this.logServiceGuideLink = logServiceGuideLink;
}
}
18 changes: 18 additions & 0 deletions packages/manager/apps/web/client/app/hosting/cdn/logs/logs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div data-ovh-alert></div>

<log-to-customer-live-tail
data-log-api-url=":: $ctrl.url.LOG"
data-log-subscription-url=":: $ctrl.url.LOG_SUBSCRIPTION"
data-log-service-guide-link=":: $ctrl.logServiceGuideLink"
data-api-version=":: $ctrl.apiVersion"
data-go-to-listing-page=":: $ctrl.goToListingPage"
data-log-kinds-list=":: $ctrl.logKinds"
data-log-kinds-keys=":: $ctrl.logKindsKeys"
data-kind-init-value=":: $ctrl.kind"
data-track-click=":: $ctrl.trackClick"
data-tracking-hits=":: $ctrl.trackingHits"
>
<main-description>
<span data-ng-bind=":: $ctrl.description"></span>
</main-description>
</log-to-customer-live-tail>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import template from './logs.html';
import controller from './logs.controller';
import {
CDN_HOSTING_LOG_KEYS,
CDN_HOSTING_LOGS_TRACKING_HITS,
LOGS_TRACKING_CONTEXT,
} from './logs.constants';

const redirectTo = (transition) =>
transition
.injector()
.getAsync('logKinds')
.then((logKinds) =>
!logKinds || logKinds.length === 0 ? 'app.hosting.dashboard.cdn' : false,
);

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.hosting.dashboard.cdn.logs', {
url: '/logs',
views: {
'cdnView@app.hosting.dashboard.cdn': {
template,
controller,
controllerAs: '$ctrl',
},
},
atInternet: {
rename: CDN_HOSTING_LOGS_TRACKING_HITS.LOGS_PAGE,
...LOGS_TRACKING_CONTEXT,
},
params: {
kind: null,
},
redirectTo,
resolve: {
breadcrumb: /* @ngInject */ ($translate) =>
$translate.instant('cdn_logs'),
trackClick: /* @ngInject */ (atInternet) => (hit) => {
atInternet.trackClick({
name: hit,
type: 'action',
...LOGS_TRACKING_CONTEXT,
});
},
trackingHits: () => CDN_HOSTING_LOGS_TRACKING_HITS,
url: /* @ngInject */ ($stateParams) => {
const baseLogsUrl = `/hosting/web/${$stateParams.productId}/cdn/log`;
return {
LOG: `${baseLogsUrl}/url`,
LOG_SUBSCRIPTION: `${baseLogsUrl}/subscription`,
};
},
apiVersion: /* @ngInject */ (API_VERSION) => API_VERSION.v1,
kind: /* @ngInject */ (logKinds, $transition$) =>
$transition$.params().kind || logKinds[0],
description: /* @ngInject */ ($translate) =>
$translate.instant('cdn_logs_description'),
goToListingPage: /* @ngInject */ ($state, $transition$) => (params) =>
$state.go('app.hosting.dashboard.cdn.logs.data-streams', {
...$transition$.params(),
...params,
}),
logKinds: /* @ngInject */ (hostingCdnLogsService) =>
hostingCdnLogsService.getLogKinds().catch(() => []),
logKindsKeys: /* @ngInject */ (logKinds) =>
Object.fromEntries(
logKinds.map((kind) => [kind, CDN_HOSTING_LOG_KEYS]),
),
logServiceGuideLink: /* @ngInject */ (coreConfig, DATA_PLATFORM_GUIDE) =>
DATA_PLATFORM_GUIDE[coreConfig.getUser().ovhSubsidiary] ??
DATA_PLATFORM_GUIDE.WE,
},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default class HostingCdnLogsService {
/* @ngInject */
constructor($http) {
this.$http = $http;
}

getLogKinds() {
return this.$http.get('/hosting/web/cdn/log/kind').then(({ data }) => data);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdn_logs_description": "Vous trouverez ci-dessous les logs en temps réel générés par votre service CDN."
}
Loading
Loading