1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(app/service-details): hide view while loading data (#348)

This commit is contained in:
LP B 2025-02-03 14:20:35 +01:00 committed by GitHub
parent 9ea41f68bc
commit 9a3f6b21d2
2 changed files with 270 additions and 259 deletions

View file

@ -1,14 +1,15 @@
<page-header title="'Service details'" breadcrumbs="[{label:'Services', link:'docker.services'}, service.Name]" reload="true"> </page-header>
<div class="row">
<div ng-if="!isLoading">
<div class="row">
<div ng-if="isUpdating" class="col-lg-12 col-md-12 col-xs-12">
<div class="alert alert-info" role="alert" id="service-update-alert">
<p>This service is being updated. Editing this service is currently disabled.</p>
<a ui-sref="docker.services.service({id: service.Id}, {reload: true})">Refresh to see if this service has finished updated.</a>
</div>
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-lg-9 col-md-9 col-xs-9">
<rd-widget>
<rd-widget-header icon="shuffle" title-text="Service details"></rd-widget-header>
@ -80,7 +81,12 @@
</td>
<td>
<div class="flex flex-wrap items-center">
<por-switch-field label-class="'!mr-0'" checked="WebhookExists" disabled="disabledWebhookButton(WebhookExists)" on-change="(onWebhookChange)"></por-switch-field>
<por-switch-field
label-class="'!mr-0'"
checked="WebhookExists"
disabled="disabledWebhookButton(WebhookExists)"
on-change="(onWebhookChange)"
></por-switch-field>
<span ng-if="webhookURL">
<span class="text-muted">{{ webhookURL | truncatelr }}</span>
<button type="button" class="btn btn-sm btn-primary btn-sm space-left" ng-if="webhookURL" ng-click="copyWebhook()">
@ -204,21 +210,21 @@
</rd-widget-body>
</rd-widget>
</div>
</div>
</div>
<!-- access-control-panel -->
<access-control-panel
<!-- access-control-panel -->
<access-control-panel
ng-if="service"
resource-id="service.Id"
resource-control="service.ResourceControl"
resource-type="resourceType"
on-update-success="(onUpdateResourceControlSuccess)"
environment-id="endpoint.Id"
>
</access-control-panel>
<!-- !access-control-panel -->
>
</access-control-panel>
<!-- !access-control-panel -->
<div class="row">
<div class="row">
<hr />
<div class="col-lg-12 col-md-12 col-xs-12">
<h3 id="container-specs">Container specification</h3>
@ -228,9 +234,9 @@
<div id="service-container-labels" class="padding-top" ng-include="'app/docker/views/services/edit/includes/containerlabels.html'"></div>
<div id="service-mounts" class="padding-top" ng-include="'app/docker/views/services/edit/includes/mounts.html'"></div>
</div>
</div>
</div>
<div class="row">
<div class="row">
<hr />
<div class="col-lg-12 col-md-12 col-xs-12">
<h3 id="service-network-specs">Networks &amp; ports</h3>
@ -248,9 +254,9 @@
<div id="service-hosts-entries" class="padding-top" ng-include="'app/docker/views/services/edit/includes/hosts.html'"></div>
</div>
</div>
</div>
<div class="row">
<div class="row">
<hr />
<div class="col-lg-12 col-md-12 col-xs-12">
<h3 id="service-specs">Service specification</h3>
@ -269,6 +275,7 @@
<div id="service-configs" class="padding-top" ng-include="'app/docker/views/services/edit/includes/configs.html'"></div>
<div id="service-secrets" ng-if="applicationState.endpoint.apiVersion >= 1.25" class="padding-top" ng-include="'app/docker/views/services/edit/includes/secrets.html'"></div>
</div>
</div>
</div>
<div id="service-tasks" class="padding-top" ng-include="'app/docker/views/services/edit/includes/tasks.html'"></div>
<div id="service-tasks" class="padding-top" ng-include="'app/docker/views/services/edit/includes/tasks.html'"></div>
</div>

View file

@ -731,6 +731,7 @@ angular.module('portainer.docker').controller('ServiceController', [
};
function initView() {
$scope.isLoading = true;
var apiVersion = $scope.applicationState.endpoint.apiVersion;
var agentProxy = $scope.applicationState.endpoint.mode.agentProxy;
@ -855,6 +856,9 @@ angular.module('portainer.docker').controller('ServiceController', [
$scope.secrets = [];
$scope.configs = [];
Notifications.error('Failure', err, 'Unable to retrieve service details');
})
.finally(() => {
$scope.isLoading = false;
});
}