|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +<template> |
| 19 | + <span v-if="$config.plugins.some(item => item.path && item.isExternalLink)"> |
| 20 | + <span class="action" v-if="$config.plugins.length == 1"> |
| 21 | + <a-tooltip placement="bottom"> |
| 22 | + <template #title> |
| 23 | + {{ $t('label.redirect') + ' ' + ( $config.plugins[0].name || $config.plugins[0].path) }} |
| 24 | + </template> |
| 25 | + <a-button shape="circle" > |
| 26 | + <a :href=" $config.plugins[0].path" target="_blank"> |
| 27 | + <img v-if="$config.plugins[0].icon" :src="$config.plugins[0].icon" :style="{height: '24px', padding: '2px', align: 'center'}"/> |
| 28 | + <link-outlined v-else/> |
| 29 | + </a> |
| 30 | + </a-button> |
| 31 | + </a-tooltip> |
| 32 | + </span> |
| 33 | + <a-dropdown v-else-if="$config.plugins.length > 1 && $config.plugins.some(item => item.path && item.isExternalLink)"> |
| 34 | + <span class="action ant-dropdown-link"> |
| 35 | + <a-button shape="circle" > |
| 36 | + <link-outlined/> |
| 37 | + </a-button> |
| 38 | + </span> |
| 39 | + <template #overlay> |
| 40 | + <a-menu class="user-menu-wrapper"> |
| 41 | + <span v-for="external in $config.plugins" :key="external.isExternalLink"> |
| 42 | + <a-menu-item v-if="external.path && external.isExternalLink=='true'" :key="external.isExternalLink"> |
| 43 | + <a :href="external.path" target="_blank"> |
| 44 | + <img v-if="external.icon" :src="external.icon" :style="{ height: '18px', width: '18px', align: 'center' }"/> |
| 45 | + <link-outlined v-else/> |
| 46 | + {{ external.name || external.path }} |
| 47 | + </a> |
| 48 | + </a-menu-item> |
| 49 | + </span> |
| 50 | + </a-menu> |
| 51 | + </template> |
| 52 | + </a-dropdown> |
| 53 | + </span> |
| 54 | +</template> |
0 commit comments