Skip to content

Commit

Permalink
fix: initial tab is not displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed May 21, 2022
1 parent 2512c1c commit d2e11bc
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 29 deletions.
11 changes: 6 additions & 5 deletions src/app/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function createWindow(): BrowserWindow {
width: Math.round(size.width * 0.8),
height: Math.round(size.height * 0.8),
useContentSize: true, // 这个要设置,不然计算显示区域尺寸不准
// frame: os.type() === 'Darwin' ? true : false, //mac use default frame
frame: os.type() === 'Darwin' ? true : false, //mac use default frame
webPreferences: {
webSecurity: false,
preload: path.join(__dirname, '../../', 'platform', 'electron-browser', 'preload.js'),
Expand All @@ -56,11 +56,12 @@ function createWindow(): BrowserWindow {
processEnv === 'development'
? 'http://localhost:4200'
: `file://${path.join(__dirname, '../../workbench/browser/dist/index.html')}`;
console.log('loadPage', file);
win.loadURL(file);
win.webContents.openDevTools({
mode: 'undocked',
});
if (['serve'].includes(processEnv)) {
win.webContents.openDevTools({
mode: 'undocked',
});
}
UnitWorkerModule.setup({
view: win,
});
Expand Down
1 change: 0 additions & 1 deletion src/platform/browser/IndexedDB/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export class Storage extends Dexie implements StorageInterface {
apiTestHistory!: Table<ApiTestHistory, number | string>;

constructor() {
console.log('eoapi indexedDB storage start');
super('eoapi_core');
this.version(1).stores({
project: '++uuid, name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</nz-input-group>
</header>
<!-- Fixed Group -->
<div class="group_container fixed_group_tree pt10" *ngIf="electron.isElectron">
<!-- <div class="group_container fixed_group_tree pt10" *ngIf="electron.isElectron">
<nz-tree
[nzData]="fixedTreeNode"
[nzSelectedKeys]="nzSelectedKeys"
Expand All @@ -46,7 +46,7 @@
</div>
</div>
</ng-template>
</div>
</div> -->
<div class="bbd" *ngIf="electron.isElectron"></div>
<!-- Custom Group -->
<div class="group_container group_tree pt10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
isFixed: true,
},
];
nzSelectedKeys: number[] = [];
nzSelectedKeys: string[] = [];
private destroy$: Subject<void> = new Subject<void>();
constructor(
private router: Router,
Expand Down Expand Up @@ -90,7 +90,6 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
listToTree(this.treeItems, this.treeNodes, '0');
setTimeout(() => {
this.expandGroup();
this.setSelectedKeys();
}, 0);
}
/**
Expand Down Expand Up @@ -137,6 +136,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
});
});
this.apiDataItems = apiItems;
this.messageService.send({ type: 'loadApi', data: this.apiDataItems });
this.generateGroupTreeData();
this.restoreExpandStatus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class ApiTabService {
return this.currentTab.uuid;
}
constructor() {
console.log('init api tab service');
this.saveTabData$.subscribe((inData) => {
this.addData(inData);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class ExtensionListComponent implements OnInit {
this.type = this.route.snapshot.queryParams.type;
}
async ngOnInit() {
this.renderList = await this.searchPlugin();
this.watchSearchConditionChange();
}
async searchPlugin(keyword = '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,59 @@ export class NavbarComponent implements OnInit {
},
{
id: 'mac',
name: 'macOS 客户端',
name: 'macOS(Intel) 客户端',
icon: 'mac',
suffix: 'dmg',
link: '',
},
{
id: 'mac',
name: 'macOS(M1) 客户端',
icon: 'mac',
suffix: 'arm64.dmg',
link: '',
},
];

constructor(private electron: ElectronService) {
this.isElectron = this.electron.isElectron;
this.getInstaller();
}
private findLinkInSingleAssets(assets, item) {
let result = '';
let assetIndex = assets.findIndex(
(asset) =>
new RegExp(`${item.suffix}$`,'g').test(asset.browser_download_url)&&
(!item.keyword || asset.browser_download_url.includes(item.keyword))
);
if (assetIndex === -1) {
return result;
}
result = assets[assetIndex].browser_download_url;
assets.splice(assetIndex, 1);
return result;
}
private findLink(allAssets, item) {
let result = '';
allAssets.some((assets) => {
result = this.findLinkInSingleAssets(assets, item);
return result;
});
return result;
}
getInstaller() {
fetch('https://api.github.com/repos/eolinker/eoapi/releases')
.then((response) => response.json())
.then((data) => {
this.resourceInfo.forEach((item) => {
let assetItem = data[0].assets.find(
(asset) =>
asset.browser_download_url.slice(-item.suffix.length) === item.suffix &&
(!item.keyword || asset.browser_download_url.includes(item.keyword))
);
item.link = assetItem.browser_download_url;
});
[...this.resourceInfo]
.sort((a1, a2) => a2.suffix.length - a1.suffix.length)
.forEach((item) => {
item.link = this.findLink(
data.map((val) => val.assets),
item
);
});
console.log(this.resourceInfo)
});
}
minimize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ export class SettingComponent implements OnInit {
// const featureList = window.eo.getFeature('configuration');
const modules = window.eo.getModules();
const extensitonConfigurations = [...modules.values()].filter((n) => n.contributes?.configuration);
console.log('localSettings', this.localSettings);
console.log('extensitonConfigurations', extensitonConfigurations);
const controls = {};
// 所有设置
const allSettings = cloneDeep([
Expand Down Expand Up @@ -246,11 +244,6 @@ export class SettingComponent implements OnInit {
}
return prev.concat(treeItem);
}, []);
console.log('treeData', treeData);
console.log('setings', this.settings);
console.log('nestedSettings', this.nestedSettings);
console.log('controls', controls);

this.dataSource.setData(treeData);
this.treeControl.expandAll();
this.validateForm = this.fb.group(controls);
Expand Down
2 changes: 1 addition & 1 deletion src/workbench/browser/src/assets/theme/antd.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@border-radius-base: 3px;
@primary-color: @theme-color;
@success-color: @theme-color;
@link-color:rgba (0, 0, 0, 0.8);
@link-color:rgba(0, 0, 0, 0.8);
@processing-color: @theme-color;
@tree-title-height: 30px;
body {
Expand Down

0 comments on commit d2e11bc

Please sign in to comment.