Skip to content

Commit 37e237a

Browse files
committed
redesign manager home page
1 parent b752e55 commit 37e237a

File tree

21 files changed

+353
-282
lines changed

21 files changed

+353
-282
lines changed

locales/en-US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"fetching": "fetching",
6464
"finish": "Finish",
6565
"general": "General",
66+
"available_toolkit": "Available Toolkit",
6667
"handling_extension_info": "%{op}ing extension '%{ext}' for program '%{program}'",
6768
"insecure_download": "skipping SSL certificate verification (requested by `--insecure` flag)",
6869
"insecure_http_override": "using 'http' schema to skip SSL certificate verification (requested by `--insecure` flag)",
@@ -83,6 +84,7 @@
8384
"install_via_cargo": "Installing third-party tools via cargo...",
8485
"installation_path": "Installation path",
8586
"installed": "installed",
87+
"current_toolkit": "Current Toolkit",
8688
"installer": "installer",
8789
"installer_help": "installation of this tool will start a separated installer process that might needs your input.",
8890
"installing": "Installing",

locales/zh-CN.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"fetching": "正在获取",
6464
"finish": "完成",
6565
"general": "通用",
66+
"available_toolkit": "可用套件",
6667
"handling_extension_info": "正在%{op} '%{program}' 的以下插件: '%{ext}'",
6768
"insecure_download": "跳过 SSL 证书验证(根据命令行选项 'insecure' 的要求)",
6869
"insecure_http_override": "使用 “http” 跳过 SSL 证书验证(根据命令行选项 'insecure' 的要求)",
@@ -83,6 +84,7 @@
8384
"install_via_cargo": "正在通过 cargo 安装第三方工具...",
8485
"installation_path": "安装路径",
8586
"installed": "已安装",
87+
"current_toolkit": "当前套件",
8688
"installer": "安装程序",
8789
"installer_help": "此工具的安装将启动一个单独的安装程序进程,可能需要您的输入。",
8890
"installing": "正在安装",

