提交 0f136bfa 编写于 作者: W WeiFeng-mindinsight

UI support display in English

上级 4035f361
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -28,11 +28,26 @@ limitations under the License. ...@@ -28,11 +28,26 @@ limitations under the License.
:default-active="getActive()" :default-active="getActive()"
class="el-menu-demo" class="el-menu-demo"
mode="horizontal"> mode="horizontal">
<el-menu-item index="/summary-manage">{{$t("summaryManage.summaryList")}}</el-menu-item> <el-menu-item index="/summary-manage"
<el-menu-item index="/model-traceback">{{$t("summaryManage.modelTraceback")}}</el-menu-item> :title='$t("summaryManage.summaryList")'>
<el-menu-item index="/data-traceback">{{$t("summaryManage.dataTraceback")}}</el-menu-item> {{$t("summaryManage.summaryList")}}
<el-menu-item index="/compare-plate">{{$t("summaryManage.comparePlate")}}</el-menu-item> </el-menu-item>
<el-menu-item index="/hardware-visual">{{$t("summaryManage.hardwareVisual")}}</el-menu-item> <el-menu-item index="/model-traceback"
:title='$t("summaryManage.modelTraceback")'>
{{$t("summaryManage.modelTraceback")}}
</el-menu-item>
<el-menu-item index="/data-traceback"
:title='$t("summaryManage.dataTraceback")'>
{{$t("summaryManage.dataTraceback")}}
</el-menu-item>
<el-menu-item index="/compare-plate"
:title='$t("summaryManage.comparePlate")'>
{{$t("summaryManage.comparePlate")}}
</el-menu-item>
<el-menu-item index="/hardware-visual"
:title='$t("summaryManage.hardwareVisual")'>
{{$t("summaryManage.hardwareVisual")}}
</el-menu-item>
</el-menu> </el-menu>
</div> </div>
</div> </div>
...@@ -46,7 +61,7 @@ limitations under the License. ...@@ -46,7 +61,7 @@ limitations under the License.
|| !this.$route.path.indexOf('/compare-plate') || !this.$route.path.indexOf('/compare-plate')
|| !this.$route.path.indexOf('/hardware-visual')"> || !this.$route.path.indexOf('/hardware-visual')">
<div class="reload-training" <div class="reload-training"
v-if="this.$route.path.indexOf('/scalar') > 0 v-if="this.$route.path.indexOf('/scalar') > 0
|| this.$route.path.indexOf('/image') > 0 || this.$route.path.indexOf('/image') > 0
|| this.$route.path.indexOf('/histogram') > 0 || this.$route.path.indexOf('/histogram') > 0
|| this.$route.path.indexOf('/tensor') > 0 || this.$route.path.indexOf('/tensor') > 0
...@@ -54,13 +69,13 @@ limitations under the License. ...@@ -54,13 +69,13 @@ limitations under the License.
|| !this.$route.path.indexOf('/compare-plate')"> || !this.$route.path.indexOf('/compare-plate')">
<!-- automatic refresh switch --> <!-- automatic refresh switch -->
<el-switch v-model="isTimeReload" <el-switch v-model="isTimeReload"
:active-text="$t('header.timeReload')+$t('symbols.leftbracket')+ :active-text="$t('header.timeReload')+$t('symbols.leftbracket')+
timeReloadValue+$t('header.timeSecond')+$t('symbols.rightbracket')" timeReloadValue+$t('header.timeSecond')+$t('symbols.rightbracket')"
@change="timeReload"></el-switch> @change="timeReload"></el-switch>
<i class="el-icon-edit" <i class="el-icon-edit"
:title="$t('header.timeReloadScope')" :title="$t('header.timeReloadScope')"
v-if="isTimeReload && !isShowInp" v-if="isTimeReload && !isShowInp"
@click="editTime"></i> @click="editTime"></i>
<el-input v-if="isTimeReload && isShowInp" <el-input v-if="isTimeReload && isShowInp"
v-model="newReloadValue" v-model="newReloadValue"
...@@ -68,23 +83,23 @@ limitations under the License. ...@@ -68,23 +83,23 @@ limitations under the License.
@input="timeValueChange"></el-input> @input="timeValueChange"></el-input>
<i class="el-icon-check" <i class="el-icon-check"
v-if="isTimeReload && isShowInp" v-if="isTimeReload && isShowInp"
@click="saveTimeValue"></i> @click="saveTimeValue"></i>
<i class="el-icon-close" <i class="el-icon-close"
v-if="isTimeReload && isShowInp" v-if="isTimeReload && isShowInp"
@click="cancelTimeValue"></i> @click="cancelTimeValue"></i>
</div> </div>
<div class="reload-hardware" <div class="reload-hardware"
v-if="!this.$route.path.indexOf('/hardware-visual')"> v-if="!this.$route.path.indexOf('/hardware-visual')">
<!-- automatic refresh switch --> <!-- automatic refresh switch -->
<el-switch v-model="isHardwareTimeReload" <el-switch v-model="isHardwareTimeReload"
:active-text="$t('header.timeReload')+$t('symbols.leftbracket')+ :active-text="$t('header.timeReload')+$t('symbols.leftbracket')+
hardwareTimeReloadValue+$t('header.timeSecond')+$t('symbols.rightbracket')" hardwareTimeReloadValue+$t('header.timeSecond')+$t('symbols.rightbracket')"
@change="hardwareTimeReload"></el-switch> @change="hardwareTimeReload"></el-switch>
<i class="el-icon-edit" <i class="el-icon-edit"
:title="$t('header.timeReloadScope')" :title="$t('header.timeReloadScope')"
v-if="isHardwareTimeReload && !isShowHardwareInp" v-if="isHardwareTimeReload && !isShowHardwareInp"
@click="editHardwareTime"></i> @click="editHardwareTime"></i>
<el-input v-if="isHardwareTimeReload && isShowHardwareInp" <el-input v-if="isHardwareTimeReload && isShowHardwareInp"
v-model="newHardwareReloadValue" v-model="newHardwareReloadValue"
...@@ -92,14 +107,13 @@ limitations under the License. ...@@ -92,14 +107,13 @@ limitations under the License.
@input="hardwareTimeValueChange"></el-input> @input="hardwareTimeValueChange"></el-input>
<i class="el-icon-check" <i class="el-icon-check"
v-if="isHardwareTimeReload && isShowHardwareInp" v-if="isHardwareTimeReload && isShowHardwareInp"
@click="saveHardwareTimeValue"></i> @click="saveHardwareTimeValue"></i>
<i class="el-icon-close" <i class="el-icon-close"
v-if="isHardwareTimeReload && isShowHardwareInp" v-if="isHardwareTimeReload && isShowHardwareInp"
@click="cancelHardwareTimeValue"></i> @click="cancelHardwareTimeValue"></i>
</div> </div>
<!-- manual refresh switch --> <!-- manual refresh switch -->
<img src="../assets/images/reload.png" <img src="../assets/images/reload.png"
alt="" alt=""
...@@ -113,7 +127,21 @@ limitations under the License. ...@@ -113,7 +127,21 @@ limitations under the License.
width="24" width="24"
class="cl-header-img cl-reload" class="cl-header-img cl-reload"
v-if="isReload" v-if="isReload"
:title="$t('header.RefreshingData')" /> :title="$t('header.refreshingData')" />
</div>
<div class="md-header-language"
v-show="isLanguage">
<span class="spanLanguage"
:class="[isChinese?'active':'']"
@click="changeLanguage('zh-cn')">
{{$t('public.zhLanguage')}}
</span>
<span class="spanLine">/</span>
<span class="spanLanguage"
:class="[!isChinese?'active':'']"
@click="changeLanguage('en-us')">
{{$t('public.enLanguage')}}
</span>
</div> </div>
</div> </div>
</template> </template>
...@@ -123,6 +151,7 @@ export default { ...@@ -123,6 +151,7 @@ export default {
data() { data() {
return { return {
isShowInp: false, isShowInp: false,
isLanguage: true,
timeReloadValue: this.$store.state.timeReloadValue, timeReloadValue: this.$store.state.timeReloadValue,
newReloadValue: this.$store.state.timeReloadValue, newReloadValue: this.$store.state.timeReloadValue,
isShowHardwareInp: false, isShowHardwareInp: false,
...@@ -142,6 +171,16 @@ export default { ...@@ -142,6 +171,16 @@ export default {
}, },
set(val) {}, set(val) {},
}, },
isChinese() {
let isChinese = false;
if (
localStorage.getItem('milang') &&
localStorage.getItem('milang') === 'zh-cn'
) {
isChinese = true;
}
return isChinese;
},
// set and get isHardwareTimeReload status // set and get isHardwareTimeReload status
isHardwareTimeReload: { isHardwareTimeReload: {
get() { get() {
...@@ -258,6 +297,10 @@ export default { ...@@ -258,6 +297,10 @@ export default {
return this.$route.path; return this.$route.path;
} }
}, },
changeLanguage(lan) {
localStorage.setItem('milang', lan);
window.location.reload();
},
}, },
}; };
</script> </script>
...@@ -271,6 +314,19 @@ export default { ...@@ -271,6 +314,19 @@ export default {
display: flex; display: flex;
color: $headerColor; color: $headerColor;
flex-shrink: 0; flex-shrink: 0;
.md-header-language {
width: 100px;
line-height: 64px;
.spanLine {
margin: 0 5px;
}
.spanLanguage {
cursor: pointer;
}
.active {
color: #00a5a7;
}
}
// logo style // logo style
.cl-header-logo { .cl-header-logo {
width: 161px; width: 161px;
...@@ -332,7 +388,7 @@ export default { ...@@ -332,7 +388,7 @@ export default {
.cl-header-nav { .cl-header-nav {
margin-left: 50px; margin-left: 50px;
flex: 1.5; flex: 2.2;
.el-menu { .el-menu {
border-bottom: none; border-bottom: none;
...@@ -341,6 +397,10 @@ export default { ...@@ -341,6 +397,10 @@ export default {
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
padding-top: 4px; padding-top: 4px;
max-width: 20%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.el-menu--horizontal > .el-menu-item.is-active { .el-menu--horizontal > .el-menu-item.is-active {
color: #00a5a7 !important; color: #00a5a7 !important;
......
此差异已折叠。
...@@ -367,9 +367,21 @@ ...@@ -367,9 +367,21 @@
"content12": "- MindSpore对该网络的流切分策略;", "content12": "- MindSpore对该网络的流切分策略;",
"content13": "- 算子在Device上的执行序列和执行时长。", "content13": "- 算子在Device上的执行序列和执行时长。",
"title2": "如何查看时间线:", "title2": "如何查看时间线:",
"content21": "要查看时间线的详细信息,您可以点击 \"下载\" 按钮将带有时间线信息的文件保存到本地,再通过工具查看。", "content21": {
"part1": "要查看时间线的详细信息,您可以点击 \"",
"part2": "下载",
"part3": "\" 按钮将带有时间线信息的文件保存到本地,再通过工具查看。"
},
"content22": "我们推荐您使用谷歌插件:chrome://tracing,或 Perfetto工具:https://ui.perfetto.dev/#!/viewer", "content22": "我们推荐您使用谷歌插件:chrome://tracing,或 Perfetto工具:https://ui.perfetto.dev/#!/viewer",
"content23": "选择一个工具,在浏览器地址栏输入地址并回车,进入页面点击按钮加载文件查看时间线(tracing工具点击左上角 \"load\",Perfetto工具点击左侧栏 \"Open trace file\")。", "content23": {
"part1": "选择一个工具,在浏览器地址栏输入地址并",
"part2": "回车",
"part3": ",进入页面点击按钮加载文件查看时间线(tracing工具点击左上角 \"",
"part4": "Load",
"part5": "\",Perfetto工具点击左侧栏 \"",
"part6": "Open trace file",
"part7": "\")。"
},
"title3": "如何使用时间线:", "title3": "如何使用时间线:",
"content31": "您可以通过时间线信息分析流切分方法是否合理、迭代间隙和拖尾时间是否过长等;", "content31": "您可以通过时间线信息分析流切分方法是否合理、迭代间隙和拖尾时间是否过长等;",
"content32": "也可以具体定位到某个算子,查看分析它的执行时间。" "content32": "也可以具体定位到某个算子,查看分析它的执行时间。"
......
...@@ -23,9 +23,18 @@ import './assets/css/element.css'; ...@@ -23,9 +23,18 @@ import './assets/css/element.css';
import './assets/css/reset.scss'; import './assets/css/reset.scss';
import i18n from './i18n'; import i18n from './i18n';
import $ from 'jquery'; import $ from 'jquery';
import locale from '../node_modules/element-ui/lib/locale/lang/en';
import localezh from '../node_modules/element-ui/lib/locale/lang/zh-CN';
if (
localStorage.getItem('milang') &&
localStorage.getItem('milang') !== 'zh-cn'
) {
Vue.use(ElementUI, {locale});
} else {
Vue.use(ElementUI, {localezh});
}
window.$ = window.jQuery = $; window.$ = window.jQuery = $;
Vue.use(ElementUI);
Vue.prototype.$bus = new Vue(); Vue.prototype.$bus = new Vue();
...@@ -47,7 +56,6 @@ router.onError((error) => { ...@@ -47,7 +56,6 @@ router.onError((error) => {
// forbidden showing production tip // forbidden showing production tip
Vue.config.productionTip = false; Vue.config.productionTip = false;
/** /**
* Check the browser version * Check the browser version
* @return {Boolen} * @return {Boolen}
......
...@@ -316,6 +316,7 @@ export default { ...@@ -316,6 +316,7 @@ export default {
noData: true, noData: true,
size: null, size: null,
initOver: false, initOver: false,
deviceId: null,
}, },
dataQueueChart: { dataQueueChart: {
// Data queue chart object // Data queue chart object
...@@ -373,6 +374,7 @@ export default { ...@@ -373,6 +374,7 @@ export default {
// Average rate chart object // Average rate chart object
id: 'average-rate', id: 'average-rate',
chartDom: null, chartDom: null,
deviceId: null,
}, },
queueDeepChart: { queueDeepChart: {
// Queue deep chart object // Queue deep chart object
...@@ -438,14 +440,20 @@ export default { ...@@ -438,14 +440,20 @@ export default {
* Tabs switch * Tabs switch
*/ */
handleClick() { handleClick() {
if (this.activeName === 'pipeLine') { if (
if (!Object.keys(this.allGraphData).length) { this.activeName === 'pipeLine' &&
this.$nextTick(() => { this.averageRateChart.deviceId !== this.currentCard
this.queryAverageRate(); ) {
}); this.queryAverageRate();
} } else if (
this.activeName === 'queueInfo' &&
this.connectQueueChart.deviceId !== this.currentCard
) {
this.init();
} }
this.resizeCallback(); this.$nextTick(() => {
this.resizeCallback();
});
}, },
init() { init() {
this.queryProcessSummary(); this.queryProcessSummary();
...@@ -652,6 +660,7 @@ export default { ...@@ -652,6 +660,7 @@ export default {
device_id: this.currentCard, device_id: this.currentCard,
train_id: this.trainId, train_id: this.trainId,
}; };
this.connectQueueChart.deviceId = this.currentCard;
RequestService.queryProcessSummary(params).then( RequestService.queryProcessSummary(params).then(
(res) => { (res) => {
if (res && res.data) { if (res && res.data) {
...@@ -732,6 +741,7 @@ export default { ...@@ -732,6 +741,7 @@ export default {
device_id: this.currentCard, device_id: this.currentCard,
}, },
}; };
this.averageRateChart.deviceId = this.currentCard;
RequestService.queryOpQueue(params).then( RequestService.queryOpQueue(params).then(
(res) => { (res) => {
this.initOver = true; this.initOver = true;
......
...@@ -42,17 +42,17 @@ limitations under the License. ...@@ -42,17 +42,17 @@ limitations under the License.
</el-popover> </el-popover>
<div class="step" <div class="step"
v-show="guide.step == 1"> v-show="guide.step == 1">
<img src="@/assets/images/graph-step1.svg" <img :src="require(`@/assets/images/graph-step1${language === 'en-us' ? '-en' : ''}.svg`)"
alt="" /> alt="" />
</div> </div>
<div class="step" <div class="step"
v-show="guide.step == 2"> v-show="guide.step == 2">
<img src="@/assets/images/graph-step2.svg" <img :src="require(`@/assets/images/graph-step2${language === 'en-us' ? '-en' : ''}.svg`)"
alt="" /> alt="" />
</div> </div>
<div class="step" <div class="step"
v-show="guide.step == 3"> v-show="guide.step == 3">
<img src="@/assets/images/graph-step3.svg" <img :src="require(`@/assets/images/graph-step3${language === 'en-us' ? '-en' : ''}.svg`)"
alt="" /> alt="" />
</div> </div>
</div> </div>
...@@ -492,6 +492,7 @@ export default { ...@@ -492,6 +492,7 @@ export default {
max: 10000, max: 10000,
scale: {x: 1, y: 1}, scale: {x: 1, y: 1},
}, },
language: '',
}; };
}, },
computed: {}, computed: {},
...@@ -528,6 +529,7 @@ export default { ...@@ -528,6 +529,7 @@ export default {
} }
this.trainJobID = this.$route.query.train_id; this.trainJobID = this.$route.query.train_id;
this.language = localStorage.getItem('milang') || 'zh-cn';
document.title = `${decodeURIComponent(this.trainJobID)}-${this.$t( document.title = `${decodeURIComponent(this.trainJobID)}-${this.$t(
'graph.titleText', 'graph.titleText',
)}-MindInsight`; )}-MindInsight`;
......
...@@ -320,9 +320,21 @@ limitations under the License. ...@@ -320,9 +320,21 @@ limitations under the License.
<div>{{$t("profiling.timelineTips.content13")}}</div> <div>{{$t("profiling.timelineTips.content13")}}</div>
<br> <br>
<div class="font-style">{{$t("profiling.timelineTips.title2")}}</div> <div class="font-style">{{$t("profiling.timelineTips.title2")}}</div>
<div>{{$t("profiling.timelineTips.content21")}}</div> <div>
{{$t("profiling.timelineTips.content21.part1")}}
<b>{{$t("profiling.timelineTips.content21.part2")}}</b>
{{$t("profiling.timelineTips.content21.part3")}}
</div>
<div>{{$t("profiling.timelineTips.content22")}}</div> <div>{{$t("profiling.timelineTips.content22")}}</div>
<div>{{$t("profiling.timelineTips.content23")}}</div> <div>
{{$t("profiling.timelineTips.content23.part1")}}
<b>{{$t("profiling.timelineTips.content23.part2")}}</b>
{{$t("profiling.timelineTips.content23.part3")}}
<b>{{$t("profiling.timelineTips.content23.part4")}}</b>
{{$t("profiling.timelineTips.content23.part5")}}
<b>{{$t("profiling.timelineTips.content23.part6")}}</b>
{{$t("profiling.timelineTips.content23.part7")}}
</div>
<br> <br>
<div class="font-style">{{$t("profiling.timelineTips.title3")}}</div> <div class="font-style">{{$t("profiling.timelineTips.title3")}}</div>
<div>{{$t("profiling.timelineTips.content31")}}</div> <div>{{$t("profiling.timelineTips.content31")}}</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册