mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 23:35:31 +02:00
refactor(settings): migrate view to react [EE-5509] (#9179)
This commit is contained in:
parent
b93624fa1f
commit
0e9902fee9
25 changed files with 548 additions and 281 deletions
|
@ -364,8 +364,7 @@ angular
|
|||
url: '/settings',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: './views/settings/settings.html',
|
||||
controller: 'SettingsController',
|
||||
component: 'settingsView',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@ import { withI18nSuspense } from '@/react-tools/withI18nSuspense';
|
|||
import { EdgeAutoCreateScriptView } from '@/react/portainer/environments/EdgeAutoCreateScriptView';
|
||||
import { ListView as EnvironmentsListView } from '@/react/portainer/environments/ListView';
|
||||
import { BackupSettingsPanel } from '@/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel';
|
||||
import { SettingsView } from '@/react/portainer/settings/SettingsView/SettingsView';
|
||||
|
||||
import { wizardModule } from './wizard';
|
||||
import { teamsModule } from './teams';
|
||||
|
@ -54,4 +55,8 @@ export const viewsModule = angular
|
|||
.component(
|
||||
'backupSettingsPanel',
|
||||
r2a(withUIRouter(withReactQuery(withCurrentUser(BackupSettingsPanel))), [])
|
||||
)
|
||||
.component(
|
||||
'settingsView',
|
||||
r2a(withUIRouter(withReactQuery(withCurrentUser(SettingsView))), [])
|
||||
).name;
|
||||
|
|
|
@ -2,6 +2,9 @@ import { Environment } from '@/react/portainer/environments/types';
|
|||
|
||||
export interface StateManager {
|
||||
updateEndpointState(endpoint: Environment): Promise<void>;
|
||||
updateLogo(logo: string): void;
|
||||
updateSnapshotInterval(interval: string): void;
|
||||
updateEnableTelemetry(enable: boolean): void;
|
||||
}
|
||||
|
||||
export interface IAuthenticationService {
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<page-header title="'Settings'" breadcrumbs="['Settings']"> </page-header>
|
||||
|
||||
<application-settings-panel on-success="(handleSuccess)"></application-settings-panel>
|
||||
|
||||
<kube-settings-panel></kube-settings-panel>
|
||||
|
||||
<helm-cert-panel></helm-cert-panel>
|
||||
|
||||
<ssl-settings-panel></ssl-settings-panel>
|
||||
|
||||
<hidden-containers-panel></hidden-containers-panel>
|
||||
|
||||
<!-- backup -->
|
||||
<backup-settings-panel></backup-settings-panel>
|
|
@ -1,20 +0,0 @@
|
|||
import angular from 'angular';
|
||||
|
||||
angular.module('portainer.app').controller('SettingsController', SettingsController);
|
||||
|
||||
/* @ngInject */
|
||||
function SettingsController($scope, StateManager) {
|
||||
$scope.handleSuccess = handleSuccess;
|
||||
|
||||
$scope.state = {
|
||||
showHTTPS: !window.ddExtension,
|
||||
};
|
||||
|
||||
function handleSuccess(settings) {
|
||||
if (settings) {
|
||||
StateManager.updateLogo(settings.LogoURL);
|
||||
StateManager.updateSnapshotInterval(settings.SnapshotInterval);
|
||||
StateManager.updateEnableTelemetry(settings.EnableTelemetry);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue