vue-layout-gitcode 1.12.15-beta.47 → 1.12.15-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GloabarSearch-CLYtierP.js +202 -0
- package/{MenuItem-D69oaByA.js → MenuItem-BYzU-MFz.js} +2 -2
- package/{ProjectMenuList-DyJptQ7k.js → ProjectMenuList-BUdSeYzS.js} +3 -3
- package/{ProjectMenuListV2-Bjam5aDG.js → ProjectMenuListV2-DUXR22kj.js} +3 -3
- package/{ProjectSearch-CS1zTW3U.js → ProjectSearch-ZPemd9C2.js} +2 -2
- package/{SearchHistoryList-Cjm6YvGC.js → SearchHistoryList-MOAZW-ce.js} +5 -11
- package/{SearchRecommed-B00mIM4v.js → SearchRecommed-Bx_0qPG9.js} +5 -4
- package/{SearchScopeList-COGUCPWY.js → SearchScopeList-COb6DGCL.js} +2 -2
- package/{UserSearch-BXjNoFwk.js → UserSearch-DS5CbYZ0.js} +2 -2
- package/{index-Bc8_HHVq.js → index-BTaTpv7I.js} +2 -2
- package/{useReportRepo-BAoT7ILs.js → index-Bv4s4B-r.js} +72 -72
- package/{index-Bc7aHOY1.js → index-C2hNaYFz.js} +2 -2
- package/{index-DoYP7NyR.js → index-D27sLwSF.js} +652 -1337
- package/index.d.ts +0 -3
- package/index.js +19 -19
- package/{notice-Ck27bzHx.js → notice-DO9c145B.js} +2 -2
- package/package.json +1 -1
- package/style.css +1 -1
- package/{transWebUrl-D0KkeBYn.js → transWebUrl-DFYqL_Qw.js} +1 -1
- package/GloabarSearch-D4wO7fkL.js +0 -150
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { defineComponent, inject, createElementBlock, openBlock, Fragment, createElementVNode, toDisplayString, createVNode, unref, renderList, withDirectives, createBlock, ref, watch, onMounted, createCommentVNode } from "vue";
|
|
2
|
+
import "vue-devui-lal/icon";
|
|
3
|
+
import "vue-devui-lal/icon/style.css";
|
|
4
|
+
import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-D27sLwSF.js";
|
|
5
|
+
import "lodash/debounce";
|
|
6
|
+
import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-Bv4s4B-r.js";
|
|
7
|
+
import "./transWebUrl-DFYqL_Qw.js";
|
|
8
|
+
import "vue-devui-lal/tooltip";
|
|
9
|
+
import "vue-devui-lal/tooltip/style.css";
|
|
10
|
+
import "vue-router";
|
|
11
|
+
import "vue-devui-lal/grid";
|
|
12
|
+
import "vue-devui-lal/skeleton";
|
|
13
|
+
import "vue-devui-lal/grid/style.css";
|
|
14
|
+
import "vue-devui-lal/skeleton/style.css";
|
|
15
|
+
import "vue-devui-lal/popover";
|
|
16
|
+
import "vue-devui-lal/popover/style.css";
|
|
17
|
+
const _hoisted_1$1 = { class: "search-repo-list-header" };
|
|
18
|
+
const _hoisted_2$1 = { class: "title" };
|
|
19
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
20
|
+
__name: "SearchRepoCardList",
|
|
21
|
+
props: {
|
|
22
|
+
dataList: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
searchStr: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
type: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
name: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["report"],
|
|
40
|
+
setup(__props, { emit: __emit }) {
|
|
41
|
+
const API = headRequest(inject("request"));
|
|
42
|
+
const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_SUGGESTION_CARD }, API.viewReport);
|
|
43
|
+
const { t: $t } = i18n.global;
|
|
44
|
+
const useReport = inject("useReport");
|
|
45
|
+
const emits = __emit;
|
|
46
|
+
const handleReport = (item) => {
|
|
47
|
+
useReport(REPO_EVENT.CLICK, { module_name: REPO_MODULE.SEARCH_SUGGESTION_CARD, repo_id: item.id });
|
|
48
|
+
};
|
|
49
|
+
const handleMore = () => {
|
|
50
|
+
emits("more");
|
|
51
|
+
};
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
54
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
55
|
+
createElementVNode("p", _hoisted_2$1, toDisplayString(__props.name), 1),
|
|
56
|
+
createElementVNode("a", {
|
|
57
|
+
class: "more-btn",
|
|
58
|
+
onClick: handleMore
|
|
59
|
+
}, [
|
|
60
|
+
createElementVNode("span", null, toDisplayString(unref($t)("gitCodeLayout.common.more")), 1),
|
|
61
|
+
createVNode(GIcon, {
|
|
62
|
+
name: "gt-line-right",
|
|
63
|
+
color: "var(--theme-placeholder)"
|
|
64
|
+
})
|
|
65
|
+
])
|
|
66
|
+
]),
|
|
67
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dataList, (item, index) => {
|
|
68
|
+
return withDirectives((openBlock(), createBlock(SearchRepoCard, {
|
|
69
|
+
key: item.id,
|
|
70
|
+
class: "search-repo-list-card",
|
|
71
|
+
info: { ...item, index },
|
|
72
|
+
keyword: __props.searchStr,
|
|
73
|
+
hover: "",
|
|
74
|
+
hideTopicTags: "",
|
|
75
|
+
hideStarBtn: "",
|
|
76
|
+
hideFooter: "",
|
|
77
|
+
hideDescription: "",
|
|
78
|
+
onReport: () => handleReport(item),
|
|
79
|
+
cardType: __props.type,
|
|
80
|
+
"url-params": { source_module: "search_project" }
|
|
81
|
+
}, null, 8, ["info", "keyword", "onReport", "cardType"])), [
|
|
82
|
+
[unref(vElementExposure), { trigger: (type) => unref(triggerReport)(type, item) }]
|
|
83
|
+
]);
|
|
84
|
+
}), 128))
|
|
85
|
+
], 64);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
90
|
+
const _hoisted_1 = {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "history-list-project history-list-project--padded"
|
|
93
|
+
};
|
|
94
|
+
const _hoisted_2 = {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "history-list-project history-list-project--padded"
|
|
97
|
+
};
|
|
98
|
+
const _hoisted_3 = {
|
|
99
|
+
key: 2,
|
|
100
|
+
class: "history-list-project history-list-project--padded"
|
|
101
|
+
};
|
|
102
|
+
const _sfc_main = {
|
|
103
|
+
__name: "GloabarSearch",
|
|
104
|
+
props: ["searchStr"],
|
|
105
|
+
emits: ["searchMore"],
|
|
106
|
+
setup(__props, { emit: __emit }) {
|
|
107
|
+
const emits = __emit;
|
|
108
|
+
const { t: $t } = i18n.global;
|
|
109
|
+
const API = headRequest(inject("request"));
|
|
110
|
+
const useReport = inject("useReport");
|
|
111
|
+
const projectList = ref([]);
|
|
112
|
+
const datasetList = ref([]);
|
|
113
|
+
const modelList = ref([]);
|
|
114
|
+
const origin = window.location.origin;
|
|
115
|
+
const props = __props;
|
|
116
|
+
let timer = null;
|
|
117
|
+
const convertDataList = (dataList) => {
|
|
118
|
+
return dataList == null ? void 0 : dataList.slice(0, 5).map((item) => {
|
|
119
|
+
const isGitcodeRepo = REPO_TYPE.GITCODE === item.is_mirrors;
|
|
120
|
+
const repoName = (!isGitcodeRepo ? extractRepoInfoWithURL(item.import_url) : item.name_with_namespace) || item.name_with_namespace;
|
|
121
|
+
const displayName = formatNameSpace(repoName).join("/");
|
|
122
|
+
return {
|
|
123
|
+
...item,
|
|
124
|
+
path: `${origin}/${item.path_with_namespace}`,
|
|
125
|
+
displayName,
|
|
126
|
+
web_url: `${origin}/${item.path_with_namespace}`
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const handleMore = (type) => {
|
|
131
|
+
emits("searchMore", type);
|
|
132
|
+
};
|
|
133
|
+
const getData = async () => {
|
|
134
|
+
if (!props.searchStr) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
useReport("search-project", {});
|
|
139
|
+
const res = await API.getGloabarSearchKeyLink({ q: props.searchStr });
|
|
140
|
+
const { recommend_project = [], recommend_model = [], recommend_dataset = [] } = res.data || {};
|
|
141
|
+
projectList.value = convertDataList(recommend_project);
|
|
142
|
+
modelList.value = convertDataList(recommend_model);
|
|
143
|
+
datasetList.value = convertDataList(recommend_dataset);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.error("Failed to fetch search results:", error);
|
|
146
|
+
projectList.value = [];
|
|
147
|
+
modelList.value = [];
|
|
148
|
+
datasetList.value = [];
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
if (props.searchStr) {
|
|
152
|
+
getData();
|
|
153
|
+
}
|
|
154
|
+
watch(
|
|
155
|
+
() => props.searchStr,
|
|
156
|
+
() => {
|
|
157
|
+
if (timer) {
|
|
158
|
+
clearTimeout(timer);
|
|
159
|
+
}
|
|
160
|
+
timer = setTimeout(() => {
|
|
161
|
+
getData();
|
|
162
|
+
}, 300);
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
onMounted(() => {
|
|
166
|
+
});
|
|
167
|
+
return (_ctx, _cache) => {
|
|
168
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
169
|
+
projectList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
170
|
+
createVNode(SearchRepoCardList, {
|
|
171
|
+
"data-list": projectList.value,
|
|
172
|
+
"search-str": __props.searchStr,
|
|
173
|
+
name: unref($t)("gitCodeLayout.header.repo"),
|
|
174
|
+
type: "repo",
|
|
175
|
+
onMore: _cache[0] || (_cache[0] = () => handleMore("repo"))
|
|
176
|
+
}, null, 8, ["data-list", "search-str", "name"])
|
|
177
|
+
])) : createCommentVNode("", true),
|
|
178
|
+
modelList.value.length ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
179
|
+
createVNode(SearchRepoCardList, {
|
|
180
|
+
"data-list": modelList.value,
|
|
181
|
+
"search-str": __props.searchStr,
|
|
182
|
+
name: unref($t)("gitCodeLayout.aihub.model"),
|
|
183
|
+
type: "model",
|
|
184
|
+
onMore: _cache[1] || (_cache[1] = () => handleMore("model"))
|
|
185
|
+
}, null, 8, ["data-list", "search-str", "name"])
|
|
186
|
+
])) : createCommentVNode("", true),
|
|
187
|
+
datasetList.value.length ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
188
|
+
createVNode(SearchRepoCardList, {
|
|
189
|
+
"data-list": datasetList.value,
|
|
190
|
+
"search-str": __props.searchStr,
|
|
191
|
+
name: unref($t)("gitCodeLayout.aihub.dataSet"),
|
|
192
|
+
type: "dataset",
|
|
193
|
+
onMore: _cache[2] || (_cache[2] = () => handleMore("dataset"))
|
|
194
|
+
}, null, 8, ["data-list", "search-str", "name"])
|
|
195
|
+
])) : createCommentVNode("", true)
|
|
196
|
+
], 64);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
export {
|
|
201
|
+
_sfc_main as default
|
|
202
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, inject, useSlots, computed, ref,
|
|
2
|
-
import { a as i18n,
|
|
1
|
+
import { defineComponent, inject, useSlots, computed, ref, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { a as i18n, y as useLayoutConfig, A as ThemeType, B as currentTheme, L as LANG_ZH, C as LANG_EN, D as getLocaleLang, G as GIcon, F as emitEvent, b as REPO_EVENT, H as ASIDE_MENU_REPO, I as isHttps, J as navigateWithMigrationGuard, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { Popover } from "vue-devui-lal/popover";
|
|
5
5
|
import "vue-devui-lal/popover/style.css";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, reactive, watch, computed, openBlock,
|
|
2
|
-
import { a as i18n,
|
|
1
|
+
import { defineComponent, inject, ref, reactive, watch, computed, createElementBlock, openBlock, createCommentVNode, createBlock, withDirectives, Fragment, createElementVNode, createVNode, toDisplayString, unref, withModifiers, normalizeClass, withCtx, renderList, createTextVNode, vShow } from "vue";
|
|
2
|
+
import { a as i18n, y as useLayoutConfig, G as GIcon, t as transformUrl, M as _sfc_main$1, N as loadAsideData, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, K as asideRequest, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-DFYqL_Qw.js";
|
|
5
5
|
import { Select, Option } from "vue-devui-lal/select";
|
|
6
6
|
import { Input } from "vue-devui-lal/input";
|
|
7
7
|
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, reactive, computed, watch,
|
|
2
|
-
import { a as i18n,
|
|
1
|
+
import { defineComponent, inject, ref, reactive, computed, watch, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, withDirectives, toDisplayString, unref, withModifiers, normalizeClass, withCtx, Fragment, renderList, createTextVNode, vShow } from "vue";
|
|
2
|
+
import { a as i18n, y as useLayoutConfig, t as transformUrl, K as asideRequest, G as GIcon, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-DFYqL_Qw.js";
|
|
5
5
|
import { Input } from "vue-devui-lal/input";
|
|
6
6
|
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
7
7
|
import { MenuItem } from "vue-devui-lal/menu";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref, inject, computed, withDirectives,
|
|
2
|
-
import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-
|
|
1
|
+
import { ref, inject, computed, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
|
|
2
|
+
import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-D27sLwSF.js";
|
|
3
3
|
import { useRoute, useRouter } from "vue-router";
|
|
4
4
|
import "vue-devui-lal/icon";
|
|
5
5
|
import "vue-devui-lal/icon/style.css";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock,
|
|
2
|
-
import { a as i18n,
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers } from "vue";
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = { class: "history-list" };
|
|
@@ -42,11 +42,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
icon: "gt-plane-project",
|
|
43
43
|
hoverIcon: "gt-plane-project-red"
|
|
44
44
|
},
|
|
45
|
-
all: {
|
|
46
|
-
text: t("gitCodeLayout.common.all"),
|
|
47
|
-
icon: "gt-search",
|
|
48
|
-
hoverIcon: "gt-search"
|
|
49
|
-
},
|
|
50
45
|
model: {
|
|
51
46
|
text: t("gitCodeLayout.aihub.model"),
|
|
52
47
|
icon: "gt-plane-Models",
|
|
@@ -88,12 +83,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
83
|
hoverIcon: "gt-plane-topic-red"
|
|
89
84
|
}
|
|
90
85
|
};
|
|
91
|
-
|
|
92
|
-
return typeMap[type] || typeMap["repo"];
|
|
86
|
+
return typeMap[item.type] || typeMap["repo"];
|
|
93
87
|
};
|
|
94
88
|
const historyList = computed(() => {
|
|
95
89
|
var _a;
|
|
96
|
-
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) =>
|
|
90
|
+
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) => typeof raw === "string" ? { q: raw } : raw).filter((item) => item == null ? void 0 : item.q).map((item) => {
|
|
97
91
|
const repoTitle = item.repo ? `${t("gitCodeLayout.header.repo")} ${decodeURIComponent(item.repo)}:` : "";
|
|
98
92
|
const userVal = item.user || (item.scope === "user" ? item.namespace : "");
|
|
99
93
|
const orgVal = item.org || (item.scope === "user" ? "" : item.namespace);
|
|
@@ -130,7 +124,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
130
124
|
}, [
|
|
131
125
|
(openBlock(true), createElementBlock(Fragment, null, renderList(historyList.value, (item, index) => {
|
|
132
126
|
return openBlock(), createElementBlock("li", {
|
|
133
|
-
key:
|
|
127
|
+
key: item,
|
|
134
128
|
class: normalizeClass(__props.activeIndex === index ? "hoverbg" : ""),
|
|
135
129
|
onClick: ($event) => toSearch(item),
|
|
136
130
|
onMouseenter: ($event) => onSearchEnter(index)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, onMounted,
|
|
2
|
-
import { u as useReportRepo, S as SearchRepoCard } from "./
|
|
3
|
-
import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-
|
|
1
|
+
import { defineComponent, inject, ref, onMounted, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
|
|
2
|
+
import { u as useReportRepo, S as SearchRepoCard } from "./index-Bv4s4B-r.js";
|
|
3
|
+
import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
4
4
|
import { Row, Col } from "vue-devui-lal/grid";
|
|
5
5
|
import { SkeletonItem } from "vue-devui-lal/skeleton";
|
|
6
6
|
import "vue-devui-lal/grid/style.css";
|
|
@@ -57,6 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
createElementVNode("div", _hoisted_3, toDisplayString(unref($t)("gitCodeLayout.search.trendingToday")), 1),
|
|
58
58
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recommendRepoList.value, (item, index) => {
|
|
59
59
|
return renderSlot(_ctx.$slots, "default", {
|
|
60
|
+
key: item.id,
|
|
60
61
|
item,
|
|
61
62
|
index
|
|
62
63
|
}, () => [
|
|
@@ -71,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
72
|
cardType: (item == null ? void 0 : item.repo_type) || "repo",
|
|
72
73
|
"url-params": { source_module: "search_box_discovery" }
|
|
73
74
|
}, null, 8, ["info", "onReport", "cardType"]))
|
|
74
|
-
], true
|
|
75
|
+
], true);
|
|
75
76
|
}), 128))
|
|
76
77
|
])) : (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
77
78
|
(openBlock(), createElementBlock(Fragment, null, renderList(5, (item) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, Fragment, renderList, createElementVNode, createVNode, createCommentVNode, toDisplayString, unref } from "vue";
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = ["onClick"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { inject, ref, watch, withDirectives,
|
|
2
|
-
import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-
|
|
1
|
+
import { inject, ref, watch, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
|
|
2
|
+
import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-D27sLwSF.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = { class: "history-list-project history-list-project--padded" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, onMounted, nextTick, onUnmounted,
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, onMounted, nextTick, onUnmounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
|
|
2
|
+
import { x as slidCaptchaManager, y as useLayoutConfig, z as isZh, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
3
3
|
import { FixedOverlay } from "vue-devui-lal/overlay";
|
|
4
4
|
import "vue-devui-lal/overlay/style.css";
|
|
5
5
|
const TARGET_TEXT = "Click in order:";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, toDisplayString, unref,
|
|
2
|
-
import
|
|
3
|
-
import { t as
|
|
1
|
+
import { ref, watchEffect, defineComponent, toDisplayString, unref, mergeModels, useModel, watch, createElementBlock, openBlock, createVNode, withDirectives, normalizeClass, createElementVNode, vShow, inject, withModifiers, createBlock, Fragment, computed, createCommentVNode, normalizeStyle, createTextVNode, onMounted, onUnmounted, renderList, withCtx, reactive } from "vue";
|
|
2
|
+
import debounce from "lodash/debounce";
|
|
3
|
+
import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource, f as useRequestReport, r as reqCatch, h as headRequest, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, j as useCookie, k as usePageResize, L as LANG_ZH, m as isGstarRepo, n as _sfc_main$b, o as isIncubationRepo, p as highlightWords, t as transformUrl, q as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL, w as LANG_KEY } from "./index-D27sLwSF.js";
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-DFYqL_Qw.js";
|
|
4
5
|
import { useRouter } from "vue-router";
|
|
5
6
|
import { Row, Col } from "vue-devui-lal/grid";
|
|
6
7
|
import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
|
|
@@ -8,7 +9,74 @@ import "vue-devui-lal/grid/style.css";
|
|
|
8
9
|
import "vue-devui-lal/skeleton/style.css";
|
|
9
10
|
import { Popover } from "vue-devui-lal/popover";
|
|
10
11
|
import "vue-devui-lal/popover/style.css";
|
|
11
|
-
|
|
12
|
+
const useReportRepo = (reportParams, viewReport) => {
|
|
13
|
+
const list = ref([]);
|
|
14
|
+
const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
|
|
15
|
+
const locationHref = ref((window == null ? void 0 : window.location.href) || "");
|
|
16
|
+
const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
|
|
17
|
+
const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
|
|
18
|
+
const triggerReport = (type, data) => {
|
|
19
|
+
if (type === "click") {
|
|
20
|
+
const params = {
|
|
21
|
+
chat_title: "",
|
|
22
|
+
related: {
|
|
23
|
+
list: [formatItem(data)],
|
|
24
|
+
type: "repo"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
viewReport(pageRef.value, locationHref.value, "click", params);
|
|
28
|
+
} else if (type === "expo") {
|
|
29
|
+
list.value.push(data);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const formatItem = (data) => {
|
|
33
|
+
const channelNames = [];
|
|
34
|
+
if (data.channelName) channelNames.push(data.channelName);
|
|
35
|
+
if (data.subChannelName) channelNames.push(data.subChannelName);
|
|
36
|
+
const repoId = isNaN(Number(data.id)) ? data.id : Number(data.id);
|
|
37
|
+
return {
|
|
38
|
+
type: "gitcode",
|
|
39
|
+
repo_id: repoId,
|
|
40
|
+
dest_url: data.web_url,
|
|
41
|
+
strategy: channelNames.join("、") || "",
|
|
42
|
+
// 官方项目
|
|
43
|
+
repo_index: data.index,
|
|
44
|
+
page: data.pageIndex || data.p || 0,
|
|
45
|
+
per_page: data.pageSize || data.pp || 0,
|
|
46
|
+
q: data.keyword || ""
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const doReport = debounce(() => {
|
|
50
|
+
if (list.value.length >= 1) {
|
|
51
|
+
const reportList = list.value.splice(0).map((item) => {
|
|
52
|
+
return formatItem(item);
|
|
53
|
+
});
|
|
54
|
+
const params = {
|
|
55
|
+
chat_title: "",
|
|
56
|
+
extend_json: {
|
|
57
|
+
key_words: keyword.value,
|
|
58
|
+
module_name: moduleName.value
|
|
59
|
+
},
|
|
60
|
+
related: {
|
|
61
|
+
list: reportList,
|
|
62
|
+
type: "repo"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
viewReport(pageRef.value, locationHref.value, "expo", params);
|
|
66
|
+
}
|
|
67
|
+
}, 500, { leading: false });
|
|
68
|
+
watchEffect(() => {
|
|
69
|
+
if (list.value.length) {
|
|
70
|
+
doReport();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
triggerReport
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const formatNameSpace = (content) => {
|
|
78
|
+
return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
|
|
79
|
+
};
|
|
12
80
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
13
81
|
__name: "index",
|
|
14
82
|
props: {
|
|
@@ -421,9 +489,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
421
489
|
}
|
|
422
490
|
});
|
|
423
491
|
const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
424
|
-
const formatNameSpace = (content) => {
|
|
425
|
-
return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
|
|
426
|
-
};
|
|
427
492
|
const _hoisted_1$2 = { class: "new-tag-content" };
|
|
428
493
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
429
494
|
__name: "index",
|
|
@@ -786,71 +851,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
786
851
|
}
|
|
787
852
|
});
|
|
788
853
|
const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
789
|
-
const useReportRepo = (reportParams, viewReport) => {
|
|
790
|
-
const list = ref([]);
|
|
791
|
-
const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
|
|
792
|
-
const locationHref = ref((window == null ? void 0 : window.location.href) || "");
|
|
793
|
-
const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
|
|
794
|
-
const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
|
|
795
|
-
const triggerReport = (type, data) => {
|
|
796
|
-
if (type === "click") {
|
|
797
|
-
const params = {
|
|
798
|
-
chat_title: "",
|
|
799
|
-
related: {
|
|
800
|
-
list: [formatItem(data)],
|
|
801
|
-
type: "repo"
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
viewReport(pageRef.value, locationHref.value, "click", params);
|
|
805
|
-
} else if (type === "expo") {
|
|
806
|
-
list.value.push(data);
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
const formatItem = (data) => {
|
|
810
|
-
const channelNames = [];
|
|
811
|
-
if (data.channelName) channelNames.push(data.channelName);
|
|
812
|
-
if (data.subChannelName) channelNames.push(data.subChannelName);
|
|
813
|
-
const repoId = isNaN(Number(data.id)) ? data.id : Number(data.id);
|
|
814
|
-
return {
|
|
815
|
-
type: "gitcode",
|
|
816
|
-
repo_id: repoId,
|
|
817
|
-
dest_url: data.web_url,
|
|
818
|
-
strategy: channelNames.join("、") || "",
|
|
819
|
-
// 官方项目
|
|
820
|
-
repo_index: data.index,
|
|
821
|
-
page: data.pageIndex || data.p || 0,
|
|
822
|
-
per_page: data.pageSize || data.pp || 0,
|
|
823
|
-
q: data.keyword || ""
|
|
824
|
-
};
|
|
825
|
-
};
|
|
826
|
-
const doReport = debounce(() => {
|
|
827
|
-
if (list.value.length >= 1) {
|
|
828
|
-
const reportList = list.value.splice(0).map((item) => {
|
|
829
|
-
return formatItem(item);
|
|
830
|
-
});
|
|
831
|
-
const params = {
|
|
832
|
-
chat_title: "",
|
|
833
|
-
extend_json: {
|
|
834
|
-
key_words: keyword.value,
|
|
835
|
-
module_name: moduleName.value
|
|
836
|
-
},
|
|
837
|
-
related: {
|
|
838
|
-
list: reportList,
|
|
839
|
-
type: "repo"
|
|
840
|
-
}
|
|
841
|
-
};
|
|
842
|
-
viewReport(pageRef.value, locationHref.value, "expo", params);
|
|
843
|
-
}
|
|
844
|
-
}, 500, { leading: false });
|
|
845
|
-
watchEffect(() => {
|
|
846
|
-
if (list.value.length) {
|
|
847
|
-
doReport();
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
return {
|
|
851
|
-
triggerReport
|
|
852
|
-
};
|
|
853
|
-
};
|
|
854
854
|
export {
|
|
855
855
|
SearchRepoCard as S,
|
|
856
856
|
formatNameSpace as f,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { defineComponent, ref, onMounted, onBeforeUnmount,
|
|
4
|
+
import { defineComponent, ref, onMounted, onBeforeUnmount, createBlock, openBlock, unref, withCtx, createElementVNode, withDirectives, createVNode, vShow, nextTick } from "vue";
|
|
5
5
|
import { Button } from "vue-devui-lal/button";
|
|
6
6
|
import "vue-devui-lal/button/style.css";
|
|
7
7
|
import { Message } from "vue-devui-lal/message";
|
|
8
8
|
import "vue-devui-lal/message/style.css";
|
|
9
9
|
import { FixedOverlay } from "vue-devui-lal/overlay";
|
|
10
10
|
import "vue-devui-lal/overlay/style.css";
|
|
11
|
-
import { a as i18n, k as usePageResize,
|
|
11
|
+
import { a as i18n, k as usePageResize, z as isZh, _ as _export_sfc } from "./index-D27sLwSF.js";
|
|
12
12
|
const _YunpianCaptchaManager = class _YunpianCaptchaManager {
|
|
13
13
|
// eslint-disable-next-line no-useless-constructor
|
|
14
14
|
constructor() {
|