Skip to content

Commit

Permalink
CI 流程优化
Browse files Browse the repository at this point in the history
♿ 追加了一些统计信息: 点击打开 GitHub, 点击打开 blog, 切换面板主题, 切换主体色, 发送消息; 所有统计只计次, 不上传其他内容
👷 给 pr 增加了 lint action
  • Loading branch information
Stapxs committed Jul 19, 2024
1 parent e3e0b4c commit f4f639e
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 19 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ jobs:
fi
# 获取版本号
echo VERSION=$(node -p "require('./package.json').version") >> $GITHUB_OUTPUT
# 设置 Node.js 版本
- name: Load Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
# 更新依赖
- name: Install
run: yarn
# 代码检查
- name: Lint
run: yarn lint
# ========================= 构建 Web 版本 =========================
build-pages:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 在主分支上构建
name: lint
on:
pull_request: # PR 触发
branches:
- next

jobs:
lint:
runs-on: ubuntu-latest
steps:
# 拉取代码
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
# 设置 Node.js 版本
- name: Load Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
# 更新依赖
- name: Install
run: yarn
# 代码检查
- name: Lint
run: yarn lint
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stapxs-qq-lite",
"version": "2.7.17",
"version": "2.7.18",
"private": false,
"author": "Stapx Steve [林槐]",
"description": "一个兼容 OneBot 的非官方网页版 QQ 客户端,使用 Vue 重制的全新版本。",
Expand Down
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ export default defineComponent({
this.tags.page = view
},
barMainClick() {
console.log(1111)
if(loginInfo.status) {
this.changeTab('信息', 'Messages', false)
} else {
Expand Down
22 changes: 18 additions & 4 deletions src/components/AboutPan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
<span style="text-align: center;">{{ $t('description') }}</span>
<a>v{{ packageInfo.version }}</a>
<div class="buttons">
<a class="ss-button" @click="openLink('https://github.com/Stapxs/Stapxs-QQ-Lite-2.0')">{{
<a class="ss-button" @click="goGithub()">{{
$t('option_info_visit_github') }}</a>
<a class="ss-button" style="width: 30px;" @click="openLink('https://blog.stapxs.cn/About.html')">
<a class="ss-button" style="width: 30px;" @click="goBlog()">
<font-awesome-icon :icon="['fas', 'circle-info']"/>
</a>
</div>
Expand Down Expand Up @@ -127,12 +127,14 @@
</template>

<script lang="ts">
import Umami from '@stapxs/umami-logger-typescript'
import DepPan from './DepPan.vue'
import packageInfo from '../../package.json'

import { defineComponent } from 'vue'
import { openLink } from '@/function/utils/appUtil'
import { ContributorElem } from '@/function/elements/system'

import DepPan from './DepPan.vue'
import packageInfo from '../../package.json'
import { runtimeData } from '@/function/msg'

export default defineComponent({
Expand All @@ -158,6 +160,18 @@ export default defineComponent({
template: DepPan
}
runtimeData.popBoxList.push(popInfo)
},

goGithub() {
openLink('https://github.com/Stapxs/Stapxs-QQ-Lite-2.0')
// UM:统计点击事件
Umami.trackEvent('click_statistics', { name: 'visit_github' })
},

goBlog() {
openLink('https://blog.stapxs.cn/About.html')
// UM:统计点击事件
Umami.trackEvent('click_statistics', { name: 'visit_blog' })
}
},
mounted() {
Expand Down
3 changes: 3 additions & 0 deletions src/function/utils/msgUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { runtimeData } from '@/function/msg'
import { v4 as uuid } from 'uuid'
import { Connector } from '@/function/connect'
import { BotMsgType } from '../elements/information'
import Umami from '@stapxs/umami-logger-typescript'

const logger = new Logger()

Expand Down Expand Up @@ -397,5 +398,7 @@ export function sendMsgRaw(id: string, type: string, msg: string | { type: strin
break
}
}
// UM:统计消息发送次数
Umami.trackEvent('sendMsg', { type: type })
}
}
18 changes: 16 additions & 2 deletions src/pages/options/OptView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</div>
<div class="theme-color-col">
<label v-for="(name, index) in colors" :title="name" :key="'color_id_' + index" class="ss-radio">
<input type="radio" name="theme_color" @change="save" :data-id="index"
<input type="radio" name="theme_color" @change="save($event); gaColor($event)" :data-id="index"
:checked="runtimeData.sysConfig.theme_color === undefined ? index === 0 : Number(runtimeData.sysConfig.theme_color) === index">
<div :style="'background: var(--color-main-' + index + ');'">
<div></div>
Expand Down Expand Up @@ -116,7 +116,7 @@
<span>{{ $t('option_dev_chatview_name') }}</span>
<span>{{ $t('option_dev_chatview_name_tip') }}</span>
</div>
<select @change="save" name="chatview_name" title="chatview_name" v-model="chatview_name">
<select @change="save($event); gaChatView($event)" name="chatview_name" title="chatview_name" v-model="chatview_name">
<option value="">{{ $t('option_dev_chatview_name_none') }}</option>
<option v-for="item in getAppendChatView()" :value="item" :key="item">{{ item.replace('Chat', '') }}</option>
</select>
Expand Down Expand Up @@ -217,6 +217,18 @@ export default defineComponent({
Umami.trackEvent('use_language', { name: sender.value })
},

gaChatView(event: Event) {
const sender = event.target as HTMLInputElement
// UM:上传Chat View 选择
Umami.trackEvent('use_chatview', { name: sender.value })
},

gaColor(event: Event) {
const sender = event.target as HTMLInputElement
// UM:上传主题颜色选择
Umami.trackEvent('use_theme_color', { name: this.colors[Number(sender.dataset.id)] })
},

setInitialScaleShow(event: Event) {
const sender = event.target as HTMLInputElement
this.initialScaleShow = Number(sender.value)
Expand Down Expand Up @@ -245,6 +257,8 @@ export default defineComponent({
sender.checked = false
} else {
baseApp.classList.add('no-touch')
// UM:上传禁用触摸(彩蛋)的选择
Umami.trackEvent('click_statistics', { name: 'touch_randomly' })
}
}
},
Expand Down

0 comments on commit f4f639e

Please sign in to comment.