Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 18 additions & 18 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: note build
# 触发workflow的条件
on:
push:
branches: ["doc-v2"]
branches: ["privatization-v3"]

env:
SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # 服务器私钥
Expand Down Expand Up @@ -45,22 +45,22 @@ jobs:
REMOTE_HOST: ${{ secrets.SERVER_HOST }}
REMOTE_PORT: ${{ secrets.SERVER_PORT }} -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa
REMOTE_USER: ${{ secrets.SERVER_USER_NAME }}
TARGET: /data/apps/data/docs-im-beta/ # 服务器目标路径
TARGET: /data/apps/data/privatization-doc-v3/ # 服务器目标路径

- name: CDN Refresh HTTPS
uses: weirui88888/aliyun-cdn-sdk@v1.0.2
env:
ttl_config: '{"action": "RefreshObjectCaches", "ObjectPath": "https://doc.easemob.com/", "ObjectType": "Directory" }'
with:
accessKeyId: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_ID }}
accessKeySecret: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_SECRET }}
parameters: ${{env.ttl_config}}
# - name: CDN Refresh HTTPS
# uses: weirui88888/aliyun-cdn-sdk@v1.0.2
# env:
# ttl_config: '{"action": "RefreshObjectCaches", "ObjectPath": "https://doc.easemob.com/", "ObjectType": "Directory" }'
# with:
# accessKeyId: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_ID }}
# accessKeySecret: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_SECRET }}
# parameters: ${{env.ttl_config}}

