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

pull/12480/merge
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,5 +1,6 @@
<page-header title="'Service details'" breadcrumbs="[{label:'Services', link:'docker.services'}, service.Name]" reload="true"> </page-header>
<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">
@ -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()">
@ -272,3 +278,4 @@
</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;
});
}