|
42 | 42 | </div> |
43 | 43 | </div> |
44 | 44 |
|
| 45 | + <!-- 下载进度 --> |
| 46 | + <div v-if="isDownloading && downloadProgress" class="p-2 bg-blue-50 dark:bg-blue-900/20 rounded-lg space-y-2"> |
| 47 | + <div class="flex items-center justify-between"> |
| 48 | + <div class="flex items-center space-x-2"> |
| 49 | + <svg class="animate-spin h-4 w-4 text-blue-600 dark:text-blue-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"> |
| 50 | + <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> |
| 51 | + <path class="opacity-75" fill="currentColor" |
| 52 | + d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> |
| 53 | + </svg> |
| 54 | + <span class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 55 | + {{ downloadStatusText }} |
| 56 | + </span> |
| 57 | + </div> |
| 58 | + <span class="text-sm font-semibold text-blue-600 dark:text-blue-400"> |
| 59 | + {{ downloadProgress.percentage.toFixed(1) }}% |
| 60 | + </span> |
| 61 | + </div> |
| 62 | + <div class="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2"> |
| 63 | + <div class="bg-blue-600 dark:bg-blue-400 h-2 rounded-full transition-all duration-300" |
| 64 | + :style="{ width: `${downloadProgress.percentage}%` }"> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + |
45 | 69 | <!-- 获取可用版本错误信息 --> |
46 | 70 | <div v-if="environmentInfo?.error" class="p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg"> |
47 | 71 | <div class="flex items-center space-x-2 text-yellow-600 dark:text-yellow-400"> |
|
56 | 80 | <!-- 已安装版本 --> |
57 | 81 | <template #installed> |
58 | 82 | <div v-if="environmentInfo.installed_versions.length > 0" class="space-y-2"> |
59 | | - <div :class="environmentInfo.error ? 'max-h-76' : 'max-h-92'" |
| 83 | + <div :class="environmentInfo.error || error ? 'max-h-76' : 'max-h-92'" |
60 | 84 | class="space-y-2 overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-transparent"> |
61 | 85 | <div v-for="version in environmentInfo.installed_versions" |
62 | 86 | :key="version.version" |
|
86 | 110 | <!-- 可用版本 --> |
87 | 111 | <template #available> |
88 | 112 | <div class="space-y-2"> |
89 | | - <!-- 下载进度 --> |
90 | | - <div v-if="isDownloading && downloadProgress" class="p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg space-y-2"> |
91 | | - <div class="flex items-center justify-between"> |
92 | | - <div class="flex items-center space-x-2"> |
93 | | - <svg class="animate-spin h-4 w-4 text-blue-600 dark:text-blue-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"> |
94 | | - <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> |
95 | | - <path class="opacity-75" fill="currentColor" |
96 | | - d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> |
97 | | - </svg> |
98 | | - <span class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
99 | | - {{ downloadStatusText }} |
100 | | - </span> |
101 | | - </div> |
102 | | - <span class="text-sm font-semibold text-blue-600 dark:text-blue-400"> |
103 | | - {{ downloadProgress.percentage.toFixed(1) }}% |
104 | | - </span> |
105 | | - </div> |
106 | | - <div class="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2"> |
107 | | - <div class="bg-blue-600 dark:bg-blue-400 h-2 rounded-full transition-all duration-300" |
108 | | - :style="{ width: `${downloadProgress.percentage}%` }"> |
109 | | - </div> |
110 | | - </div> |
111 | | - </div> |
112 | | - |
113 | | - <div :class="environmentInfo.error ? 'max-h-76' : 'max-h-92'" |
| 113 | + <div :class="environmentInfo.error || error ? 'max-h-76' : 'max-h-92'" |
114 | 114 | class="space-y-2 overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-transparent"> |
115 | 115 | <div v-for="version in availableVersionsToShow" |
116 | 116 | :key="version.version" |
|
0 commit comments