Skip to content

Commit

Permalink
fix: setttings should auto save
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Jun 29, 2022
1 parent 1df843d commit 565134b
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Message, MessageService } from '../../../shared/services/message';
import { Subject, takeUntil } from 'rxjs';
import { NzMessageService } from 'ng-zorro-antd/message';
import { RemoteService } from 'eo/workbench/browser/src/app/shared/services/remote/remote.service';
import { Router } from '@angular/router';

interface TreeNode {
name: string;
Expand Down Expand Up @@ -84,7 +83,16 @@ export class SettingComponent implements OnInit {
$isShowModal = false;
/** current active configure */
/** all configure */
settings = {};
$settings = {};

set settings(val) {
this.$settings = val;
this.handleSave();
}

get settings() {
return this.$settings;
}
treeNodes = [
{
name: 'Data Storage',
Expand Down Expand Up @@ -121,8 +129,7 @@ export class SettingComponent implements OnInit {
private fb: FormBuilder,
private messageService: MessageService,
private message: NzMessageService,
private remoteService: RemoteService,
private router: Router
private remoteService: RemoteService
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -236,7 +243,7 @@ export class SettingComponent implements OnInit {
this.settings = this.localSettings = JSON.parse(localStorage.getItem('localSettings') || '{}');
// @ts-ignore
window.getConfiguration = this.remoteService.getConfiguration;
// console.log('localSettings', this.localSettings);
console.log('localSettings', this.localSettings);
// const featureList = window.eo.getFeature('configuration');
const modules = window.eo?.getModules() || new Map([]);
// const extensitonConfigurations = [...modules.values()].filter((n) => n.contributes?.configuration);
Expand Down Expand Up @@ -312,13 +319,6 @@ export class SettingComponent implements OnInit {
this.selectModule(this.treeControl.dataNodes.at(0));
}

navToExtensionList() {
this.router.navigate(['home/extension/list'], {
queryParams: { type: 'all' },
});
this.handleCancel();
}

handleShowModal() {
this.isShowModal = true;
}
Expand Down

0 comments on commit 565134b

Please sign in to comment.