Skip to content

Commit

Permalink
对接统一身份认证,优化网页界面
Browse files Browse the repository at this point in the history
  • Loading branch information
hexuustc committed Oct 24, 2023
1 parent 7cd151e commit 4ec8124
Show file tree
Hide file tree
Showing 20 changed files with 9,597 additions and 6,201 deletions.
15,532 changes: 9,395 additions & 6,137 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"vue-router": "4.0.1",
"vue-toastification": "1.7.11",
"vue-tree-list": "^1.5.0",
"vuex": "^4.0.0",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0"
},
Expand Down
Binary file added public/img/brand/fpgaol_brand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/brand/fpgaol_brand_rmbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions public/img/icons/common/fpgaol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/theme/pikachu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link
rel="icon"
href="<%= BASE_URL %>img/brand/favicon.png"
href="<%= BASE_URL %>img/brand/fpgaol_brand_rmbg.png"
type="image/png"
/>
<title>FPGAOL | USTC</title>
Expand Down
31 changes: 25 additions & 6 deletions src/components/SidebarPlugin/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<slot name="mobile-right">
<ul class="nav align-items-center d-md-none">
<base-dropdown class="nav-item" position="right">
<!-- <base-dropdown class="nav-item" position="right">
<template v-slot:title>
<a
class="nav-link nav-link-icon"
Expand All @@ -32,15 +32,15 @@
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</base-dropdown>
</base-dropdown> -->
<base-dropdown class="nav-item" position="right">
<template v-slot:title>
<a class="nav-link" href="#" role="button">
<div class="media align-items-center">
<span class="avatar avatar-sm rounded-circle">
<img
alt="Image placeholder"
src="img/theme/team-1-800x800.jpg"
src="img/theme/pikachu.png"
/>
</span>
</div>
Expand All @@ -54,7 +54,7 @@
<i class="ni ni-single-02"></i>
<span>My profile</span>
</router-link>
<router-link to="/profile" class="dropdown-item">
<!-- <router-link to="/profile" class="dropdown-item">
<i class="ni ni-settings-gear-65"></i>
<span>Settings</span>
</router-link>
Expand All @@ -65,9 +65,9 @@
<router-link to="/profile" class="dropdown-item">
<i class="ni ni-support-16"></i>
<span>Support</span>
</router-link>
</router-link> -->
<div class="dropdown-divider"></div>
<a href="#!" class="dropdown-item">
<a class="dropdown-item" @click="logout">
<i class="ni ni-user-run"></i>
<span>Logout</span>
</a>
Expand Down Expand Up @@ -104,12 +104,19 @@
</template>
<script>
import NavbarToggleButton from "@/components/NavbarToggleButton";
import axios from 'axios';
export default {
name: "sidebar",
components: {
NavbarToggleButton,
},
data() {
return {
res:{},
username:"None"
};
},
props: {
logo: {
type: String,
Expand All @@ -135,6 +142,18 @@ export default {
showSidebar() {
this.$sidebar.displaySidebar(true);
},
logout(){
localStorage.removeItem('Authorization');
localStorage.removeItem('userdata');
this.username = this.$store.state.username;
this.$router.push('/login');
axios
.get('http://202.38.79.96:9003/sso/logout?username='+this.username)
.then(response => (
console.log("logout: ",response.data)
//this.$router.push('/login')
))
},
},
beforeUnmount() {
if (this.$sidebar.showSidebar) {
Expand Down
8 changes: 6 additions & 2 deletions src/components/websocket/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import emitter from "./event_bus.js";

let DEBUG_MODE = true;
let DEBUG_WS_SERVER = "202.38.79.96:12148";
//let DEBUG_WS_SERVER = "202.38.79.134:12169";

let notifySocket;
let PI_SERVER_ADDRESS = window.location.host;
Expand All @@ -14,7 +15,9 @@ export default function initWebsocket() {
}
notifySocket.onmessage = function (e) {
const data = JSON.parse(e.data);
//console.log("receive message:", data);
console.log("receive message:", data);
//print("hhh");
console.log("bbb");
const type = data["type"];
const idx = data["idx"];
let payload = data["payload"];
Expand All @@ -35,11 +38,12 @@ export default function initWebsocket() {
}

function sendJson(json) {
console.log(json);
console.log("websocket sendjson: ",json);
notifySocket.send(json);
}

function sendStartNotify(json) {
console.log("sendStartNotify in ");
var data = JSON.parse(json);
var id = data["id"];
if (id == -2) {
Expand Down
36 changes: 18 additions & 18 deletions src/layout/AuthLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@
containerClasses="px-4 container"
expand
>
<!-- <router-link slot="brand" class="navbar-brand" to="/">
<img src="img/brand/white.png"/>
</router-link> -->

<template v-slot="{ closeMenu }">
<!-- Collapse header -->
<div class="navbar-collapse-header d-md-none">
<div class="row">
<div class="col-6 collapse-brand">
<router-link to="/">
<img src="img/brand/green.png" />
<img src="img/brand/fpgaol.png" />
</router-link>
</div>
<div class="col-6 collapse-close">
Expand All @@ -34,30 +30,30 @@
</div>
<!-- Navbar items -->
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<!-- <li class="nav-item">
<router-link class="nav-link nav-link-icon" to="/">
<i class="ni ni-planet"></i>
<span class="nav-link-inner--text">Dashboard</span>
</router-link>
</li>
<li class="nav-item">
</li> -->
<!-- <li class="nav-item">
<router-link class="nav-link nav-link-icon" to="/register">
<i class="ni ni-circle-08"></i>
<span class="nav-link-inner--text">Register</span>
</router-link>
</li>
</li> -->
<li class="nav-item">
<router-link class="nav-link nav-link-icon" to="/login">
<i class="ni ni-key-25"></i>
<span class="nav-link-inner--text">Login</span>
</router-link>
</li>
<li class="nav-item">
<!-- <li class="nav-item">
<router-link class="nav-link nav-link-icon" to="/profile">
<i class="ni ni-single-02"></i>
<span class="nav-link-inner--text">Profile</span>
</router-link>
</li>
</li> -->
</ul>
</template>
</base-nav>
Expand All @@ -67,11 +63,11 @@
<div class="header-body text-center mb-7">
<div class="row justify-content-center">
<div class="col-lg-5 col-md-6">
<h1 class="text-white">Welcome!</h1>
<p class="text-lead text-white">
<h1 class="text-white">Welcome to FPGAOL!</h1>
<!-- <p class="text-lead text-white">
Use these awesome forms to login or create new account in your
project for free.
</p>
</p> -->
</div>
</div>
</div>
Expand All @@ -93,10 +89,10 @@
</div>
</div>
<!-- Page content -->
<div class="container mt--8 pb-5">
<div class="container mt--8 pb-9">
<router-view></router-view>
</div>
<footer class="py-5">
<!-- <footer class="py-5">
<div class="container">
<div class="row align-items-center justify-content-xl-between">
<div class="col-xl-6">
Expand Down Expand Up @@ -150,7 +146,7 @@
</div>
</div>
</div>
</footer>
</footer> -->
</div>
</template>
<script>
Expand All @@ -164,4 +160,8 @@ export default {
},
};
</script>
<style></style>
<style>
.main-content {
min-height: 100vh;
}
</style>
76 changes: 68 additions & 8 deletions src/layout/DashboardLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,54 @@
path: '/about',
}"
/>
<!-- <sidebar-item
<sidebar-item
:link="{
name: '下载',
icon: 'ni ni-key-25 text-info',
path: '/home',
}"
/> -->
/>
<sidebar-item
:link="{
name: 'Register',
icon: 'ni ni-circle-08 text-pink',
path: '/register',
}"
/>
<sidebar-item
:link="{
name: 'dashboard',
icon: 'fa fa-solid fa-arrow-right text-red',
path: '/dashboard',
}"
/><sidebar-item
:link="{
name: 'icons',
icon: 'ni ni-bullet-list-67 text-red',
path: '/icons',
}"
/><sidebar-item
:link="{
name: 'maps',
icon: 'ni ni-bullet-list-67 text-red',
path: '/maps',
}"
/><sidebar-item
:link="{
name: 'tables',
icon: 'ni ni-bullet-list-67 text-red',
path: '/tables',
}"
/>
<button class="toggle-btn text-info" @click="toggleSidebar">
<i class="ni ni-bold-left"></i> <!-- 使用 Font Awesome 的箭头图标 -->
</button>
</template>
</side-bar>
<div v-if="!expand_sidebar" class="navbar navbar-vertical fixed-left navbar-expand-md navbar-light bg-white">
<div v-if="!expand_sidebar" class="show-sidebar-btn text-info" @click="toggleSidebar">
<i class="ni ni-bold-right"></i>
</div>
<div v-if="false" class="navbar navbar-vertical fixed-left navbar-expand-md navbar-light bg-white">
<el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
<el-radio-button :label="false">展开</el-radio-button>
<el-radio-button :label="true">收起</el-radio-button>
Expand Down Expand Up @@ -99,28 +130,28 @@
</div>
<div class="main-content" :data="sidebarBackground">
<dashboard-navbar></dashboard-navbar>
<div @click="toggleSidebar">
<div>
<!-- your content here -->
<router-view></router-view>
<content-footer v-if="!$route.meta.hideFooter"></content-footer>
<!-- <content-footer v-if="!$route.meta.hideFooter"></content-footer> -->
</div>
</div>
</div>
</template>
<script>
import DashboardNavbar from "./DashboardNavbar.vue";
import ContentFooter from "./ContentFooter.vue";
//import ContentFooter from "./ContentFooter.vue";
//import SideBar from "../components/SidebarPlugin/SideBar.vue";
export default {
components: {
DashboardNavbar,
ContentFooter,
//ContentFooter,
//SideBar,
},
data() {
return {
sidebarBackground: "blue", //vue|blue|orange|green|red|primary
sidebarBackground: "red", //vue|blue|orange|green|red|primary
expand_sidebar: true,
isCollapse: true
};
Expand All @@ -130,6 +161,7 @@ export default {
if (this.$sidebar.showSidebar) {
this.$sidebar.displaySidebar(false);
}
this.expand_sidebar = !this.expand_sidebar;
},
handleOpen(key, keyPath) {
console.log(key, keyPath);
Expand All @@ -148,4 +180,32 @@ export default {
width: 200px;
min-height: 400px;
}
.toggle-btn, .show-sidebar-btn {
position: fixed;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: rgba(225, 255, 255, 0.7);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
border: none;
outline: none;
z-index: 1000;
}
.toggle-btn {
left: 220px;
top: 50%;
transform: translateY(-50%);
}
.show-sidebar-btn {
left: 0;
top: 50%;
transform: translateY(-50%);
}
</style>
Loading

0 comments on commit 4ec8124

Please sign in to comment.