Skip to content

Commit

Permalink
show port change notification
Browse files Browse the repository at this point in the history
  • Loading branch information
power721 committed Jul 7, 2023
1 parent 0c86b02 commit 4f55db4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 19 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AList - TvBox</title>
<script type="module" crossorigin src="/assets/index-d0532f3a.js"></script>
<link rel="stylesheet" href="/assets/index-3d8ee3a4.css">
<script type="module" crossorigin src="/assets/index-e3019846.js"></script>
<link rel="stylesheet" href="/assets/index-8be43f62.css">
</head>
<body>
<div id="app"></div>
Expand Down
24 changes: 23 additions & 1 deletion web-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ const account = accountService.account
const router = useRouter()
const show = ref(false)
const mounted = ref(false)
const showNotification = ref(true)
const logout = () => {
accountService.logout()
router.push('/')
}
const close = () => {
localStorage.setItem('notification1', 'true')
}
onMounted(() => {
showNotification.value = localStorage.getItem('notification1') != 'true'
axios.get("/profiles").then(({data}) => {
show.value = data.includes('xiaoya')
store.xiaoya = data.includes('xiaoya')
Expand Down Expand Up @@ -60,6 +66,7 @@ onMounted(() => {
<el-menu-item index="/login" v-else>登录</el-menu-item>
</el-menu>
</el-header>
<el-alert title="默认端口5678在未来将会变更为4567" type="warning" v-if="showNotification" @close="close" />

<el-main v-if="mounted">
<RouterView/>
Expand All @@ -68,8 +75,23 @@ onMounted(() => {
</div>
</template>

<style scoped>
<style>
.flex-grow {
flex-grow: 1;
}
.el-alert {
width: 98%;
margin: 0 20px;
}
.el-alert__content {
width: 100%;
}
.el-alert .el-alert__close-btn {
font-size: var(--el-alert-close-font-size);
opacity: 1;
position: absolute;
top: 6px;
right: 6px;
cursor: pointer;
}
</style>

0 comments on commit 4f55db4

Please sign in to comment.