In case the CSC was configured to work in mixed mode
(www_admin.http_csc.csc_js_enable == 'mixed') then the
OLD CSC page of the customer details was displayed on
the new CSC for administrative subscribers.
This was added in commit 0354615428
The OLD CSC is not fully deprecated so also the access
to this page should be removed.
Change-Id: Ic791fb85c2039ce2c3e801b3ca826bee5a4c7e7c
mr13.4
parent
dcfecc4327
commit
8fc8a99ff0
@ -1,161 +0,0 @@
|
||||
<template>
|
||||
<div
|
||||
class="proxy-iframe-wrapper flex flex-center"
|
||||
>
|
||||
<iframe
|
||||
v-show="loaded"
|
||||
ref="proxyIframe"
|
||||
class="proxy-iframe"
|
||||
:src="finalSrc"
|
||||
@load="loadedEvent"
|
||||
/>
|
||||
<q-spinner
|
||||
v-if="!loaded"
|
||||
color="primary"
|
||||
size="xl"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from 'lodash'
|
||||
import { showGlobalError } from 'src/helpers/ui'
|
||||
import { getCurrentLangAsV1Format } from 'src/i18n'
|
||||
import {
|
||||
mapActions,
|
||||
mapState
|
||||
} from 'vuex'
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: 'Proxy',
|
||||
data () {
|
||||
return {
|
||||
loaded: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('user', [
|
||||
'currentPathIframe'
|
||||
]),
|
||||
language () {
|
||||
return getCurrentLangAsV1Format()
|
||||
},
|
||||
finalSrc () {
|
||||
let url = null
|
||||
if (_.isString(this.$appConfig.baseHttpUrl) && _.trim(this.$appConfig.baseHttpUrl) !== '') {
|
||||
url = new URL(this.$appConfig.baseHttpUrl)
|
||||
} else {
|
||||
url = new URL(location.origin)
|
||||
}
|
||||
url.searchParams.set('framed', '1')
|
||||
url.searchParams.set('lang', this.language)
|
||||
if (this.$route?.meta?.proxyRewrite) {
|
||||
return this.$route?.meta?.proxyRewrite({
|
||||
route: this.$route,
|
||||
url
|
||||
}).toString()
|
||||
}
|
||||
url.pathname = this.$route.path
|
||||
return url.toString()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentPathIframe (path) {
|
||||
const routeData = this.$router.resolve(path)
|
||||
if (!routeData?.meta?.proxy && !routeData?.meta?.proxyReverseInvisible) {
|
||||
this.$router.push({
|
||||
path
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
window.addEventListener('message', this.trackMessagesFromV1, false)
|
||||
},
|
||||
beforeUnmount () {
|
||||
window.removeEventListener('message', this.trackMessagesFromV1, false)
|
||||
},
|
||||
methods: {
|
||||
...mapActions('user', [
|
||||
'logout'
|
||||
]),
|
||||
loadedEvent () {
|
||||
try {
|
||||
const domEl = this.$refs.proxyIframe?.contentWindow?.document?.getElementById('login_page_v1')
|
||||
if (domEl !== null) {
|
||||
this.logout()
|
||||
return
|
||||
}
|
||||
|
||||
this.injectDarkUITheme()
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug('Session expiration detection is disabled')
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(err)
|
||||
} finally {
|
||||
this.loaded = true
|
||||
}
|
||||
},
|
||||
injectDarkUITheme () {
|
||||
const framedWindow = this.$refs.proxyIframe.contentWindow
|
||||
const $ = framedWindow.$
|
||||
const darkThemeCSS = `
|
||||
body {
|
||||
background: #3b3440; /* $darkBase */
|
||||
color: white;
|
||||
overflow: auto;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 { color: white; }
|
||||
|
||||
.table-hover, .table-highlight { color: black; }
|
||||
.table-hover tbody tr:hover > td,
|
||||
.table-hover tbody tr:hover > th { background: none; }
|
||||
|
||||
.table-highlight.table-bordered tbody tr td,
|
||||
.table-highlight.table-bordered tbody tr th { background-color: #F0F3F7; }
|
||||
|
||||
.table-highlight.table-bordered thead tr,
|
||||
table.ngcp-datatable tfoot tr { background: silver; }
|
||||
|
||||
.table-highlight.table-bordered thead th,
|
||||
table.ngcp-datatable tfoot td {
|
||||
text-shadow: none;
|
||||
color: black;
|
||||
border-left: 1px solid #F1F1F1;
|
||||
border-right: 1px solid #CCC;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.ngcp-modal,
|
||||
.jquery-msgbox { color: #333; }
|
||||
.modal-header { background: silver; border-color: white; }
|
||||
.modal-header h3 { color: black; text-shadow: none; }
|
||||
|
||||
.accordion-inner { border-top: none; }
|
||||
`
|
||||
$(`<style>${darkThemeCSS}</style>`).appendTo(framedWindow.document.head)
|
||||
},
|
||||
trackMessagesFromV1 (event) {
|
||||
if (event?.data?.origin === 'ngcp-panel') {
|
||||
if (event?.data?.error) {
|
||||
showGlobalError(event.data.error)
|
||||
}
|
||||
}
|
||||
if (event?.data?.origin === 'ngcp-panel-beforeunload') {
|
||||
this.loaded = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass" rel="stylesheet/sass">
|
||||
.proxy-iframe-wrapper
|
||||
height: calc(100vh - 100px)
|
||||
width: 100%
|
||||
.proxy-iframe
|
||||
border: none
|
||||
height: calc(100vh - 100px)
|
||||
width: 100%
|
||||
</style>
|
Loading…
Reference in new issue