Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
1024程序员开源挑战赛
提交
10cb3724
1
1024程序员开源挑战赛
项目概览
夜猫逐梦
/
1024程序员开源挑战赛
与 Fork 源项目一致
Fork自
GitCode / 1024程序员开源挑战赛(10.23-11.14)
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
1
1024程序员开源挑战赛
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
10cb3724
编写于
4月 27, 2021
作者:
B
baiy
提交者:
ninecents
10月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
utools 切换为原生窗口
上级
2f99e78b
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
50 addition
and
108 deletion
+50
-108
README.md
README.md
+1
-1
public/img/icon_utools.png
public/img/icon_utools.png
+0
-0
public/tool.html
public/tool.html
+1
-1
public/tool_preload.js
public/tool_preload.js
+0
-23
public/utools.html
public/utools.html
+0
-43
src/adapter/utools/plugin.json
src/adapter/utools/plugin.json
+5
-2
src/config.js
src/config.js
+12
-2
src/helper.js
src/helper.js
+1
-0
src/tool.js
src/tool.js
+8
-21
src/tool.vue
src/tool.vue
+18
-0
src/tool/adapter.js
src/tool/adapter.js
+2
-1
src/views/setting/block.vue
src/views/setting/block.vue
+0
-12
src/views/setting/common.vue
src/views/setting/common.vue
+2
-2
未找到文件。
README.md
浏览文件 @
10cb3724
...
...
@@ -71,4 +71,4 @@
> 当然项目中还使用很多不知道姓名的大神的代码, 在这里就不一一感谢
## 先睹为快
!
[](
dome.jpg
)
!
[](
https://raw.githubusercontent.com/baiy/Ctool/master/
dome.jpg
)
public/img/icon_utools.png
查看替换文件 @
2f99e78b
浏览文件 @
10cb3724
11.1 KB
|
W:
|
H:
14.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
public/tool.html
浏览文件 @
10cb3724
...
...
@@ -7,7 +7,7 @@
<title>
Ctool 程序开发常用工具
</title>
</head>
<body>
<div
id=
"page"
style=
"width: 800px;height: 550px;margin: 0 auto;padding: 0
6
px;overflow-y:auto;"
>
<div
id=
"page"
style=
"width: 800px;height: 550px;margin: 0 auto;padding: 0
10
px;overflow-y:auto;"
>
<div
id=
"app"
></div>
</div>
<div
id=
"clipboard"
></div>
...
...
public/tool_preload.js
已删除
100644 → 0
浏览文件 @
2f99e78b
const
{
remote
}
=
require
(
"
electron
"
);
const
browserWindow
=
remote
.
getCurrentWindow
()
browserWindow
.
webContents
.
on
(
'
before-input-event
'
,
(
event
,
input
)
=>
{
// mac 关闭支持
if
(
process
.
platform
===
"
darwin
"
)
{
if
(
input
.
meta
&&
([
'
q
'
,
'
w
'
].
includes
(
input
.
key
.
toLowerCase
())))
{
event
.
preventDefault
()
browserWindow
.
blur
()
browserWindow
.
close
()
}
}
})
browserWindow
.
once
(
'
ready-to-show
'
,
()
=>
{
browserWindow
.
show
()
})
window
.
ctool
=
{}
window
.
ctool
.
isDevToolsOpened
=
function
()
{
return
browserWindow
.
webContents
.
isDevToolsOpened
();
}
window
.
ctool
.
toggleDevTools
=
function
()
{
return
browserWindow
.
webContents
.
toggleDevTools
();
}
\ No newline at end of file
public/utools.html
已删除
100644 → 0
浏览文件 @
2f99e78b
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<title>
Ctool 程序开发常用工具
</title>
</head>
<body>
</body>
<script>
function
setToolCode
(
name
)
{
let
data
=
utools
.
db
.
get
(
"
_current_tool_
"
);
let
rev
=
data
?
{
'
_rev
'
:
data
.
_rev
}
:
{}
utools
.
db
.
put
({
'
_id
'
:
'
_current_tool_
'
,
'
data
'
:
name
,
...
rev
})
}
window
.
utools
.
onPluginEnter
(({
code
})
=>
{
let
tool
=
""
;
if
(
code
.
indexOf
(
'
ctool-
'
)
!==
-
1
)
{
tool
=
code
.
replace
(
/ctool-/g
,
""
)
}
setToolCode
(
tool
)
window
.
utools
.
createBrowserWindow
(
'
tool.html
'
,
{
width
:
1200
,
height
:
650
,
show
:
false
,
webPreferences
:
{
preload
:
'
tool_preload.js
'
}
}
)
window
.
utools
.
hideMainWindow
()
window
.
utools
.
outPlugin
()
})
</script>
</html>
\ No newline at end of file
src/adapter/utools/plugin.json
浏览文件 @
10cb3724
...
...
@@ -3,11 +3,14 @@
"description"
:
"Ctool 程序开发常用工具"
,
"author"
:
"baiy"
,
"homepage"
:
"https://github.com/baiy/Ctool"
,
"main"
:
"
utools
.html"
,
"main"
:
"
tool
.html"
,
"version"
:
"##version##"
,
"logo"
:
"img/icon
128
.png"
,
"logo"
:
"img/icon
_utools
.png"
,
"pluginSetting"
:
{
"single"
:
true
},
"development"
:
{
"main"
:
"http://localhost:8081/tool.html"
},
"features"
:
"##features##"
}
\ No newline at end of file
src/config.js
浏览文件 @
10cb3724
...
...
@@ -7,8 +7,18 @@ const category = [
]
const
tool
=
[
{
'
name
'
:
'
hash
'
,
'
title
'
:
'
哈希(hash)
'
,
'
cat
'
:
[
'
encryption
'
]},
{
'
name
'
:
'
encrypt
'
,
'
title
'
:
'
加密/解密
'
,
'
cat
'
:
[
'
encryption
'
]},
{
'
name
'
:
'
hash
'
,
'
title
'
:
'
哈希(hash)
'
,
'
cat
'
:
[
'
encryption
'
],
'
keyword
'
:
[
'
md5
'
,
'
sha1
'
,
'
sha256
'
,
'
sha512
'
,
'
sm3
'
]
},
{
'
name
'
:
'
encrypt
'
,
'
title
'
:
'
加密/解密
'
,
'
cat
'
:
[
'
encryption
'
],
'
keyword
'
:
[
'
AES
'
,
'
DES
'
,
'
RC4
'
,
'
Rabbit
'
,
'
TripleDes
'
,
'
sm2
'
]
},
{
'
name
'
:
'
base64
'
,
'
title
'
:
'
BASE64编码
'
,
'
cat
'
:
[
'
encryption
'
]},
{
'
name
'
:
'
json
'
,
'
title
'
:
'
JSON工具
'
,
'
cat
'
:
[
'
conversion
'
,
'
serialize
'
]},
{
'
name
'
:
'
url
'
,
'
title
'
:
'
URL编码
'
,
'
cat
'
:
[
'
conversion
'
]},
...
...
src/helper.js
浏览文件 @
10cb3724
...
...
@@ -45,6 +45,7 @@ export const stat = function (action, data = {}) {
{
v
:
env
(
'
version
'
),
a
:
action
,
p
:
env
(
'
platform
'
),
r
:
Math
.
random
()
},
data
...
...
src/tool.js
浏览文件 @
10cb3724
...
...
@@ -3,38 +3,25 @@ import ViewUI from 'view-design'
import
'
view-design/dist/styles/iview.css
'
import
router
from
'
./tool.router
'
import
optionBlock
from
'
./components/optionBlock
'
import
model
,
{
plugin
as
modelPlugin
}
from
'
./tool/model
'
import
{
plugin
as
modelPlugin
}
from
'
./tool/model
'
import
App
from
'
./tool.vue
'
import
{
isUtools
}
from
'
./helper
'
import
config
from
"
./tool/config
"
;
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ViewUI
)
Vue
.
use
(
modelPlugin
)
Vue
.
component
(
'
option-block
'
,
optionBlock
);
(
function
()
{
if
(
isUtools
)
{
let
tool
=
window
.
utools
.
db
.
get
(
"
_current_tool_
"
);
if
(
tool
&&
tool
.
data
)
{
let
cat
=
config
.
getToolDefaultCategory
(
tool
.
data
);
if
(
cat
)
{
model
.
setCategoryHistory
(
cat
)
model
.
setToolHistory
(
cat
,
tool
.
data
)
}
}
}
if
(
document
.
body
.
clientWidth
>
900
||
isUtools
)
{
console
.
log
(
'
调整窗口大小
'
)
const
page
=
document
.
getElementById
(
'
page
'
)
page
.
style
.
width
=
'
auto
'
page
.
style
.
padding
=
'
0 50px
'
page
.
style
.
height
=
'
auto
'
page
.
style
.
minHeight
=
'
600px
'
}
})()
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ViewUI
)
Vue
.
use
(
modelPlugin
)
Vue
.
component
(
'
option-block
'
,
optionBlock
);
new
Vue
({
router
,
render
:
h
=>
h
(
App
),
...
...
src/tool.vue
浏览文件 @
10cb3724
...
...
@@ -126,6 +126,24 @@ export default {
},
},
created
()
{
if
(
this
.
isUtools
){
window
.
utools
.
onPluginEnter
(({
code
})
=>
{
let
tool
=
""
;
if
(
code
.
indexOf
(
'
ctool-
'
)
!==
-
1
)
{
tool
=
code
.
replace
(
/ctool-/g
,
""
)
}
if
(
tool
&&
this
.
currentTool
!==
tool
)
{
let
cat
=
config
.
getToolDefaultCategory
(
tool
);
if
(
cat
)
{
model
.
setCategoryHistory
(
cat
)
model
.
setToolHistory
(
cat
,
tool
)
this
.
currentCategory
=
cat
;
this
.
currentTool
=
tool
;
}
}
})
}
this
.
currentCategory
=
model
.
getCategoryHistory
()
this
.
currentTool
=
model
.
getToolHistory
(
this
.
currentCategory
)
this
.
$Message
.
config
({
...
...
src/tool/adapter.js
浏览文件 @
10cb3724
...
...
@@ -47,10 +47,11 @@ const utoolsConfigWrite = () => {
"
cmds
"
:
[
'
ctool
'
,
'
程序开发常用工具
'
]
},
...
toolConfig
.
tool
.
map
((
item
)
=>
{
let
keyword
=
item
.
hasOwnProperty
(
"
keyword
"
)
?
item
[
'
keyword
'
]
:
[];
return
{
"
code
"
:
"
ctool-
"
+
item
.
name
,
"
explain
"
:
item
.
title
,
"
cmds
"
:
[
item
.
name
,
item
.
title
,
"
ctool-
"
+
item
.
name
]
"
cmds
"
:
Array
.
from
(
new
Set
([
item
.
name
,
item
.
title
,
"
ctool-
"
+
item
.
name
,
...
keyword
]))
}
})
]
...
...
src/views/setting/block.vue
浏览文件 @
10cb3724
...
...
@@ -12,9 +12,6 @@
<Cell
title=
"自动读取剪贴板内容"
>
<i-switch
v-model=
"auto_read_copy"
slot=
"extra"
/>
</Cell>
<!--
<Cell
v-if=
"is_utools"
title=
"页面开发者工具"
>
-->
<!--
<i-switch
v-model=
"is_dev_tools_opened"
slot=
"extra"
@
on-change=
"toggleDevTools"
/>
-->
<!--
</Cell>
-->
</CellGroup>
</div>
<Drawer
title=
"设置"
placement=
"left"
v-model=
"settingShow"
:width=
"90"
>
...
...
@@ -36,16 +33,12 @@ export default {
return
{
settingShow
:
false
,
auto_save_copy
:
true
,
is_dev_tools_opened
:
false
,
auto_read_copy
:
true
,
is_chrome
:
isChrome
,
is_utools
:
isUtools
,
}
},
created
()
{
if
(
isUtools
)
{
this
.
is_dev_tools_opened
=
window
.
ctool
.
isDevToolsOpened
();
}
this
.
auto_save_copy
=
setting
.
autoSaveCopy
()
this
.
auto_read_copy
=
setting
.
autoReadCopy
()
},
...
...
@@ -63,11 +56,6 @@ export default {
this
.
settingShow
=
true
break
}
},
toggleDevTools
()
{
if
(
isUtools
)
{
window
.
ctool
.
toggleDevTools
()
}
}
},
}
...
...
src/views/setting/common.vue
浏览文件 @
10cb3724
<
template
>
<div>
<CheckboxGroup
v-model=
"tools"
@
on-change=
"toolUpdate"
style=
"line-height: 30px;"
>
<Checkbox
v-for=
"(t,k) in all"
:key=
"k"
:label=
"t.name"
>
{{
$t
(
'
main_tool_
'
+
t
.
name
)
}}
</Checkbox>
<Checkbox
v-for=
"(t,k) in all"
:key=
"k"
:label=
"t.name"
>
{{
t
.
title
}}
</Checkbox>
</CheckboxGroup>
</div>
</
template
>
...
...
@@ -28,4 +28,4 @@
},
},
}
</
script
>
</
script
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录