Skip to content

Commit

Permalink
删掉不必要的 log
Browse files Browse the repository at this point in the history
  • Loading branch information
niuniuland committed Mar 24, 2024
1 parent a2d670a commit cab6b32
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 48 deletions.
9 changes: 2 additions & 7 deletions .electron-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
module.exports = async function () {
const {getVersion} = await import('./version/getVersion.mjs');
return {
productName: 'chrome-power-alpha',
productName: 'chrome-power',
directories: {
output: 'dist',
buildResources: 'buildResources',
Expand Down Expand Up @@ -46,16 +46,11 @@ module.exports = async function () {
allowToChangeInstallationDirectory: true,
createDesktopShortcut: true,
createStartMenuShortcut: true,
shortcutName: 'chrome-power-alpha',
shortcutName: 'chrome-power',
},

win: {
requestedExecutionLevel: 'requireAdministrator',
},

// Specify linux target just for disabling snap compilation
linux: {
target: 'deb',
},
};
};
12 changes: 5 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- '**.cts'
- '**.tsx'
- '**.vue'
- '**.json'
pull_request:
paths:
- '**.js'
Expand All @@ -23,7 +22,6 @@ on:
- '**.cts'
- '**.tsx'
- '**.vue'
- '**.json'

concurrency:
group: lint-${{ github.ref }}
Expand All @@ -38,8 +36,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/setup-node@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
cache: 'npm'

Expand All @@ -54,10 +52,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/setup-node@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
cache: 'npm'

- run: npm i prettier
- run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json}"
- run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}"
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

首款开源指纹浏览器。基于 Puppeteer、Electron、React 开发。

此软件遵循AGPL协议,因此如果你想对其进行修改并进行商业发布,请保持开源。
此软件遵循AGPL协议,因此如果你想对其进行修改发布,请保持开源。

## 免责声明

<p style="color: red;">
此软件目前处于公测阶段,请确保你在进入生产前完全了解如何存储你的数据和资产以及可能存在的风险,因为由于操作错误导致的任何资产损失,我们概不负责。
</p>
本代码仅用于技术交流、学习,请勿用于非法、商业用途。本代码不保存任何用户数据,同时也不对用户数据负责,请知悉。

## 开始

Expand All @@ -26,17 +24,19 @@
- 从模板导入
- 从 AdsPower 导入

## Todo
## 功能

- [x] 多语言支持
- [x] 多窗口管理
- [x] 代理设置
- [x] 中英文支持
- [x] Puppeteer/Playwright/Selenium 接入
- [ ] 同步操作
- [ ] 扩展程序管理
- [ ] 同步操作
- [ ] 自动化脚本

## 打赏

🙌你可以通过向下面的钱包打赏一笔咖啡钱来支持我
🙌你可以通过向下面的钱包打赏一杯咖啡来支持我

