Skip to content

Commit

Permalink
代码格式调整:*.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Nov 15, 2024
1 parent edb9f03 commit 572caf0
Show file tree
Hide file tree
Showing 17 changed files with 1,160 additions and 1,094 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/modules/plugin/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const NodePlugin = function (context) {

const cmds = []
for (const item of list) {
if (item.value != null && item.value.length > 0 && item.value !== 'null') {
if (item.value != null && item.value.length > 0 && item.value !== 'default') {
cmds.push(`${command} config set ${item.key} ${item.value}`)
} else {
cmds.push(`${command} config delete ${item.key}`)
Expand All @@ -68,7 +68,7 @@ const NodePlugin = function (context) {
const cmds = []
log.debug('yarn set:', JSON.stringify(list))
for (const item of list) {
if (item.value != null && item.value.length > 0 && item.value !== 'null') {
if (item.value != null && item.value.length > 0 && item.value !== 'default') {
cmds.push(`yarn config set ${item.key} ${item.value}`)
} else {
cmds.push(`yarn config delete ${item.key}`)
Expand Down
4 changes: 2 additions & 2 deletions packages/gui/src/bridge/update/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function install (app, api) {
return (
<div>
<div>发布公告:<a onClick={openGithubUrl}>https://github.com/docmirror/dev-sidecar/releases</a></div>
<hr/>
<hr>
<pre style="max-height:350px;font-family:auto">
{releaseNotes}
</pre>
Expand Down Expand Up @@ -201,7 +201,7 @@ function install (app, api) {
return (
<div>
<div>发布公告:<a onClick={openGithubUrl}>https://github.com/docmirror/dev-sidecar/releases</a></div>
<hr/>
<hr>
<pre style="max-height:350px;font-family:auto">
{releaseNotes}
</pre>
Expand Down
97 changes: 49 additions & 48 deletions packages/gui/src/view/App.vue
Original file line number Diff line number Diff line change
@@ -1,49 +1,7 @@
<template>
<a-config-provider :locale="locale">
<div class="ds_layout" :class="themeClass">
<a-layout>
<a-layout-sider :theme="theme">
<div class="logo"></div>
<div class="aside">
<a-menu
mode="inline"
:defaultSelectedKeys="[$route.fullPath]"
:defaultOpenKeys="['/plugin']"
>
<template v-for="(item) of menus">
<a-sub-menu v-if="item.children && item.children.length>0" :key="item.path" @titleClick="titleClick(item)">
<span slot="title"><a-icon :type="item.icon?item.icon:'file'"/><span>{{item.title}}</span></span>
<a-menu-item v-for="(sub) of item.children" :key="sub.path" @click="menuClick(sub)">
<a-icon :type="sub.icon?sub.icon:'file'"/> {{ sub.title }}
</a-menu-item>
</a-sub-menu>
<a-menu-item v-else :key="item.path" @click="menuClick(item)">
<a-icon :type="item.icon?item.icon:'file'"/>
<span class="nav-text">{{ item.title }}</span>
</a-menu-item>
</template>
</a-menu>
</div>
</a-layout-sider>
<a-layout>
<!-- <a-layout-header>Header</a-layout-header>-->
<a-layout-content>
<router-view></router-view>
</a-layout-content>
<a-layout-footer>
<div class="footer">
©2020-2024 docmirror.cn by Greper, WangLiang <span>{{info.version}}</span>
</div>
</a-layout-footer>
</a-layout>
</a-layout>
</div>
</a-config-provider>
</template>

<script>
import createMenus from '@/view/router/menu'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default {
name: 'App',
components: {
Expand All @@ -53,12 +11,12 @@ export default {
locale: zhCN,
info: {},
menus: undefined,
config: undefined
config: undefined,
}
},
computed: {
themeClass () {
return 'theme-' + this.config.app.theme
return `theme-${this.config.app.theme}`
},
theme () {
return this.config.app.theme
Expand All @@ -67,7 +25,7 @@ export default {
created () {
this.menus = createMenus(this)
this.config = this.$global.config
this.$api.info.get().then(ret => {
this.$api.info.get().then((ret) => {
this.info = ret
})
},
Expand All @@ -81,11 +39,54 @@ export default {
menuClick (item) {
console.log('menu click', item)
this.$router.replace(item.path)
}
}
},
},
}
</script>

<template>
<a-config-provider :locale="locale">
<div class="ds_layout" :class="themeClass">
<a-layout>
<a-layout-sider :theme="theme">
<div class="logo" />
<div class="aside">
<a-menu
mode="inline"
:default-selected-keys="[$route.fullPath]"
:default-open-keys="['/plugin']"
>
<template v-for="(item) of menus">
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.path" @titleClick="titleClick(item)">
<span slot="title"><a-icon :type="item.icon ? item.icon : 'file'" /><span>{{ item.title }}</span></span>
<a-menu-item v-for="(sub) of item.children" :key="sub.path" @click="menuClick(sub)">
<a-icon :type="sub.icon ? sub.icon : 'file'" /> {{ sub.title }}
</a-menu-item>
</a-sub-menu>
<a-menu-item v-else :key="item.path" @click="menuClick(item)">
<a-icon :type="item.icon ? item.icon : 'file'" />
<span class="nav-text">{{ item.title }}</span>
</a-menu-item>
</template>
</a-menu>
</div>
</a-layout-sider>
<a-layout>
<!-- <a-layout-header>Header</a-layout-header> -->
<a-layout-content>
<router-view />
</a-layout-content>
<a-layout-footer>
<div class="footer">
©2020-2024 docmirror.cn by Greper, WangLiang <span>{{ info.version }}</span>
</div>
</a-layout-footer>
</a-layout>
</a-layout>
</div>
</a-config-provider>
</template>

<style lang="scss">
body{
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion packages/gui/src/view/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function apiInit (app) {
})
}

return new Promise(resolve => {
return new Promise((resolve) => {
resolve(apiObj)
})
}
Expand Down
19 changes: 9 additions & 10 deletions packages/gui/src/view/components/container.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<script>
export default {
name: 'DsContainer',
}
</script>

<template>
<div class="ds-container">
<div class="body-wrapper">
<div v-if="$slots.header" class="container-header"><slot name="header"></slot></div>
<div class="container-body"> <slot></slot></div>
<div class="container-footer"> <slot name="footer"></slot></div>
<div v-if="$slots.header" class="container-header"><slot name="header" /></div>
<div class="container-body"><slot /></div>
<div class="container-footer"><slot name="footer" /></div>
</div>
</div>
</template>

<script>
export default {
name: 'ds-container'
}
</script>

<style lang="scss">
.ds-container{
height:100%;
Expand Down Expand Up @@ -49,5 +49,4 @@ export default {
padding:15px;
}
}
</style>
107 changes: 54 additions & 53 deletions packages/gui/src/view/components/setup-ca.vue
Original file line number Diff line number Diff line change
@@ -1,66 +1,23 @@
<template>
<a-drawer
placement="right"
:closable="false"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="660px"
height="100%"
:slots="{ title: 'title' }"
wrapClassName="json-wrapper"
>
<template slot="title">
{{title}}
<a-button type="primary" style="float:right" @click="doSetup()">点此去安装</a-button>
<a-button style="float:right;margin-right:10px;" @click="openExternal('https://github.com/docmirror/dev-sidecar/blob/master/doc/caroot.md')">为什么要安装证书?</a-button>
</template>
<div>
<b>本应用在非“安全模式”下必须安装和信任CA根证书</b>,该证书是应用启动时本地随机生成的<br/>

<template v-if="this.systemPlatform === 'mac'">
1、点击右上角“点此去安装按钮”,打开钥匙串,<b style="color:red">选择”系统“</b><br/>
2、然后按如下图步骤将随机生成的根证书设置为始终信任<br/>
3、可能需要重新启动应用和浏览器才能生效<br/>
4、注意:如果出现无法导入提示时,先点一下钥匙串的左边切换到<b style="color:red">“系统”栏</b>,然后再重新安装证书即可<br/>
</template>
<template v-else-if="this.systemPlatform === 'linux'">
1、点击右上角“点此去安装按钮”,将自动安装到系统证书库中<br/>
2、<b color="red">火狐、chrome等浏览器不走系统证书</b>,需要手动安装(下图以chrome为例安装根证书)<br/>
</template>
<template v-else>
1、点击右上角“点此去安装按钮”,打开证书<br/>
2、然后按如下图步骤将根证书添加到<b style="color:red">信任的根证书颁发机构</b>
</template>
</div>
<img width="100%" :src="setupImage"/>
</a-drawer>
</template>

<script>
export default {
name: 'setup-ca',
name: 'SetupCa',
components: {
},
props: {
title: {
type: String,
default: '安装根证书'
default: '安装根证书',
},
visible: {
type: Boolean
}
type: Boolean,
},
},
data () {
return {
systemPlatform: ''
systemPlatform: '',
}
},
async created () {
const platform = await this.$api.info.getSystemPlatform()
this.systemPlatform = platform
},
computed: {
setupImage () {
if (this.systemPlatform === 'mac') {
Expand All @@ -70,7 +27,11 @@ export default {
} else {
return '/setup.png'
}
}
},
},
async created () {
const platform = await this.$api.info.getSystemPlatform()
this.systemPlatform = platform
},
methods: {
async openExternal (url) {
Expand All @@ -89,10 +50,50 @@ export default {
if (this.systemPlatform === 'linux') {
this.$message.success('根证书已成功安装到系统证书库(注意:浏览器仍然需要手动安装)')
}
}
}
},
},
}
</script>

<style>
</style>
<template>
<a-drawer
placement="right"
:closable="false"
:visible="visible"
:after-visible-change="afterVisibleChange"
width="660px"
height="100%"
:slots="{ title: 'title' }"
wrap-class-name="json-wrapper"
@close="onClose"
>
<template slot="title">
{{ title }}
<a-button type="primary" style="float:right" @click="doSetup()">
点此去安装
</a-button>
<a-button style="float:right;margin-right:10px;" @click="openExternal('https://github.com/docmirror/dev-sidecar/blob/master/doc/caroot.md')">
为什么要安装证书?
</a-button>
</template>
<div>
<b>本应用在非“安全模式”下必须安装和信任CA根证书</b>,该证书是应用启动时本地随机生成的<br>

<template v-if="systemPlatform === 'mac'">
1、点击右上角“点此去安装按钮”,打开钥匙串,<b style="color:red">选择”系统“</b><br>
2、然后按如下图步骤将随机生成的根证书设置为始终信任<br>
3、可能需要重新启动应用和浏览器才能生效<br>
4、注意:如果出现无法导入提示时,先点一下钥匙串的左边切换到<b style="color:red">“系统”栏</b>,然后再重新安装证书即可<br>
</template>
<template v-else-if="systemPlatform === 'linux'">
1、点击右上角“点此去安装按钮”,将自动安装到系统证书库中<br>
2、<b color="red">火狐、chrome等浏览器不走系统证书</b>,需要手动安装(下图以chrome为例安装根证书)<br>
</template>
<template v-else>
1、点击右上角“点此去安装按钮”,打开证书<br>
2、然后按如下图步骤将根证书添加到<b style="color:red">信任的根证书颁发机构</b>
</template>
</div>
<img width="100%" :src="setupImage">
</a-drawer>
</template>
Loading

0 comments on commit 572caf0

Please sign in to comment.