Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gitcode_dev
quicker
提交
e37e20c5
quicker
项目概览
gitcode_dev
/
quicker
上一次同步 接近 2 年
通知
6
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
quicker
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e37e20c5
编写于
1月 18, 2022
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:添加插件市场分类
上级
58ffae88
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
126 addition
and
77 deletion
+126
-77
src/main/browsers/main.js
src/main/browsers/main.js
+1
-1
src/renderer/assets/api/index.js
src/renderer/assets/api/index.js
+15
-2
src/renderer/pages/plugins/index.vue
src/renderer/pages/plugins/index.vue
+1
-0
src/renderer/pages/search/subpages/market.vue
src/renderer/pages/search/subpages/market.vue
+109
-74
未找到文件。
src/main/browsers/main.js
浏览文件 @
e37e20c5
...
@@ -57,7 +57,7 @@ module.exports = () => {
...
@@ -57,7 +57,7 @@ module.exports = () => {
});
});
win
.
on
(
"
blur
"
,
()
=>
{
win
.
on
(
"
blur
"
,
()
=>
{
const
childWindows
=
win
.
getChildWindows
();
const
childWindows
=
win
.
getChildWindows
();
if
(
!
childWindows
.
length
)
win
.
hide
();
//
if (!childWindows.length) win.hide();
});
});
};
};
...
...
src/renderer/assets/api/index.js
浏览文件 @
e37e20c5
...
@@ -5,10 +5,23 @@ export default {
...
@@ -5,10 +5,23 @@ export default {
axios
.
get
(
axios
.
get
(
"
https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker/releases
"
"
https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker/releases
"
),
),
getPlugins
:
()
=>
getPlugins
:
path
=>
axios
.
get
(
axios
.
get
(
"
https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?path=plugins
"
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?ref=dev&path=
${
path
}
`
),
),
getMenu
:
()
=>
axios
.
get
(
"
https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?path=plugins&ref=dev
"
),
getLogo
:
plugin
=>
`https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/
${
plugin
.
name
}
/
${
plugin
.
logo
}
`
,
getReadme
:
plugin
=>
axios
.
get
(
`https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/
${
plugin
.
name
}
/
${
plugin
.
detail
}
`
),
getDownloadUrl
:
plugin
=>
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/archive.zip?path=plugins%2F
${
plugin
.
name
}
`
,
getPluginDetail
:
pluginName
=>
getPluginDetail
:
pluginName
=>
axios
.
get
(
axios
.
get
(
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/files/plugins%2F
${
pluginName
}
%2Fplugin.json/raw?ref=master`
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/files/plugins%2F
${
pluginName
}
%2Fplugin.json/raw?ref=master`
...
...
src/renderer/pages/plugins/index.vue
浏览文件 @
e37e20c5
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<!-- 本地插件 -->
<!-- 本地插件 -->
<div
v-else
>
<div
v-else
>
<webview
id=
"webview"
:src=
"templatePath"
:preload=
"preload"
></webview>
<webview
id=
"webview"
:src=
"templatePath"
:preload=
"preload"
></webview>
<!--
<webview
id=
"webview"
:src=
"templatePath"
:preload=
"preload"
></webview>
-->
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
src/renderer/pages/search/subpages/market.vue
浏览文件 @
e37e20c5
<
template
>
<
template
>
<div
class=
"market"
>
<div
class=
"market"
>
<a-carousel
v-if=
"bannerList && !!bannerList.length"
arrows
>
<a-menu
mode=
"vertical"
v-model=
"selectedMenu"
@
click=
"getPlugins"
>
<div
<a-menu-item
slot=
"prevArrow"
v-for=
"(item, index) in menu"
slot-scope=
"props"
:key=
"item.id"
class=
"custom-slick-arrow"
:value=
"item.path"
style=
"left: 10px; zindex: 1"
>
>
<a-icon
type=
"left-circle"
/>
<a-icon
:type=
"icon[index]"
/>
</div>
{{
item
.
name
}}
<div
</a-menu-item>
slot=
"nextArrow"
</a-menu>
slot-scope=
"props"
<div
class=
"market-content"
>
class=
"custom-slick-arrow"
<a-carousel
v-if=
"bannerList && !!bannerList.length"
arrows
>
style=
"right: 10px"
<div
>
slot=
"prevArrow"
<a-icon
type=
"right-circle"
/>
slot-scope=
"props"
</div>
class=
"custom-slick-arrow"
<div
v-for=
"banner in bannerList"
>
style=
"left: 10px; zindex: 1"
<img
@
click=
"jumpTo(banner.link)"
width=
"100%"
:src=
"banner.src"
/>
</div>
</a-carousel>
<a-divider
v-if=
"bannerList && !!bannerList.length"
></a-divider>
<h2>
插件
</h2>
<a-list
item-layout=
"horizontal"
style=
"width: 100%"
:grid=
"
{ gutter: 16, column: 2 }"
:data-source="pluginList"
>
<a-list-item
slot=
"renderItem"
slot-scope=
"item, index"
>
<a-button
v-if=
"showButton(item) === 'download'"
:loading=
"loading[index]"
type=
"link"
slot=
"actions"
@
click=
"download(index, item)"
>
>
<a-icon
<a-icon
type=
"left-circle"
/>
v-show=
"!loading[index]"
</div>
style=
"font-size: 20px"
<div
type=
"cloud-download"
slot=
"nextArrow"
/>
slot-scope=
"props"
</a-button>
class=
"custom-slick-arrow"
<a-button
style=
"right: 10px"
v-if=
"showButton(item) === 'update'"
:loading=
"loading[index]"
type=
"link"
slot=
"actions"
@
click=
"update(index, item)"
>
>
<a-icon
<a-icon
type=
"right-circle"
/>
v-show=
"!loading[index]"
</div>
style=
"font-size: 20px; color: #409eff"
<div
v-for=
"banner in bannerList"
>
type=
"sync"
<img
@
click=
"jumpTo(banner.link)"
width=
"100%"
:src=
"banner.src"
/>
/>
</div>
</a-button>
</a-carousel>
<a-divider
v-if=
"bannerList && !!bannerList.length"
></a-divider>
<h2>
插件
</h2>
<a-list
item-layout=
"horizontal"
style=
"width: 100%"
:grid=
"
{ gutter: 16, column: 2 }"
:data-source="pluginList"
>
<a-list-item
slot=
"renderItem"
slot-scope=
"item, index"
>
<a-button
v-if=
"showButton(item) === 'download'"
:loading=
"loading[index]"
type=
"link"
slot=
"actions"
@
click=
"download(index, item)"
>
<a-icon
v-show=
"!loading[index]"
style=
"font-size: 20px"
type=
"cloud-download"
/>
</a-button>
<a-button
v-if=
"showButton(item) === 'update'"
:loading=
"loading[index]"
type=
"link"
slot=
"actions"
@
click=
"update(index, item)"
>
<a-icon
v-show=
"!loading[index]"
style=
"font-size: 20px; color: #409eff"
type=
"sync"
/>
</a-button>
<a-list-item-meta
<a-list-item-meta
@
click=
"showPannel(item, index)"
@
click=
"showPannel(item, index)"
:description=
"item.description"
:description=
"item.description"
>
>
<div
slot=
"title"
>
{{
item
.
pluginName
}}
</div>
<div
slot=
"title"
>
{{
item
.
pluginName
}}
</div>
<a-avatar
slot=
"avatar"
:src=
"item.logo"
/>
<a-avatar
slot=
"avatar"
:src=
"item.logo"
/>
</a-list-item-meta>
</a-list-item-meta>
</a-list-item>
</a-list-item>
</a-list>
</a-list>
</div>
<a-drawer
<a-drawer
placement=
"right"
placement=
"right"
:visible=
"show"
:visible=
"show"
...
@@ -119,20 +131,35 @@ const rendererMD = new marked.Renderer();
...
@@ -119,20 +131,35 @@ const rendererMD = new marked.Renderer();
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
menu
:
[],
pluginList
:
[],
pluginList
:
[],
loading
:
{},
loading
:
{},
bannerList
:
[],
bannerList
:
[],
show
:
false
,
show
:
false
,
selectedMenu
:
[],
icon
:
[
"
calculator
"
,
"
tool
"
,
"
build
"
],
currentSelect
:
{}
currentSelect
:
{}
};
};
},
},
async
created
()
{
async
created
()
{
this
.
get
Plugins
();
this
.
get
Menu
();
// this.bannerList = bannerRes.result;
// this.bannerList = bannerRes.result;
},
},
methods
:
{
methods
:
{
getPlugins
()
{
getMenu
()
{
api
.
getPlugins
().
then
(
async
({
data
:
res
})
=>
{
api
.
getMenu
().
then
(
async
({
data
:
res
})
=>
{
if
(
!
res
.
length
)
return
;
this
.
menu
=
res
;
const
firstItem
=
res
[
0
];
this
.
selectedMenu
=
[
firstItem
.
id
];
this
.
getPlugins
({
item
:
{
value
:
firstItem
.
path
}
});
});
},
getPlugins
({
item
})
{
console
.
log
(
item
);
const
path
=
encodeURIComponent
(
item
.
value
);
api
.
getPlugins
(
path
).
then
(
async
({
data
:
res
})
=>
{
this
.
pluginList
=
[];
res
.
forEach
(
async
plugin
=>
{
res
.
forEach
(
async
plugin
=>
{
const
pluginItem
=
await
this
.
getPluginDetail
(
plugin
.
name
);
const
pluginItem
=
await
this
.
getPluginDetail
(
plugin
.
name
);
this
.
pluginList
.
push
(
pluginItem
);
this
.
pluginList
.
push
(
pluginItem
);
...
@@ -140,20 +167,17 @@ export default {
...
@@ -140,20 +167,17 @@ export default {
});
});
},
},
async
getPluginDetail
(
name
)
{
async
getPluginDetail
(
name
)
{
const
{
const
{
data
:
plugin
}
=
await
api
.
getPluginDetail
(
name
);
data
:
plugin
}
=
await
api
.
getPluginDetail
(
name
);
if
(
plugin
.
detail
&&
isMdFile
(
plugin
.
detail
))
{
if
(
plugin
.
detail
&&
isMdFile
(
plugin
.
detail
))
{
const
{
readme
}
=
await
axios
.
get
(
const
{
readme
}
=
await
api
.
getReadme
(
plugin
);
`https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/
${
plugin
.
name
}
/
${
plugin
.
detail
}
`
);
plugin
.
readme
=
readme
;
plugin
.
readme
=
readme
;
}
else
{
}
else
{
plugin
.
readme
=
plugin
.
detail
;
plugin
.
readme
=
plugin
.
detail
;
}
}
plugin
.
logo
=
`https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/
${
plugin
.
name
}
/
${
plugin
.
logo
}
`
;
plugin
.
logo
=
api
.
getLogo
(
plugin
)
;
// plugin.logo = `https://gitcode.net/weixin_43881430/quicker-market/-/raw/master/plugins/${plugin.name}/${logo}`;
// plugin.logo = `https://gitcode.net/weixin_43881430/quicker-market/-/raw/master/plugins/${plugin.name}/${logo}`;
plugin
.
downloadUrl
=
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/archive.zip?path=plugins%2F
${
plugin
.
name
}
`
;
plugin
.
downloadUrl
=
api
.
getDownloadUrl
(
plugin
);
// plugin.downloadUrl = `https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/archive.zip?path=plugins%2F${plugin.name}`;
// plugin.downloadUrl =
// plugin.downloadUrl =
// "https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip";
// "https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip";
...
@@ -275,9 +299,17 @@ export default {
...
@@ -275,9 +299,17 @@ export default {
.market {
.market {
height: calc(~"100vh - 110px");
height: calc(~"100vh - 110px");
background: #fff;
background: #fff;
padding: 20px;
box-sizing: border-box;
box-sizing: border-box;
overflow: auto;
overflow: auto;
display: flex;
.ant-menu {
width: 220px;
}
.market-content {
flex: 1;
padding: 20px;
box-sizing: border-box;
}
.ant-carousel .slick-slide {
.ant-carousel .slick-slide {
text-align: center;
text-align: center;
height: 235px;
height: 235px;
...
@@ -318,5 +350,8 @@ export default {
...
@@ -318,5 +350,8 @@ export default {
text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
white-space: nowrap;
}
}
.ant-list-item-action {
margin-left: 0;
}
}
}
</
style
>
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录