-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
925 additions
and
875 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,83 @@ | ||
<template> | ||
<div> | ||
<!-- <TaskView :visible="taskVisible" @visibleChange="(val) => {taskVisible = val}"></TaskView>--> | ||
<el-menu :default-active="this.$route.path" mode="horizontal" :router="true" background-color="#323232" | ||
text-color="#fff" active-text-color="#2194EC"> | ||
<el-menu-item>{{ base.Title }}</el-menu-item> | ||
<el-menu-item index="/">{{$t('header.panel')}}</el-menu-item> | ||
<el-menu-item index="/team">{{$t('header.team')}}</el-menu-item> | ||
<el-menu-item index="/challenge">{{$t('header.challenge')}}</el-menu-item> | ||
<el-menu-item index="/gamebox">{{$t('header.gamebox')}}</el-menu-item> | ||
<!-- <el-menu-item index="/docker">{{$t('header.docker')}}</el-menu-item>--> | ||
<el-menu-item index="/flag">{{$t('header.flag')}}</el-menu-item> | ||
<el-menu-item index="/bulletin">{{$t('header.bulletin')}}</el-menu-item> | ||
<el-menu-item index="/asteroid">{{$t('header.asteroid')}}</el-menu-item> | ||
<el-menu-item index="/webhook">{{$t('header.webhook')}}</el-menu-item> | ||
<el-menu-item index="/config">{{$t('header.config')}}</el-menu-item> | ||
<el-menu-item index="/manager">{{$t('header.manager')}}</el-menu-item> | ||
<el-menu-item v-if="$route.name !== 'Login'" index="" @click="onLogout">{{$t('header.logout')}} | ||
</el-menu-item> | ||
<el-menu-item index=""> | ||
<el-dropdown @command="(lang) => this.$i18n.locale = lang" class="height: 100%;"> | ||
<div> | ||
<!-- <TaskView :visible="taskVisible" @visibleChange="(val) => {taskVisible = val}"></TaskView>--> | ||
<el-menu :default-active="this.$route.path" mode="horizontal" :router="true" background-color="#323232" | ||
text-color="#fff" active-text-color="#2194EC"> | ||
<el-menu-item>{{ base.Title }}</el-menu-item> | ||
<el-menu-item index="/">{{ $t('header.panel') }}</el-menu-item> | ||
<el-menu-item index="/team">{{ $t('header.team') }}</el-menu-item> | ||
<el-menu-item index="/challenge">{{ $t('header.challenge') }}</el-menu-item> | ||
<el-menu-item index="/gamebox">{{ $t('header.gamebox') }}</el-menu-item> | ||
<!-- <el-menu-item index="/docker">{{$t('header.docker')}}</el-menu-item>--> | ||
<el-menu-item index="/flag">{{ $t('header.flag') }}</el-menu-item> | ||
<el-menu-item index="/bulletin">{{ $t('header.bulletin') }}</el-menu-item> | ||
<el-menu-item index="/asteroid">{{ $t('header.asteroid') }}</el-menu-item> | ||
<el-menu-item index="/webhook">{{ $t('header.webhook') }}</el-menu-item> | ||
<el-menu-item index="/config">{{ $t('header.config') }}</el-menu-item> | ||
<el-menu-item index="/manager">{{ $t('header.manager') }}</el-menu-item> | ||
<el-menu-item v-if="$route.name !== 'Login'" index="" @click="onLogout">{{ $t('header.logout') }} | ||
</el-menu-item> | ||
<el-menu-item index=""> | ||
<el-dropdown @command="(lang) => this.$i18n.locale = lang" class="height: 100%;"> | ||
<span> | ||
{{$i18n.locale}} | ||
{{ $i18n.locale }} | ||
</span> | ||
<el-dropdown-menu slot="dropdown"> | ||
<el-dropdown-item v-for="(lang, index) in $i18n.availableLocales" v-bind:key="index" | ||
:command="lang">{{lang}} | ||
</el-dropdown-item> | ||
</el-dropdown-menu> | ||
</el-dropdown> | ||
</el-menu-item> | ||
<!-- <el-menu-item style="float: right;">--> | ||
<!-- <el-badge :value="200" :max="99" class="badge">--> | ||
<!-- <el-button plain size="small" style="margin-top: -20px;" @click="taskVisible = true">任务队列--> | ||
<!-- </el-button>--> | ||
<!-- </el-badge>--> | ||
<!-- </el-menu-item>--> | ||
</el-menu> | ||
</div> | ||
<el-dropdown-menu slot="dropdown"> | ||
<el-dropdown-item v-for="(lang, index) in $i18n.availableLocales" v-bind:key="index" | ||
:command="lang">{{ lang }} | ||
</el-dropdown-item> | ||
</el-dropdown-menu> | ||
</el-dropdown> | ||
</el-menu-item> | ||
<!-- <el-menu-item style="float: right;">--> | ||
<!-- <el-badge :value="200" :max="99" class="badge">--> | ||
<!-- <el-button plain size="small" style="margin-top: -20px;" @click="taskVisible = true">任务队列--> | ||
<!-- </el-button>--> | ||
<!-- </el-badge>--> | ||
<!-- </el-menu-item>--> | ||
</el-menu> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// import TaskView from "./TaskView"; | ||
// import TaskView from "./TaskView"; | ||
export default { | ||
name: "Header", | ||
// components: {TaskView}, | ||
data: () => ({ | ||
base: { | ||
Title: '' | ||
}, | ||
taskVisible: false, | ||
}), | ||
export default { | ||
name: "Header", | ||
// components: {TaskView}, | ||
data: () => ({ | ||
base: { | ||
Title: '' | ||
}, | ||
taskVisible: false, | ||
}), | ||
created() { | ||
this.utils.GET('/base').then(res => { | ||
this.base = res | ||
}).catch(err => this.$message.error(err)) | ||
}, | ||
created() { | ||
this.utils.GET('/base').then(res => { | ||
this.base = res | ||
this.setLanguage() | ||
}).catch(err => this.$message.error(err)) | ||
}, | ||
methods: { | ||
onLogout() { | ||
this.utils.GET('/manager/logout').then(res => { | ||
this.$message.success(res) | ||
localStorage.removeItem('managerToken') | ||
this.$router.push('/login') | ||
}).catch(err => this.$message.error(err)) | ||
}, | ||
}, | ||
} | ||
methods: { | ||
setLanguage() { | ||
this.$i18n.locale = this.base.Language | ||
}, | ||
onLogout() { | ||
this.utils.GET('/manager/logout').then(res => { | ||
this.$message.success(res) | ||
localStorage.removeItem('managerToken') | ||
this.$router.push('/login') | ||
}).catch(err => this.$message.error(err)) | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.badge { | ||
margin-top: 10px; | ||
margin-right: 30px; | ||
} | ||
.badge { | ||
margin-top: 10px; | ||
margin-right: 30px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.