mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
* feat(aci): show basic details * feat(aci): style container details page * fix(aci): fix container ip * feat(aci): provide functions to get single aci resource * feat(aci): show readable data * feat(aci): style container instance
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
class ContainerInstanceDetailsController {
|
|
/* @ngInject */
|
|
constructor($state, AzureService, ContainerGroupService, Notifications, ResourceGroupService, SubscriptionService) {
|
|
Object.assign(this, { $state, AzureService, ContainerGroupService, Notifications, ResourceGroupService, SubscriptionService });
|
|
|
|
this.state = {
|
|
loading: false,
|
|
};
|
|
|
|
this.container = null;
|
|
this.subscription = null;
|
|
this.resourceGroup = null;
|
|
}
|
|
|
|
async $onInit() {
|
|
this.state.loading = true;
|
|
const { id } = this.$state.params;
|
|
const { subscriptionId, resourceGroupId, containerGroupId } = parseId(id);
|
|
try {
|
|
this.subscription = await this.SubscriptionService.subscription(subscriptionId);
|
|
this.container = await this.ContainerGroupService.containerGroup(subscriptionId, resourceGroupId, containerGroupId);
|
|
this.resourceGroup = await this.ResourceGroupService.resourceGroup(subscriptionId, resourceGroupId);
|
|
} catch (err) {
|
|
this.Notifications.error('Failure', err, 'Unable to retrive container instance details');
|
|
}
|
|
this.state.loading = false;
|
|
}
|
|
}
|
|
|
|
function parseId(id) {
|
|
const [, subscriptionId, resourceGroupId, , containerGroupId] = id.match(/^\/subscriptions\/(.+)\/resourceGroups\/(.+)\/providers\/(.+)\/containerGroups\/(.+)$/);
|
|
|
|
return { subscriptionId, resourceGroupId, containerGroupId };
|
|
}
|
|
|
|
export default ContainerInstanceDetailsController;
|