mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
refactor(portainer): remove offline mode [EE-4348] (#7761)
Co-authored-by: deviantony <anthony.lapenna@portainer.io>
This commit is contained in:
parent
61e8e68c31
commit
75f40fe485
39 changed files with 28 additions and 311 deletions
|
@ -5,7 +5,6 @@
|
|||
<dashboard-cluster-agent-info endpoint-id="endpoint.Id"></dashboard-cluster-agent-info>
|
||||
</div>
|
||||
</div>
|
||||
<information-panel-offline ng-if="offlineMode"></information-panel-offline>
|
||||
<information-panel
|
||||
ng-if="
|
||||
!applicationState.UI.dismissedInfoPanels['docker-dashboard-info-01'] &&
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models';
|
||||
import { useContainerStatusComponent } from '@/react/docker/DashboardView/ContainerStatus';
|
||||
import { useImagesTotalSizeComponent } from '@/react/docker/DashboardView/ImagesTotalSize';
|
||||
|
@ -41,7 +40,6 @@ angular.module('portainer.docker').controller('DashboardController', [
|
|||
StateManager.dismissInformationPanel(id);
|
||||
};
|
||||
|
||||
$scope.offlineMode = false;
|
||||
$scope.showStacks = false;
|
||||
|
||||
$scope.buildGpusStr = function (gpuUseSet) {
|
||||
|
@ -122,7 +120,6 @@ angular.module('portainer.docker').controller('DashboardController', [
|
|||
', '
|
||||
)
|
||||
: '-';
|
||||
$scope.offlineMode = isOfflineEndpoint(endpoint);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to load dashboard data');
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
|
||||
angular.module('portainer.docker').controller('HostViewController', [
|
||||
'$q',
|
||||
'SystemService',
|
||||
|
@ -16,7 +14,6 @@ angular.module('portainer.docker').controller('HostViewController', [
|
|||
ctrl.state = {
|
||||
isAgent: false,
|
||||
isAdmin: false,
|
||||
offlineMode: false,
|
||||
};
|
||||
|
||||
this.engineDetails = {};
|
||||
|
@ -40,7 +37,6 @@ angular.module('portainer.docker').controller('HostViewController', [
|
|||
.then(function success(data) {
|
||||
ctrl.engineDetails = buildEngineDetails(data);
|
||||
ctrl.hostDetails = buildHostDetails(data.info);
|
||||
ctrl.state.offlineMode = isOfflineEndpoint(ctrl.endpoint);
|
||||
ctrl.jobs = data.jobs;
|
||||
|
||||
if (ctrl.state.isAgent && agentApiVersion > 1 && ctrl.state.enableHostManagementFeatures) {
|
||||
|
|
|
@ -7,6 +7,5 @@
|
|||
devices="$ctrl.devices"
|
||||
refresh-url="docker.host"
|
||||
browse-url="docker.host.browser"
|
||||
offline-mode="$ctrl.state.offlineMode"
|
||||
host-features-enabled="$ctrl.state.enableHostManagementFeatures"
|
||||
></host-overview>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<page-header title="'Image list'" breadcrumbs="['Images']" reload="true"> </page-header>
|
||||
|
||||
<div class="row" ng-if="!offlineMode" authorization="DockerImageCreate">
|
||||
<div class="row" authorization="DockerImageCreate">
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="download" feather-icon="true" title-text="Pull image "> </rd-widget-header>
|
||||
|
@ -44,7 +44,6 @@
|
|||
</rd-widget>
|
||||
</div>
|
||||
</div>
|
||||
<information-panel-offline ng-if="offlineMode"></information-panel-offline>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<images-datatable
|
||||
|
@ -58,7 +57,6 @@
|
|||
remove-action="removeAction"
|
||||
force-remove-action="confirmRemovalAction"
|
||||
export-in-progress="state.exportInProgress"
|
||||
offline-mode="offlineMode"
|
||||
refresh-callback="getImages"
|
||||
></images-datatable>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import _ from 'lodash-es';
|
||||
import { PorImageRegistryModel } from 'Docker/models/porImageRegistry';
|
||||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
|
||||
angular.module('portainer.docker').controller('ImagesController', [
|
||||
'$scope',
|
||||
|
@ -135,14 +134,11 @@ angular.module('portainer.docker').controller('ImagesController', [
|
|||
});
|
||||
};
|
||||
|
||||
$scope.offlineMode = false;
|
||||
|
||||
$scope.getImages = getImages;
|
||||
function getImages() {
|
||||
ImageService.images(true)
|
||||
.then(function success(data) {
|
||||
$scope.images = data;
|
||||
$scope.offlineMode = isOfflineEndpoint(endpoint);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve images');
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<page-header title="'Network list'" breadcrumbs="['Networks']" reload="true"> </page-header>
|
||||
|
||||
<information-panel-offline ng-if="offlineMode"></information-panel-offline>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<networks-datatable
|
||||
|
@ -11,7 +10,6 @@
|
|||
order-by="Name"
|
||||
remove-action="removeAction"
|
||||
show-host-column="applicationState.endpoint.mode.agentProxy && applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE'"
|
||||
offline-mode="offlineMode"
|
||||
refresh-callback="getNetworks"
|
||||
></networks-datatable>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import _ from 'lodash-es';
|
||||
import DockerNetworkHelper from 'Docker/helpers/networkHelper';
|
||||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
import { confirmDeletionAsync } from 'Portainer/services/modal.service/confirm';
|
||||
import DockerNetworkHelper from '@/docker/helpers/networkHelper';
|
||||
import { confirmDeletionAsync } from '@/portainer/services/modal.service/confirm';
|
||||
|
||||
angular.module('portainer.docker').controller('NetworksController', [
|
||||
'$q',
|
||||
|
@ -39,8 +38,6 @@ angular.module('portainer.docker').controller('NetworksController', [
|
|||
});
|
||||
};
|
||||
|
||||
$scope.offlineMode = false;
|
||||
|
||||
$scope.getNetworks = getNetworks;
|
||||
|
||||
function groupSwarmNetworksManagerNodesFirst(networks, agents) {
|
||||
|
@ -71,7 +68,6 @@ angular.module('portainer.docker').controller('NetworksController', [
|
|||
|
||||
$q.all(req)
|
||||
.then((data) => {
|
||||
$scope.offlineMode = isOfflineEndpoint(endpoint);
|
||||
const networks = _.forEach(data.networks, (item) => (item.Subs = []));
|
||||
if ($scope.applicationState.endpoint.mode.agentProxy && $scope.applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE') {
|
||||
$scope.networks = groupSwarmNetworksManagerNodesFirst(data.networks, data.agents);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<page-header title="'Volume list'" breadcrumbs="['Volumes']" reload="true"> </page-header>
|
||||
|
||||
<information-panel-offline ng-if="offlineMode"></information-panel-offline>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<volumes-datatable
|
||||
|
@ -12,7 +11,6 @@
|
|||
remove-action="removeAction"
|
||||
show-host-column="applicationState.endpoint.mode.agentProxy && applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE'"
|
||||
show-browse-action="showBrowseAction"
|
||||
offline-mode="offlineMode"
|
||||
refresh-callback="getVolumes"
|
||||
></volumes-datatable>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
|
||||
angular.module('portainer.docker').controller('VolumesController', [
|
||||
'$q',
|
||||
'$scope',
|
||||
|
@ -39,8 +37,6 @@ angular.module('portainer.docker').controller('VolumesController', [
|
|||
});
|
||||
};
|
||||
|
||||
$scope.offlineMode = false;
|
||||
|
||||
$scope.getVolumes = getVolumes;
|
||||
function getVolumes() {
|
||||
var endpointProvider = $scope.applicationState.endpoint.mode.provider;
|
||||
|
@ -53,7 +49,6 @@ angular.module('portainer.docker').controller('VolumesController', [
|
|||
})
|
||||
.then(function success(data) {
|
||||
var services = data.services;
|
||||
$scope.offlineMode = isOfflineEndpoint(endpoint);
|
||||
$scope.volumes = data.attached
|
||||
.map(function (volume) {
|
||||
volume.dangling = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue