mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-23 00:15:24 +00:00
数据埋点
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "vue";
|
||||
import { Msg, PluginEvent, ResponseSupportData } from "../../core/types";
|
||||
import { ga } from "../../ga";
|
||||
import { GA_Button } from "../../ga/type";
|
||||
import { bridge } from "./bridge";
|
||||
import { checkSupport } from "./util";
|
||||
export default defineComponent({
|
||||
@@ -28,6 +30,7 @@ export default defineComponent({
|
||||
return {
|
||||
msg,
|
||||
onBtnClickUpdatePage() {
|
||||
ga.clickButton(GA_Button.FreshManual);
|
||||
checkSupport();
|
||||
},
|
||||
};
|
||||
|
@@ -17,6 +17,8 @@ import Mousetrap, { MousetrapInstance } from "mousetrap";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { defineComponent, nextTick, onMounted, onUnmounted, ref, toRaw, watch } from "vue";
|
||||
import { Msg, PluginEvent, RequestTreeInfoData, RequestUseFrameData, ResponseSetPropertyData } from "../../core/types";
|
||||
import { ga } from "../../ga";
|
||||
import { GA_EventName } from "../../ga/type";
|
||||
import { bridge } from "./bridge";
|
||||
import { Bus, BusMsg } from "./bus";
|
||||
import { EngineData, TreeData } from "./data";
|
||||
@@ -43,6 +45,7 @@ export default defineComponent({
|
||||
});
|
||||
let ins: MousetrapInstance | null = null;
|
||||
function onQuickVisible() {
|
||||
ga.fireEvent(GA_EventName.SpaceVisible);
|
||||
console.log("onQuickVisible");
|
||||
if (selectedUUID) {
|
||||
bridge.send(Msg.RequestVisible, selectedUUID);
|
||||
@@ -160,10 +163,12 @@ export default defineComponent({
|
||||
onNodeExpand(data: TreeData) {
|
||||
if (data.id) {
|
||||
expandedKeys.value.push(data.id);
|
||||
ga.fireEventWithParam(GA_EventName.Hierarchy, "node expand");
|
||||
}
|
||||
},
|
||||
onNodeCollapse(data: TreeData) {
|
||||
if (data.id) {
|
||||
ga.fireEventWithParam(GA_EventName.Hierarchy, "node collapse");
|
||||
const keys = toRaw(expandedKeys.value);
|
||||
const index = keys.findIndex((el) => el === data.id);
|
||||
if (index !== -1) {
|
||||
@@ -191,6 +196,7 @@ export default defineComponent({
|
||||
name: "update hierarchy",
|
||||
enabled: true,
|
||||
callback: () => {
|
||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "update hierarchy");
|
||||
updateTree();
|
||||
},
|
||||
});
|
||||
@@ -199,6 +205,7 @@ export default defineComponent({
|
||||
name: "visible (sapce)",
|
||||
enabled: true,
|
||||
callback: () => {
|
||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "visible");
|
||||
onQuickVisible();
|
||||
},
|
||||
});
|
||||
@@ -206,6 +213,7 @@ export default defineComponent({
|
||||
name: "destroy",
|
||||
enabled: true,
|
||||
callback: () => {
|
||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "destroy");
|
||||
bridge.send(Msg.RequestDestroy, selectedUUID);
|
||||
},
|
||||
});
|
||||
|
@@ -29,7 +29,9 @@ import { Option } from "@xuyanfeng/cc-ui/types/cc-select/const";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { defineComponent, onMounted, onUnmounted, ref, toRaw } from "vue";
|
||||
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 { Bus, BusMsg } from "./bus";
|
||||
import { FrameDetails, NodeInfoData, TreeData } from "./data";
|
||||
@@ -53,6 +55,7 @@ export default defineComponent({
|
||||
name: "devtools",
|
||||
props: {},
|
||||
setup(props, ctx) {
|
||||
ga.openView(Page.Devtools);
|
||||
appStore().init();
|
||||
const isShowDebug = ref<boolean>(false);
|
||||
const iframes = ref<Array<FrameInfo>>([]);
|
||||
@@ -71,18 +74,21 @@ export default defineComponent({
|
||||
icon: "github",
|
||||
cb: () => {
|
||||
window.open("https://github.com/tidys/cc-inspector-chrome");
|
||||
ga.clickButton(GA_Button.Github);
|
||||
},
|
||||
});
|
||||
ccui.footbar.registerCmd({
|
||||
icon: "qq",
|
||||
cb: () => {
|
||||
window.open("https://jq.qq.com/?_wv=1027&k=5SdPdy2");
|
||||
ga.clickButton(GA_Button.QQ);
|
||||
},
|
||||
});
|
||||
ccui.footbar.registerCmd({
|
||||
icon: "support",
|
||||
cb: () => {
|
||||
window.open("https://github.com/tidys/cc-inspector-chrome/issues");
|
||||
ga.clickButton(GA_Button.Issues);
|
||||
},
|
||||
});
|
||||
Bus.on(BusMsg.EnableSchedule, funcEnableSchedule);
|
||||
|
@@ -17,6 +17,8 @@ import { Bus, BusMsg } from "./bus";
|
||||
import { NodeInfoData } from "./data";
|
||||
import { Timer } from "./timer";
|
||||
import Properties from "./ui/propertys.vue";
|
||||
import { ga } from "../../ga";
|
||||
import { GA_EventName } from "../../ga/type";
|
||||
const { CCDock } = ccui.components;
|
||||
export default defineComponent({
|
||||
components: { Properties, CCDock },
|
||||
@@ -89,12 +91,14 @@ export default defineComponent({
|
||||
name: "update node info",
|
||||
callback: () => {
|
||||
updateNodeInfo();
|
||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "update node info");
|
||||
},
|
||||
});
|
||||
menus.push({
|
||||
name: simpleProperties ? "show more properties" : "show simple properties",
|
||||
callback: () => {
|
||||
simpleProperties = !simpleProperties;
|
||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "simple/more properties");
|
||||
},
|
||||
});
|
||||
ccui.menu.showMenuByMouseEvent(evnet, menus);
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType, toRaw } from "vue";
|
||||
import { ga } from "../../../ga";
|
||||
import { GA_EventName } from "../../../ga/type";
|
||||
import { Bus, BusMsg } from "../bus";
|
||||
import { CompType } from "../comp";
|
||||
import { EngineData } from "../data";
|
||||
@@ -23,6 +25,7 @@ export default defineComponent({
|
||||
setup(props, context) {
|
||||
return {
|
||||
onPlaceInTree() {
|
||||
ga.fireEventWithParam(GA_EventName.Inspector, BusMsg.ShowPlace);
|
||||
Bus.emit(BusMsg.ShowPlace, toRaw(props.data));
|
||||
},
|
||||
getEngineTypeIcon() {
|
||||
|
@@ -26,6 +26,8 @@ import { Bus, BusMsg } from "../bus";
|
||||
import { BoolData, Group, Info, Property } from "../data";
|
||||
import UiProp from "./ui-prop.vue";
|
||||
import { VisibleProp } from "../comp";
|
||||
import { ga } from "../../../ga";
|
||||
import { GA_EventName } from "../../../ga/type";
|
||||
const { CCInput, CCSection, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
|
||||
export default defineComponent({
|
||||
name: "property-group",
|
||||
@@ -72,11 +74,13 @@ export default defineComponent({
|
||||
fold,
|
||||
visible,
|
||||
onChangeVisible(b: boolean) {
|
||||
ga.fireEventWithParam(GA_EventName.Inspector, "group-visible");
|
||||
const raw: BoolData = toRaw<Info>(visibleTarget.value) as BoolData;
|
||||
raw.data = b;
|
||||
bridge.send(Msg.RequestSetProperty, raw as RequestSetPropertyData);
|
||||
},
|
||||
onLog() {
|
||||
ga.fireEventWithParam(GA_EventName.Inspector, "group-log");
|
||||
const raw = toRaw(props);
|
||||
const data = [raw.group.id];
|
||||
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 { defineComponent, onMounted, PropType, ref, toRaw, watch } from "vue";
|
||||
import { Msg, RequestLogData, RequestSetPropertyData } from "../../../core/types";
|
||||
import { ga } from "../../../ga";
|
||||
import { GA_EventName } from "../../../ga/type";
|
||||
import { bridge } from "../bridge";
|
||||
import { ArrayData, EngineData, EnumData, ImageData, Info, NumberData, ObjectData, Property, StringData, TextData, Vec2Data, Vec3Data } from "../data";
|
||||
import Engine from "./property-engine.vue";
|
||||
@@ -123,6 +125,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
onClickFold(v: boolean) {
|
||||
ga.fireEventWithParam(GA_EventName.Inspector, "expand/fold prop");
|
||||
freshSubData(props.value);
|
||||
},
|
||||
onChangeValue() {
|
||||
@@ -132,6 +135,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
onLogToConsole() {
|
||||
ga.fireEventWithParam(GA_EventName.Inspector, "log-circle-object");
|
||||
const data = toRaw(props.value.path);
|
||||
bridge.send(Msg.RequestLogData, data as RequestLogData);
|
||||
},
|
||||
|
@@ -15,10 +15,13 @@
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { Page } from "../../core/types";
|
||||
import { ga } from "../../ga";
|
||||
export default defineComponent({
|
||||
name: "options",
|
||||
components: {},
|
||||
setup(props, ctx) {
|
||||
ga.openView(Page.Options);
|
||||
return {};
|
||||
},
|
||||
});
|
||||
|
@@ -16,6 +16,8 @@ import ccui from "@xuyanfeng/cc-ui";
|
||||
import CCP from "cc-plugin/src/ccp/entry-render";
|
||||
import { ChromeConst } from "cc-plugin/src/chrome/const";
|
||||
import { defineComponent, onMounted, ref } from "vue";
|
||||
import { Page } from "../../core/types";
|
||||
import { ga } from "../../ga";
|
||||
const { CCInput, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
|
||||
export default defineComponent({
|
||||
name: "popup",
|
||||
@@ -28,6 +30,7 @@ export default defineComponent({
|
||||
CCColor,
|
||||
},
|
||||
setup(props, ctx) {
|
||||
ga.openView(Page.Popup);
|
||||
const title = ref(CCP.manifest.name);
|
||||
const version = ref(CCP.manifest.version);
|
||||
let longConn: chrome.runtime.Port | null = null;
|
||||
|
Reference in New Issue
Block a user