mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-22 01:48:40 +00:00
数据埋点
This commit is contained in:
parent
1907e59ba1
commit
7ff2613309
@ -38,6 +38,9 @@ const manifest: CocosPluginManifest = {
|
|||||||
icon: {
|
icon: {
|
||||||
"48": "./icons/48.png",
|
"48": "./icons/48.png",
|
||||||
},
|
},
|
||||||
|
analysis: {
|
||||||
|
// googleAnalytics: "G-0S2X4Z1FE7",
|
||||||
|
},
|
||||||
chrome: {
|
chrome: {
|
||||||
version: 3,
|
version: 3,
|
||||||
pem: "./crx-key.pem",
|
pem: "./crx-key.pem",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"author": "cc-plugin",
|
"author": "cc-plugin",
|
||||||
"description": "cocos creator plugin",
|
"description": "cocos creator plugin",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chrome": "0.0.133",
|
"@types/chrome": "0.0.293",
|
||||||
"@types/fs-extra": "9.0.1",
|
"@types/fs-extra": "9.0.1",
|
||||||
"@types/kind-of": "^6.0.0",
|
"@types/kind-of": "^6.0.0",
|
||||||
"@types/lodash": "^4.14.176",
|
"@types/lodash": "^4.14.176",
|
||||||
|
63
cc-inspector/src/ga/index.ts
Normal file
63
cc-inspector/src/ga/index.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import { GA_Button, GA_EventName, MeasurementBody } from "./type";
|
||||||
|
|
||||||
|
const API_SECRET = "_yU7eNTgT4Khe2Jo22Ki_g";
|
||||||
|
const MEASUREMENT_ID = "G-RW7J0JZ6T5";
|
||||||
|
const GA_ENDPOINT = "https://www.google-analytics.com/mp/collect";
|
||||||
|
|
||||||
|
export class GoogleAnalytics {
|
||||||
|
async getOrCreateSessionId() {
|
||||||
|
const result = await chrome.storage.local.get("clientId");
|
||||||
|
let clientId = result.clientId;
|
||||||
|
if (!clientId) {
|
||||||
|
clientId = self.crypto.randomUUID();
|
||||||
|
await chrome.storage.local.set({ clientId });
|
||||||
|
}
|
||||||
|
return clientId;
|
||||||
|
}
|
||||||
|
public async fireEventWithParam(name: GA_EventName, param: string) {
|
||||||
|
const time = Date.now();
|
||||||
|
const id = await this.getOrCreateSessionId();
|
||||||
|
fetch(`${GA_ENDPOINT}?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_id: id,
|
||||||
|
events: [
|
||||||
|
{
|
||||||
|
name: name,
|
||||||
|
params: {
|
||||||
|
id: param,
|
||||||
|
session_id: time.toString(),
|
||||||
|
engagement_time_msec: time.toString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as MeasurementBody),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public async fireEvent(name: string) {
|
||||||
|
const time = Date.now();
|
||||||
|
const id = await this.getOrCreateSessionId();
|
||||||
|
fetch(`${GA_ENDPOINT}?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_id: id,
|
||||||
|
events: [
|
||||||
|
{
|
||||||
|
name: name,
|
||||||
|
params: {
|
||||||
|
session_id: time.toString(),
|
||||||
|
engagement_time_msec: time.toString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as MeasurementBody),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async clickButton(btn: GA_Button) {
|
||||||
|
await this.fireEventWithParam(GA_EventName.ButtonClicked, btn);
|
||||||
|
}
|
||||||
|
async openView(view: string) {
|
||||||
|
await this.fireEventWithParam(GA_EventName.PageView, view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const ga = new GoogleAnalytics();
|
89
cc-inspector/src/ga/type.ts
Normal file
89
cc-inspector/src/ga/type.ts
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/**
|
||||||
|
* 发送的消息数据结构
|
||||||
|
*
|
||||||
|
* @doc https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?hl=zh-cn&client_type=gtag#payload_post_body
|
||||||
|
* @github https://github.dev/GoogleChrome/chrome-extensions-samples/blob/main/functional-samples/tutorial.google-analytics/scripts/google-analytics.js#L69
|
||||||
|
*/
|
||||||
|
export interface MeasurementBody {
|
||||||
|
/**
|
||||||
|
* 用户的ID,用于标识用户
|
||||||
|
*/
|
||||||
|
client_id: string;
|
||||||
|
/**
|
||||||
|
* 用户的唯一标识,只能包含 utf-8 字符。
|
||||||
|
*/
|
||||||
|
user_id?: string;
|
||||||
|
/**
|
||||||
|
* 事件相关联的时间的 UNIX 时间戳,此值应仅设置为记录过去发生的事件。
|
||||||
|
*/
|
||||||
|
timestamp_micros?: number;
|
||||||
|
/**
|
||||||
|
* 用户属性用于描述用户群细分,例如语言偏好设置或地理位置。
|
||||||
|
*
|
||||||
|
* @doc https://developers.google.com/analytics/devguides/collection/protocol/ga4/user-properties?hl=zh-cn&client_type=gtag
|
||||||
|
*/
|
||||||
|
user_properties?: Object;
|
||||||
|
/**
|
||||||
|
* 用户提供的数据。
|
||||||
|
*
|
||||||
|
*@doc https://developers.google.com/analytics/devguides/collection/ga4/uid-data?hl=zh-cn
|
||||||
|
*/
|
||||||
|
user_data?: Object;
|
||||||
|
/**
|
||||||
|
* 设置请求的用户意见征求设置。
|
||||||
|
* @doc https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?hl=zh-cn&client_type=gtag#payload_consent
|
||||||
|
*/
|
||||||
|
consent?: Object;
|
||||||
|
/**
|
||||||
|
* 每个请求最多可以发送 25 个事件
|
||||||
|
*/
|
||||||
|
events?: MeasurementEvent[];
|
||||||
|
}
|
||||||
|
export interface MeasurementEvent {
|
||||||
|
/**
|
||||||
|
* 事件的名称。
|
||||||
|
*
|
||||||
|
* Google提供的事件: https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events?hl=zh-cn#add_payment_info
|
||||||
|
* 预留的事件名:https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?hl=zh-cn&client_type=gtag#reserved_event_names
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* 预留的参数名:https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?hl=zh-cn&client_type=gtag#reserved_parameter_names
|
||||||
|
*/
|
||||||
|
params?: {
|
||||||
|
[key: string]: any;
|
||||||
|
/**
|
||||||
|
* 在实时报告中查看事件,需要该参数
|
||||||
|
*/
|
||||||
|
session_id?: string;
|
||||||
|
/**
|
||||||
|
* 事件的互动时长(以毫秒为单位)
|
||||||
|
*/
|
||||||
|
engagement_time_msec?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface GA_Event_PageView extends MeasurementEvent {
|
||||||
|
name: "page_view";
|
||||||
|
params: {
|
||||||
|
page_title: string;
|
||||||
|
page_location: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum GA_EventName {
|
||||||
|
ButtonClicked = "button_clicked",
|
||||||
|
PageView = "page_view",
|
||||||
|
SpaceVisible = "space_visible",
|
||||||
|
MouseMenu = "mouse_menu",
|
||||||
|
Hierarchy = "hierarchy",
|
||||||
|
Inspector = "Inspector",
|
||||||
|
}
|
||||||
|
export enum GA_Button {
|
||||||
|
Github = "github",
|
||||||
|
Issues = "issues",
|
||||||
|
QQ = "qq",
|
||||||
|
/**
|
||||||
|
* 当页面不支持cocos时,用户手动点击了刷新
|
||||||
|
*/
|
||||||
|
FreshManual = "fresh-manual",
|
||||||
|
}
|
@ -10,6 +10,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref } from "vue";
|
||||||
import { Msg, PluginEvent, ResponseSupportData } from "../../core/types";
|
import { Msg, PluginEvent, ResponseSupportData } from "../../core/types";
|
||||||
|
import { ga } from "../../ga";
|
||||||
|
import { GA_Button } from "../../ga/type";
|
||||||
import { bridge } from "./bridge";
|
import { bridge } from "./bridge";
|
||||||
import { checkSupport } from "./util";
|
import { checkSupport } from "./util";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@ -28,6 +30,7 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
msg,
|
msg,
|
||||||
onBtnClickUpdatePage() {
|
onBtnClickUpdatePage() {
|
||||||
|
ga.clickButton(GA_Button.FreshManual);
|
||||||
checkSupport();
|
checkSupport();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -17,6 +17,8 @@ import Mousetrap, { MousetrapInstance } from "mousetrap";
|
|||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { defineComponent, nextTick, onMounted, onUnmounted, ref, toRaw, watch } from "vue";
|
import { defineComponent, nextTick, onMounted, onUnmounted, ref, toRaw, watch } from "vue";
|
||||||
import { Msg, PluginEvent, RequestTreeInfoData, RequestUseFrameData, ResponseSetPropertyData } from "../../core/types";
|
import { Msg, PluginEvent, RequestTreeInfoData, RequestUseFrameData, ResponseSetPropertyData } from "../../core/types";
|
||||||
|
import { ga } from "../../ga";
|
||||||
|
import { GA_EventName } from "../../ga/type";
|
||||||
import { bridge } from "./bridge";
|
import { bridge } from "./bridge";
|
||||||
import { Bus, BusMsg } from "./bus";
|
import { Bus, BusMsg } from "./bus";
|
||||||
import { EngineData, TreeData } from "./data";
|
import { EngineData, TreeData } from "./data";
|
||||||
@ -43,6 +45,7 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
let ins: MousetrapInstance | null = null;
|
let ins: MousetrapInstance | null = null;
|
||||||
function onQuickVisible() {
|
function onQuickVisible() {
|
||||||
|
ga.fireEvent(GA_EventName.SpaceVisible);
|
||||||
console.log("onQuickVisible");
|
console.log("onQuickVisible");
|
||||||
if (selectedUUID) {
|
if (selectedUUID) {
|
||||||
bridge.send(Msg.RequestVisible, selectedUUID);
|
bridge.send(Msg.RequestVisible, selectedUUID);
|
||||||
@ -160,10 +163,12 @@ export default defineComponent({
|
|||||||
onNodeExpand(data: TreeData) {
|
onNodeExpand(data: TreeData) {
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
expandedKeys.value.push(data.id);
|
expandedKeys.value.push(data.id);
|
||||||
|
ga.fireEventWithParam(GA_EventName.Hierarchy, "node expand");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onNodeCollapse(data: TreeData) {
|
onNodeCollapse(data: TreeData) {
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
|
ga.fireEventWithParam(GA_EventName.Hierarchy, "node collapse");
|
||||||
const keys = toRaw(expandedKeys.value);
|
const keys = toRaw(expandedKeys.value);
|
||||||
const index = keys.findIndex((el) => el === data.id);
|
const index = keys.findIndex((el) => el === data.id);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
@ -191,6 +196,7 @@ export default defineComponent({
|
|||||||
name: "update hierarchy",
|
name: "update hierarchy",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, "update hierarchy");
|
||||||
updateTree();
|
updateTree();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -199,6 +205,7 @@ export default defineComponent({
|
|||||||
name: "visible (sapce)",
|
name: "visible (sapce)",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, "visible");
|
||||||
onQuickVisible();
|
onQuickVisible();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -206,6 +213,7 @@ export default defineComponent({
|
|||||||
name: "destroy",
|
name: "destroy",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, "destroy");
|
||||||
bridge.send(Msg.RequestDestroy, selectedUUID);
|
bridge.send(Msg.RequestDestroy, selectedUUID);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -29,7 +29,9 @@ import { Option } from "@xuyanfeng/cc-ui/types/cc-select/const";
|
|||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { defineComponent, onMounted, onUnmounted, ref, toRaw } from "vue";
|
import { defineComponent, onMounted, onUnmounted, ref, toRaw } from "vue";
|
||||||
import PluginConfig from "../../../cc-plugin.config";
|
import PluginConfig from "../../../cc-plugin.config";
|
||||||
import { Msg, PluginEvent, RequestUseFrameData, ResponseSupportData, ResponseUseFrameData } from "../../core/types";
|
import { Msg, Page, PluginEvent, RequestUseFrameData, ResponseSupportData, ResponseUseFrameData } from "../../core/types";
|
||||||
|
import { ga } from "../../ga";
|
||||||
|
import { GA_Button } from "../../ga/type";
|
||||||
import { bridge } from "./bridge";
|
import { bridge } from "./bridge";
|
||||||
import { Bus, BusMsg } from "./bus";
|
import { Bus, BusMsg } from "./bus";
|
||||||
import { FrameDetails, NodeInfoData, TreeData } from "./data";
|
import { FrameDetails, NodeInfoData, TreeData } from "./data";
|
||||||
@ -53,6 +55,7 @@ export default defineComponent({
|
|||||||
name: "devtools",
|
name: "devtools",
|
||||||
props: {},
|
props: {},
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
|
ga.openView(Page.Devtools);
|
||||||
appStore().init();
|
appStore().init();
|
||||||
const isShowDebug = ref<boolean>(false);
|
const isShowDebug = ref<boolean>(false);
|
||||||
const iframes = ref<Array<FrameInfo>>([]);
|
const iframes = ref<Array<FrameInfo>>([]);
|
||||||
@ -71,18 +74,21 @@ export default defineComponent({
|
|||||||
icon: "github",
|
icon: "github",
|
||||||
cb: () => {
|
cb: () => {
|
||||||
window.open("https://github.com/tidys/cc-inspector-chrome");
|
window.open("https://github.com/tidys/cc-inspector-chrome");
|
||||||
|
ga.clickButton(GA_Button.Github);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
ccui.footbar.registerCmd({
|
ccui.footbar.registerCmd({
|
||||||
icon: "qq",
|
icon: "qq",
|
||||||
cb: () => {
|
cb: () => {
|
||||||
window.open("https://jq.qq.com/?_wv=1027&k=5SdPdy2");
|
window.open("https://jq.qq.com/?_wv=1027&k=5SdPdy2");
|
||||||
|
ga.clickButton(GA_Button.QQ);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
ccui.footbar.registerCmd({
|
ccui.footbar.registerCmd({
|
||||||
icon: "support",
|
icon: "support",
|
||||||
cb: () => {
|
cb: () => {
|
||||||
window.open("https://github.com/tidys/cc-inspector-chrome/issues");
|
window.open("https://github.com/tidys/cc-inspector-chrome/issues");
|
||||||
|
ga.clickButton(GA_Button.Issues);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Bus.on(BusMsg.EnableSchedule, funcEnableSchedule);
|
Bus.on(BusMsg.EnableSchedule, funcEnableSchedule);
|
||||||
|
@ -17,6 +17,8 @@ import { Bus, BusMsg } from "./bus";
|
|||||||
import { NodeInfoData } from "./data";
|
import { NodeInfoData } from "./data";
|
||||||
import { Timer } from "./timer";
|
import { Timer } from "./timer";
|
||||||
import Properties from "./ui/propertys.vue";
|
import Properties from "./ui/propertys.vue";
|
||||||
|
import { ga } from "../../ga";
|
||||||
|
import { GA_EventName } from "../../ga/type";
|
||||||
const { CCDock } = ccui.components;
|
const { CCDock } = ccui.components;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { Properties, CCDock },
|
components: { Properties, CCDock },
|
||||||
@ -89,12 +91,14 @@ export default defineComponent({
|
|||||||
name: "update node info",
|
name: "update node info",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
updateNodeInfo();
|
updateNodeInfo();
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, "update node info");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
menus.push({
|
menus.push({
|
||||||
name: simpleProperties ? "show more properties" : "show simple properties",
|
name: simpleProperties ? "show more properties" : "show simple properties",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
simpleProperties = !simpleProperties;
|
simpleProperties = !simpleProperties;
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, "simple/more properties");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
ccui.menu.showMenuByMouseEvent(evnet, menus);
|
ccui.menu.showMenuByMouseEvent(evnet, menus);
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, PropType, toRaw } from "vue";
|
import { defineComponent, PropType, toRaw } from "vue";
|
||||||
|
import { ga } from "../../../ga";
|
||||||
|
import { GA_EventName } from "../../../ga/type";
|
||||||
import { Bus, BusMsg } from "../bus";
|
import { Bus, BusMsg } from "../bus";
|
||||||
import { CompType } from "../comp";
|
import { CompType } from "../comp";
|
||||||
import { EngineData } from "../data";
|
import { EngineData } from "../data";
|
||||||
@ -23,6 +25,7 @@ export default defineComponent({
|
|||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
return {
|
return {
|
||||||
onPlaceInTree() {
|
onPlaceInTree() {
|
||||||
|
ga.fireEventWithParam(GA_EventName.Inspector, BusMsg.ShowPlace);
|
||||||
Bus.emit(BusMsg.ShowPlace, toRaw(props.data));
|
Bus.emit(BusMsg.ShowPlace, toRaw(props.data));
|
||||||
},
|
},
|
||||||
getEngineTypeIcon() {
|
getEngineTypeIcon() {
|
||||||
|
@ -26,6 +26,8 @@ import { Bus, BusMsg } from "../bus";
|
|||||||
import { BoolData, Group, Info, Property } from "../data";
|
import { BoolData, Group, Info, Property } from "../data";
|
||||||
import UiProp from "./ui-prop.vue";
|
import UiProp from "./ui-prop.vue";
|
||||||
import { VisibleProp } from "../comp";
|
import { VisibleProp } from "../comp";
|
||||||
|
import { ga } from "../../../ga";
|
||||||
|
import { GA_EventName } from "../../../ga/type";
|
||||||
const { CCInput, CCSection, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
|
const { CCInput, CCSection, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "property-group",
|
name: "property-group",
|
||||||
@ -72,11 +74,13 @@ export default defineComponent({
|
|||||||
fold,
|
fold,
|
||||||
visible,
|
visible,
|
||||||
onChangeVisible(b: boolean) {
|
onChangeVisible(b: boolean) {
|
||||||
|
ga.fireEventWithParam(GA_EventName.Inspector, "group-visible");
|
||||||
const raw: BoolData = toRaw<Info>(visibleTarget.value) as BoolData;
|
const raw: BoolData = toRaw<Info>(visibleTarget.value) as BoolData;
|
||||||
raw.data = b;
|
raw.data = b;
|
||||||
bridge.send(Msg.RequestSetProperty, raw as RequestSetPropertyData);
|
bridge.send(Msg.RequestSetProperty, raw as RequestSetPropertyData);
|
||||||
},
|
},
|
||||||
onLog() {
|
onLog() {
|
||||||
|
ga.fireEventWithParam(GA_EventName.Inspector, "group-log");
|
||||||
const raw = toRaw(props);
|
const raw = toRaw(props);
|
||||||
const data = [raw.group.id];
|
const data = [raw.group.id];
|
||||||
bridge.send(Msg.RequestLogData, data as RequestLogData);
|
bridge.send(Msg.RequestLogData, data as RequestLogData);
|
||||||
|
@ -34,6 +34,8 @@ import ccui from "@xuyanfeng/cc-ui";
|
|||||||
import { Option } from "@xuyanfeng/cc-ui/types/cc-select/const";
|
import { Option } from "@xuyanfeng/cc-ui/types/cc-select/const";
|
||||||
import { defineComponent, onMounted, PropType, ref, toRaw, watch } from "vue";
|
import { defineComponent, onMounted, PropType, ref, toRaw, watch } from "vue";
|
||||||
import { Msg, RequestLogData, RequestSetPropertyData } from "../../../core/types";
|
import { Msg, RequestLogData, RequestSetPropertyData } from "../../../core/types";
|
||||||
|
import { ga } from "../../../ga";
|
||||||
|
import { GA_EventName } from "../../../ga/type";
|
||||||
import { bridge } from "../bridge";
|
import { bridge } from "../bridge";
|
||||||
import { ArrayData, EngineData, EnumData, ImageData, Info, NumberData, ObjectData, Property, StringData, TextData, Vec2Data, Vec3Data } from "../data";
|
import { ArrayData, EngineData, EnumData, ImageData, Info, NumberData, ObjectData, Property, StringData, TextData, Vec2Data, Vec3Data } from "../data";
|
||||||
import Engine from "./property-engine.vue";
|
import Engine from "./property-engine.vue";
|
||||||
@ -123,6 +125,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClickFold(v: boolean) {
|
onClickFold(v: boolean) {
|
||||||
|
ga.fireEventWithParam(GA_EventName.Inspector, "expand/fold prop");
|
||||||
freshSubData(props.value);
|
freshSubData(props.value);
|
||||||
},
|
},
|
||||||
onChangeValue() {
|
onChangeValue() {
|
||||||
@ -132,6 +135,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLogToConsole() {
|
onLogToConsole() {
|
||||||
|
ga.fireEventWithParam(GA_EventName.Inspector, "log-circle-object");
|
||||||
const data = toRaw(props.value.path);
|
const data = toRaw(props.value.path);
|
||||||
bridge.send(Msg.RequestLogData, data as RequestLogData);
|
bridge.send(Msg.RequestLogData, data as RequestLogData);
|
||||||
},
|
},
|
||||||
|
@ -15,10 +15,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
|
import { Page } from "../../core/types";
|
||||||
|
import { ga } from "../../ga";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "options",
|
name: "options",
|
||||||
components: {},
|
components: {},
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
|
ga.openView(Page.Options);
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -16,6 +16,8 @@ import ccui from "@xuyanfeng/cc-ui";
|
|||||||
import CCP from "cc-plugin/src/ccp/entry-render";
|
import CCP from "cc-plugin/src/ccp/entry-render";
|
||||||
import { ChromeConst } from "cc-plugin/src/chrome/const";
|
import { ChromeConst } from "cc-plugin/src/chrome/const";
|
||||||
import { defineComponent, onMounted, ref } from "vue";
|
import { defineComponent, onMounted, ref } from "vue";
|
||||||
|
import { Page } from "../../core/types";
|
||||||
|
import { ga } from "../../ga";
|
||||||
const { CCInput, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
|
const { CCInput, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "popup",
|
name: "popup",
|
||||||
@ -28,6 +30,7 @@ export default defineComponent({
|
|||||||
CCColor,
|
CCColor,
|
||||||
},
|
},
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
|
ga.openView(Page.Popup);
|
||||||
const title = ref(CCP.manifest.name);
|
const title = ref(CCP.manifest.name);
|
||||||
const version = ref(CCP.manifest.version);
|
const version = ref(CCP.manifest.version);
|
||||||
let longConn: chrome.runtime.Port | null = null;
|
let longConn: chrome.runtime.Port | null = null;
|
||||||
|
@ -396,10 +396,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/chrome@0.0.133":
|
"@types/chrome@0.0.293":
|
||||||
version "0.0.133"
|
version "0.0.293"
|
||||||
resolved "https://mirrors.cloud.tencent.com/npm/@types/chrome/-/chrome-0.0.133.tgz#9e1d55441584ba2d5274ca84db36427da9c5dc6e"
|
resolved "https://mirrors.cloud.tencent.com/npm/@types/chrome/-/chrome-0.0.293.tgz#1494b081b91521d749d2a5e3602eae202729991a"
|
||||||
integrity sha512-G8uIUdaCTBILprQvQXBWGXZxjAWbkCkFQit17cdH3zYQEwU8f/etNl8+M7e8MRz9Xj8daHaVpysneMZMx8/ldQ==
|
integrity sha512-pghCOLVHsnePWcMEHCxkAfMRx8qJWmj4lUoyF3ZpANniKz8AucIGLSld7smsrTdLUkk/p5JjOCGVDRdUDHx+uA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/filesystem" "*"
|
"@types/filesystem" "*"
|
||||||
"@types/har-format" "*"
|
"@types/har-format" "*"
|
||||||
@ -1229,7 +1229,7 @@
|
|||||||
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
|
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
|
||||||
|
|
||||||
"@xuyanfeng/cc-ui@file:.yalc/@xuyanfeng/cc-ui":
|
"@xuyanfeng/cc-ui@file:.yalc/@xuyanfeng/cc-ui":
|
||||||
version "0.2.34"
|
version "0.2.36"
|
||||||
dependencies:
|
dependencies:
|
||||||
axios "^1.7.2"
|
axios "^1.7.2"
|
||||||
chalk "^5.3.0"
|
chalk "^5.3.0"
|
||||||
@ -1943,7 +1943,7 @@ case-sensitive-paths-webpack-plugin@^2.3.0:
|
|||||||
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==
|
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==
|
||||||
|
|
||||||
"cc-plugin@file:.yalc/cc-plugin":
|
"cc-plugin@file:.yalc/cc-plugin":
|
||||||
version "2.1.68"
|
version "2.1.69"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/generator" "^7.16.8"
|
"@babel/generator" "^7.16.8"
|
||||||
"@popperjs/core" "^2.11.6"
|
"@popperjs/core" "^2.11.6"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user