Skip to content

Commit

Permalink
Merge pull request #22 from vicanso/main
Browse files Browse the repository at this point in the history
version 0.1.11
  • Loading branch information
vicanso authored Jun 26, 2023
2 parents aa45f1b + 35032fa commit 78cc988
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 154 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file.

## [0.1.11] - 2023-06-26

### Bug Fixes

- Fix set variable for req header

### Documentation

- Update readme

### Features

- Support expand view editor

## [0.1.10] - 2023-06-15

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ orm:
-u "sqlite:///~/Library/Application Support/com.bigtree.cyberapi/my_db.db" \
-o src/entities
version:
git cliff --unreleased --tag 0.1.10 --prepend CHANGELOG.md
git cliff --unreleased --tag 0.1.11 --prepend CHANGELOG.md
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ English|[简体中文](./README_zh.md)|[Українська](./README_uk.md)
The installer can be downloaded through [release](https://github.com/vicanso/cyberapi/releases), including windows, macos and linux versions.

Windows may need to install webview2.

## macos

> If you can't open it after installation, exec the following command then reopen:<br>`sudo xattr -rd com.apple.quarantine /Applications/CyberAPI.app`
## Development


Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CyberAPI暂时仅是开发版本,业余时间的个人项目,如果有BUG或
安装程序可以通过[release](https://github.com/vicanso/cyberapi/releases)下载,包括windows、macos以及linux版本。

需要注意如果是win7或者未安装Edge的windows,在安装时会提示需要执行MicrosoftEdgeUpdateSetup的程序,如果杀毒软件提示允许执行即可。
如果是macos,由于系统的安全调整,打开应用时会提示"无法打开“CyberAPI”,因为Apple无法检查其是否包含恶意软件。",在“系统设置” -> “安全性与隐私” -> “通用”面板选择继续打开即可。
如果是macos,由于系统的安全调整,打开应用时会提示"无法打开“CyberAPI”,因为Apple无法检查其是否包含恶意软件。",在“系统设置” -> “安全性与隐私” -> “通用”面板选择继续打开即可。或者执行以下命令:`sudo xattr -rd com.apple.quarantine /Applications/CyberAPI.app`

## 开发者

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cyberapi",
"private": true,
"version": "0.1.10",
"version": "",
"scripts": {
"format": "prettier --write src/*.ts src/*.tsx src/**/*.ts src/**/*.tsx src/**/**/*.tsx",
"lint": "eslint . --ext .js,.tsx,.ts --fix && vue-tsc --noEmit",
Expand All @@ -26,7 +26,7 @@
"mitt": "^3.0.0",
"monaco-editor": "^0.39.0",
"naive-ui": "^2.34.4",
"pinia": "^2.1.3",
"pinia": "^2.1.4",
"pretty-bytes": "^6.1.0",
"ulid": "^2.3.0",
"vue": "^3.3.4",
Expand All @@ -38,20 +38,20 @@
"@types/crypto-js": "^4.1.1",
"@types/debug": "^4.1.8",
"@types/shortid": "^0.0.29",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue/compiler-sfc": "^3.3.4",
"eslint": "^8.42.0",
"eslint-plugin-vue": "^9.14.1",
"eslint": "^8.43.0",
"eslint-plugin-vue": "^9.15.0",
"glob-parent": ">=6.0.2",
"prettier": "^2.8.8",
"rollup-plugin-visualizer": "^5.9.0",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.1.3",
"vite": "^4.3.9",
"vite-plugin-linaria": "^1.0.0",
"vue-tsc": "^1.6.5"
"vue-tsc": "^1.8.0"
}
}
31 changes: 16 additions & 15 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cyberapi"
version = "0.1.9"
version = "0.1.11"
description = "API tool based on tauri, it is smaller and faster."
authors = ["tree.xie@outlook.com"]
license = "Apache License 2.0"
Expand All @@ -17,14 +17,14 @@ tauri-build = { version = "1.4.0", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.4.0", features = ["app-hide", "clipboard-all", "dialog-all", "fs-exists", "fs-read-dir", "fs-read-file", "fs-write-file", "os-all", "path-all", "process-all", "window-all"] }
tauri = { version = "1.4.1", features = ["app-hide", "clipboard-all", "dialog-all", "fs-exists", "fs-read-dir", "fs-read-file", "fs-write-file", "os-all", "path-all", "process-all", "window-all"] }
once_cell = "1.18.0"
chrono = "0.4"
strum = "0.24"
strum_macros = "0.24"
hyper = { version = "0.14.26", features = ["client", "http1"] }
base64 = "0.21.2"
cookie_store = "0.16.1"
cookie_store = "0.16.2"
url = "2.4.0"
time = "0.3.13"
hyper-timeout = "0.4.1"
Expand Down
5 changes: 2 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"distDir": "../dist"
},
"package": {
"productName": "CyberAPI",
"version": "0.1.10"
"productName": "CyberAPI"
},
"tauri": {
"allowlist": {
Expand Down Expand Up @@ -56,7 +55,7 @@
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "© 2022 Tree Xie. All rights reserved.",
"copyright": "© 2022-2023 Tree Xie. All rights reserved.",
"deb": {
"depends": []
},
Expand Down
40 changes: 40 additions & 0 deletions src/components/APISettingParams/req_params.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
NBadge,
NButton,
NButtonGroup,
NDropdown,
NIcon,
NTab,
Expand Down Expand Up @@ -43,6 +44,12 @@ enum TabItem {

const tabClass = css`
position: relative;
.expandSelect {
visibility: hidden;
}
.n-tabs:hover .expandSelect {
visibility: visible;
}
.n-tabs-tab__label {
.n-icon {
margin-left: 5px;
Expand Down Expand Up @@ -284,6 +291,9 @@ export default defineComponent({
props.onUpdateAuth(arr);
}
};
const updateParamsColumnWidth = (width: number) => {
settingStore.updateParamsColumnWidth(width);
};

// method变化时要选定对应的tab
const stop = watch(
Expand Down Expand Up @@ -330,6 +340,7 @@ export default defineComponent({
handleFormat,
activeTab,
codeEditor,
updateParamsColumnWidth,
};
},
render() {
Expand Down Expand Up @@ -483,9 +494,38 @@ export default defineComponent({

const keyValueSpans = [8, 16];

const tabSlots = {
suffix: () => (
<NButtonGroup class="expandSelect">
<NButton
onClick={() => {
this.updateParamsColumnWidth(0.3);
}}
>
30%
</NButton>
<NButton
onClick={() => {
this.updateParamsColumnWidth(0.5);
}}
>
50%
</NButton>
<NButton
onClick={() => {
this.updateParamsColumnWidth(0.7);
}}
>
70%
</NButton>
</NButtonGroup>
),
};

return (
<div class={tabClass}>
<NTabs
v-slots={tabSlots}
tabsPadding={15}
key={method}
type="line"
Expand Down
3 changes: 3 additions & 0 deletions src/stores/api_setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export const useAPISettingStore = defineStore("apiSettings", {
}
const variables = useGlobalReqHeaderStore().listEnable();
if (variables) {
if (!req.headers) {
req.headers = [];
}
variables.forEach((item) => {
req.headers.push({
key: item.name,
Expand Down
9 changes: 9 additions & 0 deletions src/stores/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ export const useSettingStore = defineStore("common", {
await updateAppSetting(setting);
this.collectionColumnWidths = widths;
},
async updateParamsColumnWidth(width: number) {
if (width < 0.2 || width > 0.8) {
return;
}
const setting = await getAppSetting();
const widths = setting.collectionColumnWidths.slice(0);
widths[1] = width;
return this.updateCollectionColumnWidths(widths);
},
async updateSize(width: number, height: number) {
const setting = await getAppSetting();
setting.size = {
Expand Down
Loading

0 comments on commit 78cc988

Please sign in to comment.