feat: add a Spanish option in the lang selector (#98)

This commit is contained in:
Fine0830 2022-05-24 11:53:41 +08:00 committed by GitHub
parent 45f896bf36
commit b34c0b0c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 6 deletions

View File

@ -23,6 +23,7 @@ export enum TimeType {
export const Languages = [ export const Languages = [
{ label: "English", value: "en" }, { label: "English", value: "en" },
{ label: "Chinese", value: "zh" }, { label: "Chinese", value: "zh" },
{ label: "Spanish", value: "es" },
]; ];
export const RoutesMap: { [key: string]: string } = { export const RoutesMap: { [key: string]: string } = {

View File

@ -41,7 +41,7 @@ limitations under the License. -->
<el-icon class="menu-icons" :style="{ marginRight: '12px' }"> <el-icon class="menu-icons" :style="{ marginRight: '12px' }">
<Icon size="lg" :iconName="menu.meta.icon" /> <Icon size="lg" :iconName="menu.meta.icon" />
</el-icon> </el-icon>
<span :class="isCollapse ? 'collapse' : ''"> <span class="title" :class="isCollapse ? 'collapse' : ''">
{{ t(menu.meta.title) }} {{ t(menu.meta.title) }}
</span> </span>
</router-link> </router-link>
@ -57,7 +57,7 @@ limitations under the License. -->
:to="m.path" :to="m.path"
:exact="m.meta.exact || false" :exact="m.meta.exact || false"
> >
<span>{{ t(m.meta.title) }}</span> <span class="title">{{ t(m.meta.title) }}</span>
</router-link> </router-link>
</el-menu-item> </el-menu-item>
</el-menu-item-group> </el-menu-item-group>
@ -82,7 +82,7 @@ limitations under the License. -->
:to="menu.children[0].path" :to="menu.children[0].path"
:exact="menu.meta.exact" :exact="menu.meta.exact"
> >
<span>{{ t(menu.meta.title) }}</span> <span class="title">{{ t(menu.meta.title) }}</span>
</router-link> </router-link>
</template> </template>
</el-menu-item> </el-menu-item>
@ -208,4 +208,11 @@ span.collapse {
width: 100%; width: 100%;
height: 60px; height: 60px;
} }
.title {
display: inline-block;
max-width: 110px;
text-overflow: ellipsis;
overflow: hidden;
}
</style> </style>

View File

@ -17,10 +17,12 @@
import { createI18n } from "vue-i18n"; import { createI18n } from "vue-i18n";
import zh from "./lang/zh"; import zh from "./lang/zh";
import en from "./lang/en"; import en from "./lang/en";
import es from "./lang/es";
const messages = { const messages = {
en, en,
zh, zh,
es,
}; };
const savedLanguage = window.localStorage.getItem("language"); const savedLanguage = window.localStorage.getItem("language");

View File

@ -194,10 +194,11 @@ const setUTCMin = () => {
} }
.label { .label {
width: 160px; width: 180px;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
color: #000; color: #000;
line-height: 25px;
} }
} }
</style> </style>

View File

@ -68,12 +68,13 @@ function drawGraph() {
root.value = param[0]; root.value = param[0];
root.dumpCount = param[1]; root.dumpCount = param[1];
stackTree.value = root; stackTree.value = root;
const w = (graph.value && graph.value.getBoundingClientRect().width) || 10; const width = (graph.value && graph.value.getBoundingClientRect().width) || 0;
const w = width < 800 ? 802 : width;
flameChart.value = flamegraph() flameChart.value = flamegraph()
.width(w - 15) .width(w - 15)
.cellHeight(18) .cellHeight(18)
.transitionDuration(750) .transitionDuration(750)
.minFrameSize(5) .minFrameSize(1)
.transitionEase(d3.easeCubic as any) .transitionEase(d3.easeCubic as any)
.sort(true) .sort(true)
.title("") .title("")