Skip to content

Commit 38b462e

Browse files
style: 修改文件和应用商店样式 (#2184)
1 parent c588c34 commit 38b462e

File tree

3 files changed

+61
-43
lines changed

3 files changed

+61
-43
lines changed

frontend/src/api/interface/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export namespace App {
1212
source: string;
1313
type: string;
1414
status: string;
15+
limit: number;
1516
}
1617

1718
export interface AppDTO extends App {

frontend/src/views/app-store/apps/index.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
:xl="8"
6060
>
6161
<div class="app-card">
62-
<el-card class="e-card">
62+
<el-card class="e-card" @click.stop="openDetail(app.key)">
6363
<el-row :gutter="20">
6464
<el-col :xs="8" :sm="6" :md="6" :lg="6" :xl="5">
6565
<div class="app-icon-container">
66-
<div class="app-icon" @click="openDetail(app.key)">
66+
<div class="app-icon">
6767
<el-avatar
6868
shape="square"
6969
:size="60"
@@ -85,8 +85,10 @@
8585
plain
8686
round
8787
size="small"
88-
@click="openInstall(app)"
89-
:disabled="app.status === 'TakeDown'"
88+
:disabled="
89+
(app.installed && app.limit == 1) || app.status === 'TakeDown'
90+
"
91+
@click.stop="openInstall(app)"
9092
>
9193
{{ $t('app.install') }}
9294
</el-button>
@@ -274,15 +276,15 @@ onMounted(() => {
274276
margin-left: 15px;
275277
}
276278
279+
&:hover .app-icon {
280+
transform: scale(1.2);
281+
}
282+
277283
.app-icon {
278284
transition: transform 0.1s;
279285
transform-origin: center center;
280286
}
281287
282-
.app-icon:hover {
283-
transform: scale(1.2);
284-
}
285-
286288
.app-content {
287289
margin-top: 10px;
288290
height: 100%;

frontend/src/views/host/file-management/index.vue

Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
<template>
22
<div>
3-
<el-row>
4-
<el-col :span="2">
5-
<div>
6-
<el-button :icon="Back" @click="back" circle :disabled="paths.length == 0" />
7-
<el-button :icon="Refresh" circle @click="search" />
8-
</div>
9-
</el-col>
10-
<el-col :span="22">
11-
<div v-show="!searchableStatus" tabindex="0" @click="searchableStatus = true">
12-
<div class="path" ref="pathRef">
13-
<span ref="breadCrumbRef">
14-
<span class="root">
15-
<el-link @click.stop="jump('/')">
16-
<el-icon :size="20"><HomeFilled /></el-icon>
17-
</el-link>
18-
</span>
19-
<span v-for="item in paths" :key="item.url" class="other">
20-
<span class="split">></span>
21-
<el-link @click.stop="jump(item.url)">{{ item.name }}</el-link>
22-
</span>
3+
<div class="flex items-center">
4+
<div class="flex-shrink-0 flex items-center mr-4">
5+
<el-button :icon="Back" @click="back" circle :disabled="paths.length == 0" />
6+
<el-button :icon="Refresh" circle @click="search" />
7+
</div>
8+
<div
9+
v-show="!searchableStatus"
10+
tabindex="0"
11+
@click="searchableStatus = true"
12+
class="address-bar bg-white shadow-md rounded-md px-4 py-2 flex items-center flex-grow"
13+
>
14+
<div ref="pathRef" class="w-full">
15+
<span ref="breadCrumbRef" class="w-full flex items-center">
16+
<span class="root mr-2">
17+
<el-link @click.stop="jump('/')">
18+
<el-icon :size="20"><HomeFilled /></el-icon>
19+
</el-link>
2320
</span>
24-
</div>
21+
<span v-for="path in paths" :key="path.url" class="inline-flex items-center">
22+
<span class="mr-2">></span>
23+
<el-link class="path-segment cursor-pointer mr-2 pathname" @click.stop="jump(path.url)">
24+
{{ path.name }}
25+
</el-link>
26+
</span>
27+
</span>
2528
</div>
26-
<el-input
27-
ref="searchableInputRef"
28-
v-show="searchableStatus"
29-
v-model="searchablePath"
30-
@blur="searchableInputBlur"
31-
@keyup.enter="
32-
jump(searchablePath);
33-
searchableStatus = false;
34-
"
35-
/>
36-
</el-col>
37-
</el-row>
29+
</div>
30+
<el-input
31+
ref="searchableInputRef"
32+
v-show="searchableStatus"
33+
v-model="searchablePath"
34+
@blur="searchableInputBlur"
35+
class="px-4 py-2 bg-white border rounded-md shadow-md"
36+
@keyup.enter="
37+
jump(searchablePath);
38+
searchableStatus = false;
39+
"
40+
/>
41+
</div>
3842
<LayoutContent :title="$t('file.file')" v-loading="loading">
3943
<template #toolbar>
4044
<el-dropdown @command="handleCreate">
@@ -338,7 +342,14 @@ const copyDir = (row: File.File) => {
338342
};
339343
340344
const handlePath = () => {
341-
if (breadCrumbRef.value.offsetWidth > pathWidth.value) {
345+
const breadcrumbElement = breadCrumbRef.value as any;
346+
const pathNodes = breadcrumbElement.querySelectorAll('.pathname');
347+
348+
let totalpathWidth = 0;
349+
pathNodes.forEach((node) => {
350+
totalpathWidth += node.offsetWidth;
351+
});
352+
if (totalpathWidth > pathWidth.value) {
342353
paths.value.splice(0, 1);
343354
paths.value[0].name = '..';
344355
nextTick(function () {
@@ -628,8 +639,12 @@ onMounted(() => {
628639
getPaths(req.path);
629640
}
630641
}
631-
pathWidth.value = pathRef.value.offsetWidth * 0.7;
642+
pathWidth.value = pathRef.value.offsetWidth;
632643
search();
644+
645+
nextTick(function () {
646+
handlePath();
647+
});
633648
});
634649
</script>
635650

0 commit comments

Comments
 (0)