- name: CDN Refresh HTTP
uses: weirui88888/aliyun-cdn-sdk@v1.0.2
env:
ttl_config: '{"action": "RefreshObjectCaches", "ObjectPath": "http://doc.easemob.com/", "ObjectType": "Directory" }'
with:
accessKeyId: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_ID }}
accessKeySecret: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_SECRET }}
parameters: ${{env.ttl_config}}
# - name: CDN Refresh HTTP
# uses: weirui88888/aliyun-cdn-sdk@v1.0.2
# env:
# ttl_config: '{"action": "RefreshObjectCaches", "ObjectPath": "http://doc.easemob.com/", "ObjectType": "Directory" }'
# with:
# accessKeyId: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_ID }}
# accessKeySecret: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_SECRET }}
# parameters: ${{env.ttl_config}}
2 changes: 1 addition & 1 deletion docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default defineClientConfig({
app.component('DemoCard', DemoCard)

if (typeof window !== "undefined") {
embedChatbot();
//embedChatbot();
}
},
setup() {},
Expand Down
165 changes: 165 additions & 0 deletions docs/.vuepress/components/CallKitSwitch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<script lang="ts" setup>
import { ref, watch, computed } from "vue";
import { useRoute, useRouter } from "vue-router";

const PLATFORM_ICON_MAP = {
android: {
icon: "/icon-Android.svg",
activeIcon: "/icon-Android-hover.svg"
},
ios: {
icon: "/icon-iOS.svg",
activeIcon: "/icon-iOS-hover.svg"
},
web: {
icon: "/icon-web.svg",
activeIcon: "/icon-web-hover.png"
},
harmonyos: {
icon: "/icon-harmonyos.svg",
activeIcon: "/icon-harmonyos-hover.svg"
},
windows: {
icon: "/icon-windows.svg",
activeIcon: "/icon-windows-hover.svg"
},
["react-native"]: {
icon: "/icon-ReactNative.svg",
activeIcon: "/icon-ReactNative-hover.svg"
},
flutter: {
icon: "/icon-flutter.svg",
activeIcon: "/icon-flutter-hover.png"
},
unity: {
icon: "/icon-unity.svg",
activeIcon: "/icon-unity-hover.svg"
},
uniapp: {
icon: "/icon-uni-app.svg",
activeIcon: "/icon-uni-app.svg"
},
applet: {
icon: "/icon-mini-program.svg",
activeIcon: "/icon-mini-program-hover.svg"
},
["server-side"]: {
icon: "/icon-platform.svg",
activeIcon: "/icon-platform-hover.svg"
}
};

const options = [
{
label: "平台",
options: [
{
value: "android",
label: "Android"
},
{
value: "ios",
label: "iOS"
},
{
value: "web",
label: "Web"
}
]
}
];

const platform = ref("android");
const platformIcon = computed(
() => PLATFORM_ICON_MAP[platform.value]?.activeIcon
);
const route = useRoute();
const router = useRouter();
watch(
() => route.path,
() => {
if (route.path.indexOf("/callkit") == 0) {
const splitRoute = route.path.split("/");
platform.value = splitRoute[2];
}
},
{ immediate: true }
);

// 切换平台,如果有相同路径的route就直接跳转
const onChange = (platform) => {
const nextPlatformDocRouters = router.options.routes
.filter(
(item) =>
item.hasOwnProperty("name") &&
item?.path.indexOf(`/callkit/${platform}`) == 0
)
.map((item) => item.path);

let newPath = route.path.split("/");
newPath[2] = platform;
const nextPathPath = newPath.join("/");

if (nextPlatformDocRouters.indexOf(nextPathPath) > -1) {
router.push(nextPathPath);
} else {
router.push(`/callkit/${platform}/product_overview.html`);
}
};
</script>

<template>
<el-select v-model="platform" @change="onChange" placeholder="请选择">
<template #prefix>
<img width="20" height="20" :src="platformIcon" />
</template>
<el-option-group
v-for="group in options"
:key="group.label"
:label="group.label"
>
<el-option
v-for="item in group.options"
:key="item.value"
:label="item.label"
:value="item.value"
class="option-content"
>
<span class="label-icon">
<img
class="default"
width="20"
height="20"
:src="PLATFORM_ICON_MAP[item.value]?.icon"
/>
<img
class="active"
width="20"
height="20"
:src="PLATFORM_ICON_MAP[item.value]?.activeIcon"
/>
</span>
<span>{{ item.label }}</span>
</el-option>
</el-option-group>
</el-select>
</template>

<style lang="scss" scope>
.option-content:hover .default {
display: none;
}

.option-content .active {
display: none;
}

.option-content:hover .active {
display: inline-block;
}

.label-icon {
vertical-align: sub;
padding-right: 5px;
}
</style>
2 changes: 1 addition & 1 deletion docs/.vuepress/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<HopeHomePage>
<template #center>
<div class="main-container">
<HeroSection />
<!-- <HeroSection /> -->
<main :ref="containerRef" class="main-content">
<div class="toc">
<ClientOnly>
Expand Down
9 changes: 5 additions & 4 deletions docs/.vuepress/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const extraNavList = themeData.value.extra_nav || [];
<Navbar>
<template #endBefore>
<!-- <Docsearch /> -->
<div class="search-box" @click="handleSearch">
<!-- <div class="search-box" @click="handleSearch">
<div class="search-input-wrapper">
<div class="search-icon">
<svg
Expand All @@ -31,20 +31,21 @@ const extraNavList = themeData.value.extra_nav || [];
</div>
<div class="search-input">Search</div>
</div>
</div>
</div> -->

<el-link
<!-- <el-link
class="extra-link"
:type="item.type"
v-for="item in extraNavList"
:key="item.text"
:href="item.link"
>{{ item.text }}
</el-link>
</el-link> -->
</template>
</Navbar>
</template>


<script>
export default {
methods: {
Expand Down
8 changes: 4 additions & 4 deletions docs/.vuepress/components/PlatformSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ const options = [
value: 'windows',
label: 'Windows',
},
{
/**{
value: 'linux',
label: 'Linux',
},
},**/
],
},
{
Expand All @@ -134,10 +134,10 @@ const options = [
value: 'applet',
label: '小程序',
},
{
/**{
value: 'electron',
label: 'Electron',
},
},**/
],
},
{
Expand Down
8 changes: 8 additions & 0 deletions docs/.vuepress/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
import PlatformSwitch from './PlatformSwitch.vue'
import PrivateSwitch from './PrivateSwitch.vue'
import UIKitSwitch from './UIKitSwitch.vue'
import CallKitSwitch from './CallKitSwitch.vue'
import { usePageData } from '@vuepress/client'
import { ref, watch } from 'vue'

const pageData = usePageData()
const showPlatformSwitch = ref(false)
const showPrivateSwitch = ref(false)
const showUIKitSwitch = ref(false)
const showCallKitSwitch = ref(false)
watch(pageData, ()=> {
const pagePath = pageData.value.path
showPrivateSwitch.value = pagePath.indexOf('/private/') == 0
showPlatformSwitch.value = pagePath.indexOf('/document/') == 0
showUIKitSwitch.value = pagePath.indexOf('/uikit/') == 0
showCallKitSwitch.value = pagePath.indexOf('/callkit/') == 0
}, {immediate:true})


Expand All @@ -37,6 +40,11 @@
<UIKitSwitch />
</ClientOnly>
</div>
<div v-show="showCallKitSwitch" class="platform-switch">
<ClientOnly>
<CallKitSwitch />
</ClientOnly>
</div>
</template>
</Sidebar>
</template>
Expand Down
Loading