vue-layout-gitcode 1.12.15-beta.5 → 1.12.15-beta.51
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-SZoGWlUT.js +154 -0
- package/{MenuItem-ByO_mr0Q.js → MenuItem-C-G3-qxt.js} +15 -11
- package/{ProjectMenuList-PUZCLSpf.js → ProjectMenuList-yWnBlDRV.js} +14 -14
- package/{ProjectMenuListV2-Fb97LRsu.js → ProjectMenuListV2-BRzVv_AY.js} +7 -7
- package/{ProjectSearch-BVDuGwBc.js → ProjectSearch-DLfgOAqF.js} +10 -5
- package/{SearchHistoryList-CngRJcEf.js → SearchHistoryList-C4097SmS.js} +18 -15
- package/{SearchRecommed-Cl9ppkla.js → SearchRecommed-yqm_4RV2.js} +4 -5
- package/{SearchScopeList-D4uQwLF5.js → SearchScopeList-CgarZQyj.js} +3 -3
- package/{UserSearch-BwoIN_0z.js → UserSearch-Ca1xTnjD.js} +15 -12
- package/{index-D8ySyL6a.js → index-BBdEwjQ0.js} +5340 -2978
- package/{index-ChNwITrT.js → index-CfDhMVYG.js} +2 -2
- package/{index-CHr0usFD.js → index-DM7OarAK.js} +5 -6
- package/index.d.ts +47 -856
- package/index.js +20 -13
- package/{notice-CzHU1kwG.js → notice-CLIMV9t6.js} +11 -13
- package/package.json +1 -1
- package/style.css +1 -1
- package/{transWebUrl-CtGPMiCw.js → transWebUrl-DlK6GU_m.js} +1 -1
- package/{index-CzkxRwlV.js → useReportRepo-DKt0C5mO.js} +131 -153
- package/GloabarSearch-Bso_VMSX.js +0 -202
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { defineComponent, inject, openBlock, createElementBlock, Fragment, renderList, withDirectives, createBlock, unref, ref, watch, createElementVNode, createVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
import { h as headRequest, R as REPO_MODULE, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL, a as i18n, G as GIcon } from "./index-BBdEwjQ0.js";
|
|
3
|
+
import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./useReportRepo-DKt0C5mO.js";
|
|
4
|
+
import "vue-devui-lal/icon";
|
|
5
|
+
import "vue-devui-lal/icon/style.css";
|
|
6
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "SearchRepoCardList",
|
|
8
|
+
props: {
|
|
9
|
+
dataList: { default: () => [] },
|
|
10
|
+
searchStr: { default: "" },
|
|
11
|
+
type: { default: "" }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const API = headRequest(inject("request"));
|
|
16
|
+
const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_SUGGESTION_CARD }, API.viewReport);
|
|
17
|
+
const useReport = inject("useReport");
|
|
18
|
+
const handleReport = (item) => {
|
|
19
|
+
useReport(REPO_EVENT.CLICK, { module_name: REPO_MODULE.SEARCH_SUGGESTION_CARD, repo_id: item.id });
|
|
20
|
+
};
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(props.dataList, (item, index) => {
|
|
23
|
+
return withDirectives((openBlock(), createBlock(SearchRepoCard, {
|
|
24
|
+
key: `${item.searchType || props.type}-${item.id}`,
|
|
25
|
+
class: "search-repo-list-card",
|
|
26
|
+
info: { ...item, index },
|
|
27
|
+
keyword: props.searchStr,
|
|
28
|
+
hover: "",
|
|
29
|
+
noborder: false,
|
|
30
|
+
hideTopicTags: "",
|
|
31
|
+
hideStarBtn: "",
|
|
32
|
+
hideFooter: "",
|
|
33
|
+
hideDescription: "",
|
|
34
|
+
onReport: () => handleReport(item),
|
|
35
|
+
cardType: item.searchType || props.type,
|
|
36
|
+
"url-params": { source_module: "search_project" }
|
|
37
|
+
}, null, 8, ["info", "keyword", "onReport", "cardType"])), [
|
|
38
|
+
[unref(vElementExposure), { trigger: (type) => unref(triggerReport)(type, item) }]
|
|
39
|
+
]);
|
|
40
|
+
}), 128);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
45
|
+
const normalizeOrigin = (origin) => origin.replace(/\/+$/, "");
|
|
46
|
+
const getStringValue = (value) => typeof value === "string" ? value : "";
|
|
47
|
+
const convertDataList = ({ dataList, searchType, origin }) => {
|
|
48
|
+
if (!Array.isArray(dataList)) {
|
|
49
|
+
return { items: [] };
|
|
50
|
+
}
|
|
51
|
+
const baseOrigin = normalizeOrigin(origin);
|
|
52
|
+
const items = dataList.slice(0, 3).filter((item) => Boolean(item) && typeof item === "object" && !Array.isArray(item)).map((item) => {
|
|
53
|
+
const isGitcodeRepo = REPO_TYPE.GITCODE === item.is_mirrors;
|
|
54
|
+
const importUrl = getStringValue(item.import_url);
|
|
55
|
+
const importedRepoName = importUrl ? extractRepoInfoWithURL(importUrl) : "";
|
|
56
|
+
const nameWithNamespace = getStringValue(item.name_with_namespace);
|
|
57
|
+
const pathWithNamespace = getStringValue(item.path_with_namespace);
|
|
58
|
+
const repoName = (isGitcodeRepo ? nameWithNamespace : importedRepoName) || nameWithNamespace || pathWithNamespace;
|
|
59
|
+
const displayName = formatNameSpace(repoName).join("/");
|
|
60
|
+
const path = `${baseOrigin}/${pathWithNamespace}`;
|
|
61
|
+
return {
|
|
62
|
+
...item,
|
|
63
|
+
searchType,
|
|
64
|
+
path,
|
|
65
|
+
displayName,
|
|
66
|
+
web_url: path
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
return { items };
|
|
70
|
+
};
|
|
71
|
+
const mergeSearchSuggestions = ({ response = {}, origin }) => ({
|
|
72
|
+
items: [
|
|
73
|
+
...convertDataList({ dataList: response.recommend_project, searchType: "repo", origin }).items,
|
|
74
|
+
...convertDataList({ dataList: response.recommend_model, searchType: "model", origin }).items,
|
|
75
|
+
...convertDataList({ dataList: response.recommend_dataset, searchType: "dataset", origin }).items
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
const _hoisted_1 = {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "history-list-project history-list-project--padded"
|
|
81
|
+
};
|
|
82
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
83
|
+
__name: "GloabarSearch",
|
|
84
|
+
props: {
|
|
85
|
+
searchStr: {}
|
|
86
|
+
},
|
|
87
|
+
emits: ["searchMore"],
|
|
88
|
+
setup(__props, { emit: __emit }) {
|
|
89
|
+
const emits = __emit;
|
|
90
|
+
const { t: $t } = i18n.global;
|
|
91
|
+
const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
|
|
92
|
+
const useReport = inject("useReport", () => {
|
|
93
|
+
});
|
|
94
|
+
const searchSuggestionList = ref([]);
|
|
95
|
+
const origin = window.location.origin;
|
|
96
|
+
const props = __props;
|
|
97
|
+
let timer = null;
|
|
98
|
+
const handleSearchAll = () => {
|
|
99
|
+
emits("searchMore", "all");
|
|
100
|
+
};
|
|
101
|
+
const getData = async () => {
|
|
102
|
+
if (!props.searchStr) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
useReport("search-project", {});
|
|
107
|
+
const res = await API.getGloabarSearchKeyLink({ q: props.searchStr });
|
|
108
|
+
searchSuggestionList.value = mergeSearchSuggestions({ response: res.data || {}, origin }).items;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error("Failed to fetch search results:", error);
|
|
111
|
+
searchSuggestionList.value = [];
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
if (props.searchStr) {
|
|
115
|
+
getData();
|
|
116
|
+
}
|
|
117
|
+
watch(
|
|
118
|
+
() => props.searchStr,
|
|
119
|
+
() => {
|
|
120
|
+
if (timer) {
|
|
121
|
+
clearTimeout(timer);
|
|
122
|
+
}
|
|
123
|
+
timer = setTimeout(() => {
|
|
124
|
+
getData();
|
|
125
|
+
}, 300);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
return (_ctx, _cache) => {
|
|
129
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
130
|
+
createElementVNode("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
class: "global-search-all",
|
|
133
|
+
onClick: handleSearchAll
|
|
134
|
+
}, [
|
|
135
|
+
createVNode(GIcon, {
|
|
136
|
+
name: "gt-search",
|
|
137
|
+
color: "var(--theme-placeholder)"
|
|
138
|
+
}),
|
|
139
|
+
createElementVNode("span", null, toDisplayString(unref($t)("gitCodeLayout.header.searchAll", { keyword: __props.searchStr })), 1)
|
|
140
|
+
]),
|
|
141
|
+
searchSuggestionList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
142
|
+
createVNode(SearchRepoCardList, {
|
|
143
|
+
"data-list": searchSuggestionList.value,
|
|
144
|
+
"search-str": __props.searchStr,
|
|
145
|
+
type: "repo"
|
|
146
|
+
}, null, 8, ["data-list", "search-str"])
|
|
147
|
+
])) : createCommentVNode("", true)
|
|
148
|
+
], 64);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
export {
|
|
153
|
+
_sfc_main as default
|
|
154
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, inject, useSlots, computed, ref,
|
|
2
|
-
import { a as i18n,
|
|
1
|
+
import { defineComponent, inject, useSlots, computed, ref, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { a as i18n, z as useLayoutConfig, B as ThemeType, C as currentTheme, L as LANG_ZH, D as LANG_EN, F as getLocaleLang, G as GIcon, H as emitEvent, b as REPO_EVENT, I as ASIDE_MENU_REPO, J as isHttps, K as navigateWithMigrationGuard, _ as _export_sfc } from "./index-BBdEwjQ0.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";
|
|
@@ -76,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
76
76
|
return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
|
|
77
77
|
});
|
|
78
78
|
const isShowPopover = computed(() => {
|
|
79
|
-
return props.item.is_show_popup && props.slotKeys.includes(props.item.popup_key) && slots[props.item.popup_key] && asideSetShow.value;
|
|
79
|
+
return Boolean(props.item.is_show_popup && props.slotKeys.includes(props.item.popup_key) && slots[props.item.popup_key] && asideSetShow.value);
|
|
80
80
|
});
|
|
81
81
|
const handleMouseEnter = () => {
|
|
82
82
|
isHover.value = true;
|
|
@@ -93,7 +93,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
93
93
|
useReport(REPO_EVENT.CLICK, { module_name: `侧边栏_${reportName}` });
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
const handleMenuClick = () => {
|
|
96
|
+
const handleMenuClick = async () => {
|
|
97
97
|
var _a, _b;
|
|
98
98
|
const currentHref = window.location.href;
|
|
99
99
|
if (!props.item.left_menu_url) {
|
|
@@ -106,6 +106,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
106
106
|
emitEvent("login", { loginTriggerSource: `aside_${props.item.left_menu_url}` });
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
+
if (props.item.left_menu_url === "/dashboard/downloads?tab=view") {
|
|
110
|
+
useReport(REPO_EVENT.CLICK, { module_name: ASIDE_MENU_REPO.BROWSEHISTORYCLICK });
|
|
111
|
+
window.open(props.item.left_menu_url, "_blank");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
109
114
|
if (props.item.left_menu_url === "/dashboard/downloads") {
|
|
110
115
|
(_b = (_a = globalStore.value) == null ? void 0 : _a.downloadClickRequest) == null ? void 0 : _b.call(_a);
|
|
111
116
|
}
|
|
@@ -113,14 +118,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
118
|
window.open(props.item.left_menu_url, "_blank");
|
|
114
119
|
} else if (isHttps(props.item.left_menu_url || "")) {
|
|
115
120
|
window.open(props.item.left_menu_url, "_self");
|
|
121
|
+
} else if (independence) {
|
|
122
|
+
window.open(layoutConfig.VITE_HOST + props.item.left_menu_url, "_self");
|
|
123
|
+
return;
|
|
116
124
|
} else {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
router.push({
|
|
122
|
-
path: props.item.left_menu_url
|
|
123
|
-
});
|
|
125
|
+
clickMenuReport();
|
|
126
|
+
await navigateWithMigrationGuard(router, { path: props.item.left_menu_url });
|
|
127
|
+
return;
|
|
124
128
|
}
|
|
125
129
|
clickMenuReport();
|
|
126
130
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, reactive, watch, computed,
|
|
2
|
-
import { a as i18n,
|
|
1
|
+
import { defineComponent, inject, ref, reactive, watch, computed, openBlock, createElementBlock, Fragment, createElementVNode, toDisplayString, unref, createVNode, withModifiers, normalizeClass, withCtx, renderList, createBlock, createCommentVNode, createTextVNode, withDirectives, vShow } from "vue";
|
|
2
|
+
import { a as i18n, z as useLayoutConfig, G as GIcon, t as transformUrl, N as _sfc_main$1, O as loadAsideData, K as navigateWithMigrationGuard, H as emitEvent, s as setLoginTriggerSource, f as useRequestReport, M as asideRequest, _ as _export_sfc } from "./index-BBdEwjQ0.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-DlK6GU_m.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";
|
|
@@ -170,13 +170,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
170
170
|
}
|
|
171
171
|
return [...DEFAULT_ORG_FILTER_OPTIONS, ...moreOrgData.value];
|
|
172
172
|
});
|
|
173
|
-
const fastToLink = (type) => {
|
|
173
|
+
const fastToLink = async (type) => {
|
|
174
174
|
if (type === "project") {
|
|
175
|
-
router
|
|
175
|
+
await navigateWithMigrationGuard(router, { name: "userRepos", params: { namespace: props.username } });
|
|
176
176
|
} else if (type === "enterprise") {
|
|
177
177
|
window.location.href = transformUrl(`${layoutConfig.VITE_HOST}/setting/enterprise`);
|
|
178
178
|
} else {
|
|
179
|
-
router
|
|
179
|
+
await navigateWithMigrationGuard(router, { name: "settingOrganization" });
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
const loadMoreTeams = () => {
|
|
@@ -250,7 +250,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
250
250
|
};
|
|
251
251
|
return (_ctx, _cache) => {
|
|
252
252
|
return openBlock(), createElementBlock("ul", _hoisted_1, [
|
|
253
|
-
|
|
253
|
+
__props.type === "project" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
254
254
|
createElementVNode("div", _hoisted_2, [
|
|
255
255
|
_cache[17] || (_cache[17] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
256
256
|
createElementVNode("span", _hoisted_3, [
|
|
@@ -311,7 +311,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
311
311
|
}, 8, ["modelValue", "placeholder"])
|
|
312
312
|
], 2)
|
|
313
313
|
], 64)) : createCommentVNode("", true),
|
|
314
|
-
|
|
314
|
+
__props.type === "team" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
315
315
|
createElementVNode("div", _hoisted_4, [
|
|
316
316
|
_cache[18] || (_cache[18] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
317
317
|
createElementVNode("span", _hoisted_5, [
|
|
@@ -350,7 +350,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
350
350
|
}, 8, ["modelValue", "placeholder"])
|
|
351
351
|
], 2)
|
|
352
352
|
], 64)) : createCommentVNode("", true),
|
|
353
|
-
|
|
353
|
+
__props.type === "enterprise" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
354
354
|
createElementVNode("div", _hoisted_6, [
|
|
355
355
|
_cache[19] || (_cache[19] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
356
356
|
createElementVNode("span", _hoisted_7, [
|
|
@@ -399,10 +399,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
399
399
|
"data-openBlank": true,
|
|
400
400
|
"data-href": unref(transformUrl)(unref(transWebUrl)(item.web_url)),
|
|
401
401
|
class: "text",
|
|
402
|
-
title:
|
|
402
|
+
title: __props.type === "project" ? `${item.namespace}/${item.label}` : item.label
|
|
403
403
|
}, {
|
|
404
404
|
icon: withCtx(() => [
|
|
405
|
-
|
|
405
|
+
__props.type === "project" ? (openBlock(), createBlock(GIcon, {
|
|
406
406
|
key: 0,
|
|
407
407
|
name: "gt-line-project",
|
|
408
408
|
color: "var(--theme-menu-icon-fill)",
|
|
@@ -417,7 +417,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
417
417
|
}, null, 8, ["src", "name", "class"]))
|
|
418
418
|
]),
|
|
419
419
|
default: withCtx(() => [
|
|
420
|
-
|
|
420
|
+
__props.type === "project" ? (openBlock(), createElementBlock("span", _hoisted_8, [
|
|
421
421
|
createElementVNode("span", _hoisted_9, toDisplayString((item.namespace || "").slice(0, 10)) + toDisplayString((item.namespace || "").length > 10 ? "..." : ""), 1),
|
|
422
422
|
createElementVNode("span", _hoisted_10, "/" + toDisplayString(item.label), 1)
|
|
423
423
|
])) : (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(item.label), 1))
|
|
@@ -425,14 +425,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
425
425
|
_: 2
|
|
426
426
|
}, 1032, ["data-href", "title"]);
|
|
427
427
|
}), 128)),
|
|
428
|
-
|
|
428
|
+
__props.type !== "enterprise" && !totalNum.value && !firstLoading.value ? (openBlock(), createBlock(unref(Button), {
|
|
429
429
|
key: 4,
|
|
430
430
|
variant: "text",
|
|
431
431
|
class: "more-btn",
|
|
432
432
|
onClick: withModifiers(createRepoOrOrg, ["stop"])
|
|
433
433
|
}, {
|
|
434
434
|
default: withCtx(() => [
|
|
435
|
-
createTextVNode(toDisplayString(
|
|
435
|
+
createTextVNode(toDisplayString(__props.buttonText), 1)
|
|
436
436
|
]),
|
|
437
437
|
_: 1
|
|
438
438
|
})) : createCommentVNode("", true),
|
|
@@ -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, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createVNode, withModifiers, normalizeClass, withCtx, createBlock, createCommentVNode, Fragment, renderList, createTextVNode, withDirectives, vShow } from "vue";
|
|
2
|
+
import { a as i18n, z as useLayoutConfig, t as transformUrl, G as GIcon, M as asideRequest, K as navigateWithMigrationGuard, H as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-BBdEwjQ0.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-DlK6GU_m.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";
|
|
@@ -26,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
props: {
|
|
27
27
|
buttonText: { default: "" },
|
|
28
28
|
subShow: { type: Boolean, default: false },
|
|
29
|
-
defaultData: {},
|
|
29
|
+
defaultData: { default: () => ({ loading: false }) },
|
|
30
30
|
isLogin: { type: Boolean, default: false },
|
|
31
31
|
username: { default: "" }
|
|
32
32
|
},
|
|
@@ -113,8 +113,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
}, 200);
|
|
114
114
|
};
|
|
115
115
|
const router = useRouter();
|
|
116
|
-
const fastToLink = () => {
|
|
117
|
-
router
|
|
116
|
+
const fastToLink = async () => {
|
|
117
|
+
await navigateWithMigrationGuard(router, { name: "userRepos", params: { namespace: props.username } });
|
|
118
118
|
};
|
|
119
119
|
const handleOpenSearch = () => {
|
|
120
120
|
if (!props.isLogin) {
|
|
@@ -220,7 +220,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
220
220
|
onClick: withModifiers(createRepoOrOrg, ["stop"])
|
|
221
221
|
}, {
|
|
222
222
|
default: withCtx(() => [
|
|
223
|
-
createTextVNode(toDisplayString(
|
|
223
|
+
createTextVNode(toDisplayString(__props.buttonText), 1)
|
|
224
224
|
]),
|
|
225
225
|
_: 1
|
|
226
226
|
})) : createCommentVNode("", true),
|
|
@@ -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 { defineComponent, ref, inject, computed, withDirectives, openBlock, createElementBlock, 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-BBdEwjQ0.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";
|
|
@@ -8,16 +8,21 @@ const _hoisted_2 = { class: "history-list-project-globartitle history-list-proje
|
|
|
8
8
|
const _hoisted_3 = ["href"];
|
|
9
9
|
const _hoisted_4 = { class: "history-list-project-globarbox" };
|
|
10
10
|
const _hoisted_5 = { class: "ellipsis history-list-project__name" };
|
|
11
|
-
const _sfc_main = /* @__PURE__ */
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...{ name: "SearchFileList" },
|
|
12
13
|
__name: "ProjectSearch",
|
|
13
|
-
props:
|
|
14
|
+
props: {
|
|
15
|
+
searchStr: {},
|
|
16
|
+
searchInfo: {},
|
|
17
|
+
isSearchPage: { type: Boolean }
|
|
18
|
+
},
|
|
14
19
|
setup(__props) {
|
|
15
20
|
const { t: $t } = i18n.global;
|
|
16
21
|
const props = __props;
|
|
17
22
|
const filedList = ref([]);
|
|
18
23
|
const route = useRoute();
|
|
19
24
|
const router = useRouter();
|
|
20
|
-
const API = headRequest(inject("request"));
|
|
25
|
+
const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
|
|
21
26
|
const loadFileList = async () => {
|
|
22
27
|
var _a, _b, _c;
|
|
23
28
|
if (!((_a = props == null ? void 0 : props.searchInfo) == null ? void 0 : _a.searchScopeName)) return;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent, computed,
|
|
2
|
-
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers, createCommentVNode } from "vue";
|
|
2
|
+
import { a as i18n, n as normalizeSearchHistoryEntry, G as GIcon, _ as _export_sfc } from "./index-BBdEwjQ0.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" };
|
|
6
6
|
const _hoisted_2 = ["onClick", "onMouseenter"];
|
|
7
7
|
const _hoisted_3 = { class: "history-list-box__content" };
|
|
8
|
-
const _hoisted_4 = { class: "history-list-
|
|
8
|
+
const _hoisted_4 = { class: "history-list-box__prefix" };
|
|
9
9
|
const _hoisted_5 = ["title"];
|
|
10
10
|
const _hoisted_6 = ["title"];
|
|
11
|
-
const _hoisted_7 = { class: "item-tx" };
|
|
12
|
-
const _hoisted_8 = { class: "history-list-box__type
|
|
11
|
+
const _hoisted_7 = { class: "history-list-box__keyword item-tx" };
|
|
12
|
+
const _hoisted_8 = { class: "history-list-box__type" };
|
|
13
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
14
|
__name: "SearchHistoryList",
|
|
15
15
|
props: {
|
|
@@ -42,6 +42,11 @@ 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-plane-column1",
|
|
48
|
+
hoverIcon: "gt-plane-column-red"
|
|
49
|
+
},
|
|
45
50
|
model: {
|
|
46
51
|
text: t("gitCodeLayout.aihub.model"),
|
|
47
52
|
icon: "gt-plane-Models",
|
|
@@ -83,11 +88,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
83
88
|
hoverIcon: "gt-plane-topic-red"
|
|
84
89
|
}
|
|
85
90
|
};
|
|
86
|
-
|
|
91
|
+
const type = normalizeSearchHistoryEntry(item).type;
|
|
92
|
+
return typeMap[type] || typeMap["repo"];
|
|
87
93
|
};
|
|
88
94
|
const historyList = computed(() => {
|
|
89
95
|
var _a;
|
|
90
|
-
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) =>
|
|
96
|
+
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) => normalizeSearchHistoryEntry(raw)).filter((item) => item == null ? void 0 : item.q).map((item) => {
|
|
91
97
|
const repoTitle = item.repo ? `${t("gitCodeLayout.header.repo")} ${decodeURIComponent(item.repo)}:` : "";
|
|
92
98
|
const userVal = item.user || (item.scope === "user" ? item.namespace : "");
|
|
93
99
|
const orgVal = item.org || (item.scope === "user" ? "" : item.namespace);
|
|
@@ -100,9 +106,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
100
106
|
return { ...item, repoTitle, namespaceTitle };
|
|
101
107
|
});
|
|
102
108
|
});
|
|
103
|
-
computed(() => {
|
|
104
|
-
return props.visitHistoryList;
|
|
105
|
-
});
|
|
106
109
|
const resetIndex = () => {
|
|
107
110
|
emits("resetIndex");
|
|
108
111
|
};
|
|
@@ -117,15 +120,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
120
|
};
|
|
118
121
|
return (_ctx, _cache) => {
|
|
119
122
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
120
|
-
|
|
123
|
+
__props.searchHistoryList.length ? (openBlock(), createElementBlock("ul", {
|
|
121
124
|
key: 0,
|
|
122
125
|
class: "history-list-box history-list-box--mt",
|
|
123
126
|
onMouseleave: resetIndex
|
|
124
127
|
}, [
|
|
125
128
|
(openBlock(true), createElementBlock(Fragment, null, renderList(historyList.value, (item, index) => {
|
|
126
129
|
return openBlock(), createElementBlock("li", {
|
|
127
|
-
key: item
|
|
128
|
-
class: normalizeClass(
|
|
130
|
+
key: `${item.q}-${item.type || "repo"}-${index}`,
|
|
131
|
+
class: normalizeClass(__props.activeIndex === index ? "hoverbg" : ""),
|
|
129
132
|
onClick: ($event) => toSearch(item),
|
|
130
133
|
onMouseenter: ($event) => onSearchEnter(index)
|
|
131
134
|
}, [
|
|
@@ -148,10 +151,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
151
|
]),
|
|
149
152
|
createElementVNode("div", _hoisted_8, [
|
|
150
153
|
createElementVNode("span", {
|
|
151
|
-
class: normalizeClass(
|
|
154
|
+
class: normalizeClass(__props.activeIndex === index ? "history-list-box__type-text--active" : "history-list-box__type-text")
|
|
152
155
|
}, toDisplayString(getRepoType(item).text), 3),
|
|
153
156
|
createVNode(GIcon, {
|
|
154
|
-
name:
|
|
157
|
+
name: __props.activeIndex === index ? getRepoType(item).hoverIcon : getRepoType(item).icon
|
|
155
158
|
}, null, 8, ["name"])
|
|
156
159
|
])
|
|
157
160
|
]),
|
|
@@ -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, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
|
|
2
|
+
import { u as useReportRepo, S as SearchRepoCard } from "./useReportRepo-DKt0C5mO.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-BBdEwjQ0.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,7 +57,6 @@ 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,
|
|
61
60
|
item,
|
|
62
61
|
index
|
|
63
62
|
}, () => [
|
|
@@ -72,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
71
|
cardType: (item == null ? void 0 : item.repo_type) || "repo",
|
|
73
72
|
"url-params": { source_module: "search_box_discovery" }
|
|
74
73
|
}, null, 8, ["info", "onReport", "cardType"]))
|
|
75
|
-
], true);
|
|
74
|
+
], true, item.id);
|
|
76
75
|
}), 128))
|
|
77
76
|
])) : (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
78
77
|
(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, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, toDisplayString, createCommentVNode, unref } from "vue";
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-BBdEwjQ0.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = ["onClick"];
|
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
};
|
|
26
26
|
return (_ctx, _cache) => {
|
|
27
27
|
return openBlock(), createElementBlock("ul", null, [
|
|
28
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
28
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.searchScopeList, (item, index) => {
|
|
29
29
|
return openBlock(), createElementBlock("li", {
|
|
30
30
|
key: index,
|
|
31
31
|
class: "g-header-search-scopechoose",
|
|
@@ -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 { defineComponent, inject, ref, watch, withDirectives, openBlock, createElementBlock, 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-BBdEwjQ0.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" };
|
|
@@ -7,12 +7,15 @@ const _hoisted_2 = { class: "history-list-project-globartitle history-list-proje
|
|
|
7
7
|
const _hoisted_3 = ["href"];
|
|
8
8
|
const _hoisted_4 = { class: "history-list-project-globarbox" };
|
|
9
9
|
const _hoisted_5 = { class: "ellipsis history-list-project__name" };
|
|
10
|
-
const _sfc_main = {
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
11
|
__name: "UserSearch",
|
|
12
|
-
props:
|
|
12
|
+
props: {
|
|
13
|
+
searchStr: {},
|
|
14
|
+
searchInfo: {}
|
|
15
|
+
},
|
|
13
16
|
setup(__props) {
|
|
14
17
|
const { t: $t } = i18n.global;
|
|
15
|
-
const API = headRequest(inject("request"));
|
|
18
|
+
const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
|
|
16
19
|
const props = __props;
|
|
17
20
|
const loading = ref(false);
|
|
18
21
|
const searchFileList = ref([]);
|
|
@@ -41,14 +44,14 @@ const _sfc_main = {
|
|
|
41
44
|
search: props.searchStr
|
|
42
45
|
}).then((res) => {
|
|
43
46
|
const data = res.data || {};
|
|
44
|
-
searchFileList.value = data.content.map((item) => {
|
|
47
|
+
searchFileList.value = (data.content || []).map((item) => {
|
|
45
48
|
return {
|
|
46
49
|
...item,
|
|
47
|
-
web_url: transformUrl(item.web_url),
|
|
48
|
-
ssh_url_to_repo: transformUrl(item.ssh_url_to_repo),
|
|
49
|
-
http_url_to_repo: transformUrl(item.http_url_to_repo),
|
|
50
|
-
readme_url: transformUrl(item.readme_url),
|
|
51
|
-
avatar_url: transformUrl(item.avatar_url)
|
|
50
|
+
web_url: transformUrl(item.web_url || ""),
|
|
51
|
+
ssh_url_to_repo: transformUrl(item.ssh_url_to_repo || ""),
|
|
52
|
+
http_url_to_repo: transformUrl(item.http_url_to_repo || ""),
|
|
53
|
+
readme_url: transformUrl(item.readme_url || ""),
|
|
54
|
+
avatar_url: transformUrl(item.avatar_url || "")
|
|
52
55
|
};
|
|
53
56
|
}) || [];
|
|
54
57
|
}).finally(() => {
|
|
@@ -88,7 +91,7 @@ const _sfc_main = {
|
|
|
88
91
|
]);
|
|
89
92
|
};
|
|
90
93
|
}
|
|
91
|
-
};
|
|
94
|
+
});
|
|
92
95
|
export {
|
|
93
96
|
_sfc_main as default
|
|
94
97
|
};
|