rim_gui/src/App.vue

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, onMounted, nextTick, onBeforeUnmount } from 'vue'
2+
import { ref, onMounted, nextTick, onBeforeUnmount, computed } from 'vue'
33
import Titlebar from './components/Titlebar.vue';
44
import { invokeCommand } from './utils';
55
import { event } from '@tauri-apps/api';
@@ -9,7 +9,7 @@ import { useI18n } from 'vue-i18n';
99
const { t } = useI18n();
1010
1111
const managerMode = ref(false);
12-
const navItems = ref([
12+
const navItems = computed(() => [
1313
{
1414
name: t('manage_toolkit'),
1515
showDot: ref(false),
@@ -53,7 +53,7 @@ async function updateDots() {
5353
5454
event.listen('toolkit:update-available', (event) => {
5555
console.log("toolkit update available: ", event.payload);
56-
navItems.value[0].showDot = true;
56+
navItems.value[0].showDot.value = true;
5757
});
5858
}
5959
@@ -81,7 +81,7 @@ onBeforeUnmount(() => {
8181
<li v-for="(item, index) in navItems" :key="index" class="nav-item"
8282
:class="{ active: selectedIndex === index }" @click="selectNav(index)" ref="navRefs">
8383
{{ item.name }}
84-
<span class="red-dot" v-if="item.showDot"></span>
84+
<span class="red-dot" v-if="item.showDot.value"></span>
8585
</li>
8686
</ul>
8787
<div class="underline" :style="underlineStyle"></div>
@@ -121,6 +121,28 @@ main {
121121
margin-top: 10vh;
122122
overflow: hidden;
123123
}
124+
125+
.info-label {
126+
--uno: "c-regular";
127+
font-weight: bold;
128+
font-size: clamp(8px, 2.6vh, 22px);
129+
margin-inline: 1vw;
130+
}
131+
132+
.sub-info-label {
133+
--uno: "c-secondary";
134+
font-size: clamp(6px, 2.2vh, 20px);
135+
margin-inline: 1vw;
136+
}
137+
138+
.footer-label {
139+
--uno: c-secondary;
140+
position: fixed;
141+
font-size: 14px;
142+
text-align: center;
143+
width: 100%;
144+
bottom: 3vh;
145+
}
124146
</style>
125147

126148
<style scoped>

rim_gui/src/components/BaseButton.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,27 @@ const themeClasses = computed(() => {
1818
switch (props.theme) {
1919
case 'primary':
2020
return 'bg-primary text-white active:bg-deep-primary';
21-
case 'secondary-btn':
22-
return 'bg-secondary-btn text-header';
21+
case 'secondary':
22+
return 'bg-secondary-btn text-regular';
2323
// Add more themes as needed
2424
default:
25-
return 'bg-gray-200 text-header border-gray-400 active:bg-gray-300';
25+
return 'bg-gray-200 text-regular border-gray-400 active:bg-gray-300';
2626
}
2727
});
2828
</script>
2929

3030
<template>
31-
<button p="x-3% y-1%" :class="[
32-
themeClasses,
33-
'rounded-[30vw] b-none hover:op-80', // Common classes
34-
{ 'cursor-pointer': !disabled }, // Disabled styles
35-
{ 'opacity-50 cursor-not-allowed': disabled }, // Disabled styles
36-
]" :disabled="disabled">
31+
<button :class="[themeClasses, disabled ? 'button-disabled' : 'button-active']" :disabled="disabled">
3732
<slot></slot>
3833
</button>
3934
</template>
4035

4136
<style scoped>
4237
button {
38+
padding: 3% 2.5%;
4339
font-size: clamp(100%, 3vh, 20px);
40+
border-radius: 100px;
41+
border: none;
4442
box-shadow: 0 0 0 1px rgba(255, 255, 255, .6), 0 8px 16px rgba(0, 0, 0, .12);
4543
font-weight: bold;
4644
white-space: nowrap;
@@ -50,4 +48,18 @@ button {
5048
background-color 0.3s,
5149
border-color 0.3s;
5250
}
51+
52+
.button-active {
53+
cursor: pointer;
54+
}
55+
56+
.button-active:hover {
57+
opacity: 90%;
58+
box-shadow: 0 0 0 1px rgba(91, 155, 213, .12), 0 6px 12px rgba(91, 155, 213, .8);
59+
}
60+
61+
.button-disabled {
62+
cursor: not-allowed;
63+
opacity: 50%;
64+
}
5365
</style>

rim_gui/src/components/BaseCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="glass" :class="props.interactive ? 'interactive' : ''">
2+
<div class="glass" :class="{'interactive': props.interactive}">
33
<slot></slot>
44
</div>
55
</template>
@@ -19,7 +19,7 @@ const props = defineProps({
1919
border-radius: 20px;
2020
background: rgba(255, 255, 255, .1);
2121
border: 2px solid transparent;
22-
box-shadow: 0 0 0 2px rgba(255, 255, 255, .6), 0 16px 32px rgba(0, 0, 0, .12);
22+
box-shadow: 0 0 0 2px rgba(255, 255, 255, .6), 0 12px 16px rgba(0, 0, 0, .12);
2323
backdrop-filter: blur(25px);
2424
-webkit-backdrop-filter: blur(25px);
2525
outline: 0;
@@ -29,6 +29,6 @@ const props = defineProps({
2929
cursor: pointer;
3030
}
3131
.interactive:hover {
32-
box-shadow: 0 0 0 2px rgba(91, 155, 213, .12), 0 16px 32px rgba(91, 155, 213, .8);
32+
box-shadow: 0 0 0 2px rgba(91, 155, 213, .12), 0 12px 16px rgba(91, 155, 213, .8);
3333
}
3434
</style>

rim_gui/src/components/BaseRadioGroup.vue

Lines changed: 0 additions & 103 deletions
This file was deleted.

rim_gui/src/components/PageNavButtons.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div flex="~ items-center" position="fixed" bottom="7%">
3-
<base-button v-if="backLabel" theme="secondary-btn" position="fixed" left="0" style="transform: translateX(30%);"
3+
<base-button v-if="backLabel" theme="secondary" position="fixed" left="0" style="transform: translateX(30%);"
44
@click="backClicked">{{ backLabel }}</base-button>
55
<base-button v-if="nextLabel" theme="primary" position="fixed" right="0" style="transform: translateX(-30%);"
66
@click="nextClicked">{{ nextLabel }}</base-button>

rim_gui/src/components/Titlebar.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script setup lang="ts">
2-
import { installConf, invokeCommand } from "@/utils";
2+
import { invokeCommand } from "@/utils";
33
import { appWindow } from "@tauri-apps/api/window";
44
import { computed, onMounted, ref, shallowRef, watch } from "vue";
55
import { event } from "@tauri-apps/api";
66
import { useI18n } from "vue-i18n";
77
import SettingsLayout from "@/layouts/SettingsLayout.vue";
88
import AboutLayout from "@/layouts/AboutLayout.vue";
99
import HelpLayout from "@/layouts/HelpLayout.vue";
10+
import { getAppNameWithVersion } from "@/utils/common";
1011
1112
interface MenuItem {
1213
icon?: string,
@@ -94,7 +95,7 @@ onMounted(async () => {
9495
}
9596
});
9697
97-
appTitle.value = await installConf.appNameWithShortVersion();
98+
appTitle.value = (await getAppNameWithVersion()).join(' ');
9899
});
99100
100101
watch(locale, (_) => refreshLabels());

rim_gui/src/layouts/AboutLayout.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
</template>
3232

3333
<script setup lang="ts">
34-
import { installConf, invokeCommand } from '@/utils';
34+
import { invokeCommand } from '@/utils';
35+
import { getAppNameWithVersion } from '@/utils/common';
3536
import { shell } from '@tauri-apps/api';
3637
import { onMounted, ref } from 'vue';
3738
@@ -55,7 +56,10 @@ async function openOfficialSite() {
5556
5657
async function refreshLabels() {
5758
labels.value.logoText = await invokeCommand('get_build_cfg_locale_str', { key: 'logo_text' }) as string;
58-
labels.value.appName = await invokeCommand('get_build_cfg_locale_str', { key: 'app_name' }) as string;
59+
60+
const nameAndVer = await getAppNameWithVersion();
61+
labels.value.appName = nameAndVer[0];
62+
rimVersion.value = nameAndVer[1];
5963
}
6064
6165
async function fetchContributors() {
@@ -96,10 +100,6 @@ async function fetchContributors() {
96100
onMounted(async () => {
97101
await refreshLabels();
98102
await fetchContributors();
99-
100-
if (installConf.info.value) {
101-
rimVersion.value = installConf.info.value.version;
102-
}
103103
});
104104
</script>
105105

rim_gui/src/theme/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import BaseDetails from '@/components/BaseDetails.vue';
1515
import SplitBox from '@/components/SplitBox.vue';
1616
import LabeledInput from '@/components/LabeledInput.vue';
1717
import BasePanel from '@/components/BasePanel.vue';
18-
import BaseRadioGroup from '@/components/BaseRadioGroup.vue';
1918
import BaseSelect from '@/components/BaseSelect.vue';
2019

2120
export default {
@@ -37,6 +36,5 @@ export default {
3736
app.component('labeled-input', LabeledInput);
3837
app.component('base-panel', BasePanel);
3938
app.component('base-select', BaseSelect);
40-
app.component('base-radio-group', BaseRadioGroup);
4139
},
4240
};

0 commit comments

Comments
 (0)