Skip to content
Open
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
Expand Up @@ -9,7 +9,6 @@ import '@ovh-ux/ui-kit';

import password from './password/password.module';
import service from './logs-account.service';
import setup from './setup/setup.module';

const moduleName = 'ovhManagerDbaasLogsDetailAccount';

Expand All @@ -22,7 +21,6 @@ angular
'pascalprecht.translate',
'ui.router',
password,
setup,
])
.service('LogsAccountService', service);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
const redirectTo = (transition) => {
const LogsConstants = transition.injector().get('LogsConstants');
return transition
.injector()
.getAsync('service')
.then(
({ state: serviceState, serviceName }) =>
serviceState === LogsConstants.SERVICE_STATE_TO_CONFIG && {
state: 'dbaas-logs.list.account-setup',
params: { serviceName },
},
);
};

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('dbaas-logs.detail.home', {
url: '/home',
redirectTo,
views: {
logsContent: 'dbaasLogsDetailHome',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,19 @@ export default class LogsHomeCtrl {

$onInit() {
this.lastUpdatedDate = moment(this.service.updatedAt).format('LL');
if (this.service.state === this.LogsConstants.SERVICE_STATE_TO_CONFIG) {
this.goToAccountSetupPage();
} else {
this.streamUsageGraphData = new this.ChartFactory(
this.newChart('stream-axis'),
);
this.archiveUsageGraphData = new this.ChartFactory(
this.newChart('archive-axis'),
);
this.indiceUsageGraphData = new this.ChartFactory(
this.newChart('indice-axis'),
);
this.prepareDataUsageGraphData();
this.canAccessToElasticsearch =
this.indexIds.length + this.aliasIds.length > 0;
}

this.streamUsageGraphData = new this.ChartFactory(
this.newChart('stream-axis'),
);
this.archiveUsageGraphData = new this.ChartFactory(
this.newChart('archive-axis'),
);
this.indiceUsageGraphData = new this.ChartFactory(
this.newChart('indice-axis'),
);
this.prepareDataUsageGraphData();
this.canAccessToElasticsearch =
this.indexIds.length + this.aliasIds.length > 0;
}

getPlanName() {
Expand Down Expand Up @@ -102,10 +99,6 @@ export default class LogsHomeCtrl {
};
}

goToAccountSetupPage() {
return this.gotoState('dbaas-logs.detail.setup');
}

/**
* opens UI modal to change password
*
Expand Down Expand Up @@ -193,15 +186,15 @@ export default class LogsHomeCtrl {
}

changeName() {
return this.gotoState('dbaas-logs.detail.home.account');
return this.goToState('dbaas-logs.detail.home.account');
}

goToAllStreams() {
return this.gotoState('dbaas-logs.detail.streams');
return this.goToState('dbaas-logs.detail.streams');
}

goToAllDashboards() {
return this.gotoState('dbaas-logs.detail.dashboards');
return this.goToState('dbaas-logs.detail.dashboards');
}

/**
Expand All @@ -210,7 +203,7 @@ export default class LogsHomeCtrl {
* @memberof LogsHomeCtrl
*/
editTokens() {
return this.gotoState('dbaas-logs.detail.tokens');
return this.goToState('dbaas-logs.detail.tokens');
}

/**
Expand All @@ -219,7 +212,7 @@ export default class LogsHomeCtrl {
* @memberof LogsHomeCtrl
*/
editEncryptionKeys() {
return this.gotoState('dbaas-logs.detail.encryption-keys.home');
return this.goToState('dbaas-logs.detail.encryption-keys.home');
}

/**
Expand All @@ -231,7 +224,7 @@ export default class LogsHomeCtrl {
this.openChangePasswordModal();
}

gotoState(state) {
goToState(state) {
return this.$state.go(state, {
serviceName: this.serviceName,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export default class LogsHomeService {
);
}

enableIam(serviceName, service) {
enableIam({ serviceName, displayName }) {
return this.$http
.put(`/dbaas/logs/${serviceName}`, {
displayName: service.displayName,
displayName,
enableIam: true,
})
.then((operation) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import controller from './account-setup.controller';
import template from './account-setup.html';

export default {
controller,
bindings: {
serviceName: '<',
service: '<',
goBack: '<',
goToDetail: '<',
},
template,
};
Loading
Loading