Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1602 from duanjie-cmd/feature/goz
Browse files Browse the repository at this point in the history
add stage
  • Loading branch information
zhangjinbiao746 authored Nov 25, 2022
2 parents 54fef7a + bbdbb47 commit c201d16
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
3 changes: 3 additions & 0 deletions frontend/.env.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV = stage

VUE_APP_BASE_URL="https://stage.backend-go.ibc.iobscan.io"
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"scripts": {
"dev": "vue-cli-service serve --mode development",
"qa": "vue-cli-service serve --mode qa",
"stage": "vue-cli-service serve --mode stage",
"prod": "vue-cli-service serve --mode production",
"build:dev": "vue-cli-service build --mode development",
"build:qa": "vue-cli-service build --mode qa",
"build:stage": "vue-cli-service build --mode stage",
"build:prod": "vue-cli-service build --mode production"
},
"dependencies": {
Expand Down
Binary file added frontend/public/favicon_stage.ico
Binary file not shown.
Binary file added frontend/src/assets/env/logo_stage_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion frontend/src/components/gozHeader/GozHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="goz_content_wrap">
<div class="goz_content_left_content">
<div class="goz_content_logo_content">
<div><img src="../../assets/IOBSCAN_logo.png" alt=""></div>
<div><img :class="{'stage_logo': isStage }" :src="displayLogoImg" alt=""></div>
</div>
<div class="goz_content_network_state" :class="changeRouter ? 'active_border_bottom' :'unActive_border_bottom'">
<span><router-link :to="`/`">Network State Visualizer </router-link></span>
Expand Down Expand Up @@ -81,10 +81,15 @@
import constant from '../../constant/Constant';
import lang from "../../lang";
import skinStyle from '../../skinStyle'
import logoImg from '../../assets/env/logo_icon.png';
import stageLogoImg from '../../assets/env/logo_stage_icon.png';
export default {
name: "GozHeader",
data () {
return {
logoImg,
stageLogoImg,
netWorkArray: [],
flShowNetworkLogo: false,
currentNetworkClass:'',
Expand All @@ -105,6 +110,12 @@
}else {
return false
}
},
isStage () {
return process.env.NODE_ENV === 'stage';
},
displayLogoImg () {
return !this.isStage ? logoImg: stageLogoImg;
}
},
methods:{
Expand Down Expand Up @@ -219,6 +230,9 @@
width: 1.48rem;
height: 0.3rem;
}
.stage_logo {
transform: translate(0, 3px);
}
}
}
.goz_content_network_state{
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,18 @@ VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}


Vue.prototype.addressRoute = Tools.addressRoute;
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

const useStageChangeIcon = () => {
if (process.env.NODE_ENV !== 'stage') return;
const link = document.querySelector('link[rel *= "icon"]') || document.createElement('link');
link.rel = 'icon';
link.href = '/favicon_stage.ico';
document.getElementsByTagName('head')[0].appendChild(link);
};
useStageChangeIcon();
4 changes: 2 additions & 2 deletions frontend/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//@ts-check
console.log('env:',process.env);
module.exports = {
devServer: {
proxy: {
'/api':{

target:'http://localhost:8080',
target:'http://localhost:8080',
secure:false,
},
}
Expand Down

0 comments on commit c201d16

Please sign in to comment.