Bitcoin Address: `bc1p0uex9rn8nd9uyguulp6r3d3t9kylrk42dg6sq22f3h5rktlk22ks6mlv6t`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chrome-power",
"description": "The first open source fingerprint browser.",
"version": "1.0.0",
"version": "1.1.0",
"private": true,
"author": {
"email": "[email protected]",
Expand Down
3 changes: 1 addition & 2 deletions packages/main/src/services/common-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import axios from 'axios';
const logger = createLogger(SERVICE_LOGGER_LABEL);

export const initCommonService = () => {
logger.info('init common service...');
ipcMain.handle('common-download', async (_, filePath: string) => {
const win = BrowserWindow.getAllWindows()[0];
const defaultPath = join(app.getPath('downloads'), 'template.xlsx');
Expand Down Expand Up @@ -90,7 +89,7 @@ export const initCommonService = () => {
try {
writeFileSync(configFilePath, JSON.stringify(values), 'utf8');
} catch (error) {
console.error('Error writing to the settings file:', error);
logger.error('Error writing to the settings file:', error);
}

return {};
Expand Down
4 changes: 0 additions & 4 deletions packages/main/src/services/group-service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import {ipcMain} from 'electron';
import type {DB} from '../../../shared/types/db';
import {GroupDB} from '../db/group';
import {createLogger} from '../../../shared/utils/logger';
import {SERVICE_LOGGER_LABEL} from '../constants';

const logger = createLogger(SERVICE_LOGGER_LABEL);

export const initGroupService = () => {
logger.info('init group service...');
ipcMain.handle('group-create', async (_, group: DB.Group) => {
return await GroupDB.create(group);
});
Expand Down
5 changes: 0 additions & 5 deletions packages/main/src/services/proxy-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import {ipcMain} from 'electron';
import type {DB} from '../../../shared/types/db';
import {ProxyDB} from '../db/proxy';
import {testProxy} from '../fingerprint/prepare';
import {createLogger} from '../../../shared/utils/logger';
import {SERVICE_LOGGER_LABEL} from '../constants';

const logger = createLogger(SERVICE_LOGGER_LABEL);
export const initProxyService = () => {
logger.info('init proxy bridge...');

ipcMain.handle('proxy-create', async (_, proxy: DB.Proxy) => {
return await ProxyDB.create(proxy);
Expand Down Expand Up @@ -37,7 +33,6 @@ export const initProxyService = () => {
});

ipcMain.handle('proxy-test', async (_, testParams: number | DB.Proxy) => {
logger.info('proxy-test', testParams, typeof testParams);
if (typeof testParams === 'number') {
const proxy = await ProxyDB.getById(testParams);
return await testProxy(proxy);
Expand Down
2 changes: 0 additions & 2 deletions packages/main/src/services/sync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import {startGroupControl, tileWindows} from '../sync';
const logger = createLogger(SERVICE_LOGGER_LABEL);

export const initSyncService = () => {
logger.info('init sync service...');

ipcMain.handle('tile-windows', async () => {
logger.info('tile-windows');
tileWindows();
});

Expand Down
4 changes: 0 additions & 4 deletions packages/main/src/services/tag-service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import {ipcMain} from 'electron';
import type {DB} from '../../../shared/types/db';
import {TagDB} from '../db/tag';
import {createLogger} from '../../../shared/utils/logger';
import {SERVICE_LOGGER_LABEL} from '../constants';

const logger = createLogger(SERVICE_LOGGER_LABEL);

export const initTagService = () => {
logger.info('init tag service...');
ipcMain.handle('tag-create', async (_, tag: DB.Tag) => {
return await TagDB.create(tag);
});
Expand Down
1 change: 0 additions & 1 deletion packages/renderer/src/pages/api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const Api = () => {
const fetchApi = async () => {
const apiInfo = await CommonBridge.getApi();
setApiInfo(apiInfo);
console.log(apiInfo);
};

useEffect(() => {
Expand Down
8 changes: 2 additions & 6 deletions packages/renderer/src/pages/logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ const Logs = () => {
key: 'Api',
label: 'Api',
},
{
key: 'Service',
label: 'Service',
},
];
const [logsData, setLogsData] = React.useState<logsDataOptions[]>([]);

const fetchLogs = async (logModule: 'Main' | 'Windows' | 'Proxy' | 'Services' | 'Api') => {
const fetchLogs = async (logModule: 'Main' | 'Windows' | 'Proxy' | 'Api') => {
const logs = await CommonBridge.getLogs(logModule);
setLogsData(logs);
};
Expand All @@ -55,7 +51,7 @@ const Logs = () => {
>
<Tabs
onChange={(key: string) =>
fetchLogs(key as 'Main' | 'Windows' | 'Proxy' | 'Services' | 'Api')
fetchLogs(key as 'Main' | 'Windows' | 'Proxy' | 'Api')
}
size="small"
items={items}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const WindowEditForm = ({
};
const fetchProxies = async () => {
const proxies = await ProxyBridge?.getAll();
console.log(proxies);
setProxies(proxies);
};

Expand Down
Empty file removed scripts/uninstall.nsis
Empty file.

0 comments on commit cab6b32

Please sign in to comment.