mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
chore: make class to get the device form factor
This commit is contained in:
parent
510c35f450
commit
6f4eefe601
5 changed files with 11 additions and 6 deletions
|
@ -780,4 +780,10 @@ class LanguageManager {
|
||||||
|
|
||||||
return languageFilter.length > 0;
|
return languageFilter.length > 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class DeviceUtils {
|
||||||
|
static isMobile() {
|
||||||
|
return window.innerWidth <= 768;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{{define "qrcodeModal"}}
|
{{define "qrcodeModal"}}
|
||||||
<a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title"
|
<a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title"
|
||||||
:dialog-style="isMobileQr ? { top: '18px' } : {}"
|
:dialog-style="DeviceUtils.isMobile() ? { top: '18px' } : {}"
|
||||||
:closable="true"
|
:closable="true"
|
||||||
:class="themeSwitcher.currentTheme"
|
:class="themeSwitcher.currentTheme"
|
||||||
:footer="null" width="fit-content">
|
:footer="null" width="fit-content">
|
||||||
|
@ -35,7 +35,6 @@
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const isMobileQr = window.innerWidth <= 768;
|
|
||||||
const qrModal = {
|
const qrModal = {
|
||||||
title: '',
|
title: '',
|
||||||
dbInbound: new DBInbound(),
|
dbInbound: new DBInbound(),
|
||||||
|
|
|
@ -709,7 +709,7 @@
|
||||||
showAlert: false,
|
showAlert: false,
|
||||||
ipLimitEnable: false,
|
ipLimitEnable: false,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
isMobile: window.innerWidth <= 768,
|
isMobile: DeviceUtils.isMobile(),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loading(spinning = true) {
|
loading(spinning = true) {
|
||||||
|
@ -1473,7 +1473,7 @@
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
onResize() {
|
onResize() {
|
||||||
this.isMobile = window.innerWidth <= 768;
|
this.isMobile = DeviceUtils.isMobile();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -601,7 +601,7 @@
|
||||||
loadingTip: '{{ i18n "loading"}}',
|
loadingTip: '{{ i18n "loading"}}',
|
||||||
showAlert: false,
|
showAlert: false,
|
||||||
showIp: false,
|
showIp: false,
|
||||||
isMobile: window.innerWidth <= 768
|
isMobile: DeviceUtils.isMobile()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loading(spinning, tip = '{{ i18n "loading"}}') {
|
loading(spinning, tip = '{{ i18n "loading"}}') {
|
||||||
|
|
|
@ -877,7 +877,7 @@
|
||||||
refreshing: false,
|
refreshing: false,
|
||||||
restartResult: '',
|
restartResult: '',
|
||||||
showAlert: false,
|
showAlert: false,
|
||||||
isMobile: window.innerWidth <= 768,
|
isMobile: DeviceUtils.isMobile(),
|
||||||
advSettings: 'xraySetting',
|
advSettings: 'xraySetting',
|
||||||
obsSettings: '',
|
obsSettings: '',
|
||||||
cm: null,
|
cm: null,
|
||||||
|
|
Loading…
Reference in a new issue