mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: update
This commit is contained in:
parent
a521e041a7
commit
d27a1833cd
@ -37,6 +37,7 @@ interface AppState {
|
||||
isMobile: boolean;
|
||||
reloadTimer: Nullable<IntervalHandle>;
|
||||
activateMenus: MenuOptions[];
|
||||
allMenus: MenuOptions[];
|
||||
}
|
||||
|
||||
export const appStore = defineStore({
|
||||
@ -58,6 +59,7 @@ export const appStore = defineStore({
|
||||
isMobile: false,
|
||||
reloadTimer: null,
|
||||
activateMenus: [],
|
||||
allMenus: [],
|
||||
}),
|
||||
getters: {
|
||||
duration(): Duration {
|
||||
@ -163,7 +165,8 @@ export const appStore = defineStore({
|
||||
},
|
||||
async getActivateMenus() {
|
||||
const resp = (await this.queryMenuItems()) || {};
|
||||
const menus = (resp.getMenuItems || []).map((d: MenuOptions, index: number) => {
|
||||
this.allMenus = resp.getMenuItems || [];
|
||||
const menus = this.allMenus.map((d: MenuOptions, index: number) => {
|
||||
const t = `${d.title.replace(/\s+/g, "-")}`;
|
||||
d.name = `${t}-${index}`;
|
||||
d.path = `/${t}`;
|
||||
|
@ -18,13 +18,15 @@ limitations under the License. -->
|
||||
<div class="mr-20 mt-10 flex-h category">
|
||||
<el-card
|
||||
class="item"
|
||||
v-for="(menu, index) in appStore.activateMenus"
|
||||
v-for="(menu, index) in appStore.allMenus"
|
||||
:key="index"
|
||||
@click="handleItems(menu)"
|
||||
:class="currentItems.name === menu.name ? 'active' : ''"
|
||||
>
|
||||
<router-link :to="menu.hasGroup ? '' : menu.path || ''">
|
||||
<div class="title" :class="menu.hasGroup ? '' : 'actived-font'"> {{ menu.title }}</div>
|
||||
<router-link :to="menu.hasGroup || !menu.activate ? '' : menu.path || ''">
|
||||
<div class="title" :class="menu.activate ? (menu.hasGroup ? '' : 'actived-font') : 'disabled'">
|
||||
{{ menu.title }}</div
|
||||
>
|
||||
</router-link>
|
||||
<div class="mt-10"> {{ menu.description }} </div>
|
||||
<el-link :href="menu.documentLink" target="_blank" class="link" v-show="menu.documentLink">
|
||||
@ -34,8 +36,8 @@ limitations under the License. -->
|
||||
</div>
|
||||
<div class="mt-10 cards">
|
||||
<el-card shadow="hover" v-for="(item, index) in currentItems.subItems || []" :key="index" class="card">
|
||||
<router-link :to="item.path || ''">
|
||||
<div class="title actived-font"> {{ item.title }}</div>
|
||||
<router-link :to="item.activate ? item.path || '' : ''">
|
||||
<div class="title" :class="item.activate ? 'actived-font' : 'disabled'"> {{ item.title }}</div>
|
||||
</router-link>
|
||||
<div class="mt-10"> {{ item.description }} </div>
|
||||
<el-link :href="item.documentLink" target="_blank" class="link" v-show="item.documentLink">
|
||||
@ -86,6 +88,10 @@ limitations under the License. -->
|
||||
color: $active-color;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-bottom: 30px;
|
||||
cursor: pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user