small fixes

This commit is contained in:
Alireza Ahmadi
2025-01-22 00:45:10 +01:00
parent b6c16e1bdf
commit 24a3e7b0da
30 changed files with 48 additions and 61 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ export default {
computed: { computed: {
optionTLS: { optionTLS: {
get(): boolean { return this.$props.addr.tls != undefined }, get(): boolean { return this.$props.addr.tls != undefined },
set(v:boolean) { this.$props.addr.tls = v ? { enabled: true } : undefined; } set(v:boolean) { this.$props.addr.tls = v ? { enabled: true } : undefined }
}, },
optionRemark: { optionRemark: {
get(): boolean { return this.$props.addr.remark != undefined }, get(): boolean { return this.$props.addr.remark != undefined },
+1 -1
View File
@@ -209,7 +209,7 @@ const startTimer = () => {
const stopTimer = () => { const stopTimer = () => {
if (intervalId) { if (intervalId) {
clearInterval(intervalId); clearInterval(intervalId)
intervalId = null intervalId = null
} }
} }
+1 -1
View File
@@ -114,7 +114,7 @@ export default {
needNetwork():boolean { return this.haveNetwork.includes(this.$props.type) }, needNetwork():boolean { return this.haveNetwork.includes(this.$props.type) },
needUot():boolean { return this.havUoT.includes(this.$props.type) }, needUot():boolean { return this.havUoT.includes(this.$props.type) },
packet_encoding: { packet_encoding: {
get() { return this.$props.inData.out_json.packet_encoding != undefined ? this.$props.inData.out_json.packet_encoding : 'none'; }, get() { return this.$props.inData.out_json.packet_encoding != undefined ? this.$props.inData.out_json.packet_encoding : 'none' },
set(v:string) { this.$props.inData.out_json.packet_encoding = v != "none" ? v : undefined } set(v:string) { this.$props.inData.out_json.packet_encoding = v != "none" ? v : undefined }
}, },
}, },
+1 -1
View File
@@ -15,7 +15,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { i18n } from '@/locales'; import { i18n } from '@/locales'
export default { export default {
-2
View File
@@ -46,8 +46,6 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { KeepAlive } from 'vue';
export default { export default {
props: ['data'], props: ['data'],
data() { data() {
+1 -1
View File
@@ -17,7 +17,7 @@
import { Notivue, Notification, NotivueSwipe, outlinedIcons, pastelTheme, darkTheme } from 'notivue' import { Notivue, Notification, NotivueSwipe, outlinedIcons, pastelTheme, darkTheme } from 'notivue'
import { computed } from 'vue' import { computed } from 'vue'
import { useTheme } from 'vuetify' import { useTheme } from 'vuetify'
import vuetify from '@/plugins/vuetify'; import vuetify from '@/plugins/vuetify'
const Theme = useTheme() const Theme = useTheme()
+2 -2
View File
@@ -34,8 +34,8 @@ export default {
}, },
computed: { computed: {
override_port: { override_port: {
get() { return this.$props.data.override_port ? this.$props.data.override_port : ''; }, get() { return this.$props.data.override_port ? this.$props.data.override_port : '' },
set(newValue: any) { this.$props.data.override_port = newValue.length == 0 || newValue == 0 ? undefined : parseInt(newValue); } set(newValue: any) { this.$props.data.override_port = newValue.length == 0 || newValue == 0 ? undefined : parseInt(newValue) }
}, },
}, },
components: { Network } components: { Network }
+1 -1
View File
@@ -28,7 +28,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Headers from '@/components/Headers.vue'; import Headers from '@/components/Headers.vue'
export default { export default {
props: ['data'], props: ['data'],
@@ -111,13 +111,16 @@ export default {
}, },
computed: { computed: {
version: { version: {
get() { this.version = this.Inbound.version; return this.Inbound.version; }, get() {
this.version = this.Inbound.version
return this.Inbound.version
},
set(newValue: any) { set(newValue: any) {
switch (newValue) { switch (newValue) {
case 1: case 1:
delete this.Inbound.password delete this.Inbound.password
delete this.Inbound.handshake_for_server_name delete this.Inbound.handshake_for_server_name
break; break
case 2: case 2:
if (!this.Inbound.password) { if (!this.Inbound.password) {
this.Inbound.password = "" this.Inbound.password = ""
@@ -125,23 +128,23 @@ export default {
if (!this.Inbound.handshake_for_server_name) { if (!this.Inbound.handshake_for_server_name) {
this.Inbound.handshake_for_server_name = {} this.Inbound.handshake_for_server_name = {}
} }
break; break
case 3: case 3:
delete this.Inbound.password delete this.Inbound.password
if (!this.Inbound.handshake_for_server_name) { if (!this.Inbound.handshake_for_server_name) {
this.Inbound.handshake_for_server_name = {} this.Inbound.handshake_for_server_name = {}
} }
break; break
} }
this.Inbound.version = newValue; this.Inbound.version = newValue
} }
}, },
Inbound(): ShadowTLS { Inbound(): ShadowTLS {
return <ShadowTLS>this.$props.data; return <ShadowTLS>this.$props.data
}, },
server_port: { server_port: {
get() { return this.Inbound.handshake.server_port ? this.Inbound.handshake.server_port : 443; }, get() { return this.Inbound.handshake.server_port ? this.Inbound.handshake.server_port : 443 },
set(newValue: any) { this.Inbound.handshake.server_port = newValue.length == 0 || newValue == 0 ? 443 : parseInt(newValue); } set(newValue: any) { this.Inbound.handshake.server_port = newValue.length == 0 || newValue == 0 ? 443 : parseInt(newValue) }
}, },
}, },
components: { Dial } components: { Dial }
@@ -33,8 +33,8 @@
<script lang="ts"> <script lang="ts">
import Network from '@/components/Network.vue' import Network from '@/components/Network.vue'
import UoT from '@/components/UoT.vue'; import UoT from '@/components/UoT.vue'
import RandomUtil from '@/plugins/randomUtil'; import RandomUtil from '@/plugins/randomUtil'
export default { export default {
props: ['direction','data'], props: ['direction','data'],
+1 -1
View File
@@ -37,7 +37,7 @@
<script lang="ts"> <script lang="ts">
import Network from '@/components/Network.vue' import Network from '@/components/Network.vue'
import UoT from '@/components/UoT.vue'; import UoT from '@/components/UoT.vue'
export default { export default {
props: ['data'], props: ['data'],
+1 -1
View File
@@ -39,7 +39,7 @@ export default {
}, },
computed: { computed: {
packet_encoding: { packet_encoding: {
get() { return this.$props.data.packet_encoding != undefined ? this.$props.data.packet_encoding : 'none'; }, get() { return this.$props.data.packet_encoding != undefined ? this.$props.data.packet_encoding : 'none' },
set(newValue:string) { this.$props.data.packet_encoding = newValue != "none" ? newValue : undefined } set(newValue:string) { this.$props.data.packet_encoding = newValue != "none" ? newValue : undefined }
}, },
}, },
+1 -1
View File
@@ -63,7 +63,7 @@ export default {
}, },
computed: { computed: {
packet_encoding: { packet_encoding: {
get() { return this.$props.data.packet_encoding != undefined ? this.$props.data.packet_encoding : 'none'; }, get() { return this.$props.data.packet_encoding != undefined ? this.$props.data.packet_encoding : 'none' },
set(newValue:string) { this.$props.data.packet_encoding = newValue != "none" ? newValue : undefined } set(newValue:string) { this.$props.data.packet_encoding = newValue != "none" ? newValue : undefined }
}, },
}, },
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { HumanReadable } from '@/plugins/utils'; import { HumanReadable } from '@/plugins/utils'
import { computed } from 'vue'; import { computed } from 'vue'
const props = defineProps({ const props = defineProps({
tilesData: <any>{}, tilesData: <any>{},
@@ -19,7 +19,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Headers from '../Headers.vue'; import Headers from '../Headers.vue'
export default { export default {
props: ['transport'], props: ['transport'],
data() { data() {
+3 -3
View File
@@ -9,12 +9,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue" import { ref } from "vue"
import { useTheme } from "vuetify" import { useTheme } from 'vuetify'
import { useRoute } from "vue-router"; import { useRoute } from 'vue-router'
defineProps(['isMobile']) defineProps(['isMobile'])
const route = useRoute(); const route = useRoute()
const theme = useTheme() const theme = useTheme()
const darkMode = ref(localStorage.getItem('theme') == "dark") const darkMode = ref(localStorage.getItem('theme') == "dark")
+1 -1
View File
@@ -191,7 +191,7 @@
import { createClient, randomConfigs, updateConfigs, Link, Client } from '@/types/clients' import { createClient, randomConfigs, updateConfigs, Link, Client } from '@/types/clients'
import DatePick from '@/components/DateTime.vue' import DatePick from '@/components/DateTime.vue'
import { HumanReadable } from '@/plugins/utils' import { HumanReadable } from '@/plugins/utils'
import Data from '@/store/modules/data'; import Data from '@/store/modules/data'
export default { export default {
props: ['visible', 'id', 'inboundTags', 'groups'], props: ['visible', 'id', 'inboundTags', 'groups'],
+1 -1
View File
@@ -89,7 +89,7 @@ import DatePick from '@/components/DateTime.vue'
import { push } from 'notivue' import { push } from 'notivue'
import RandomUtil from '@/plugins/randomUtil' import RandomUtil from '@/plugins/randomUtil'
import { Client, createClient, randomConfigs } from '@/types/clients' import { Client, createClient, randomConfigs } from '@/types/clients'
import { i18n } from '@/locales'; import { i18n } from '@/locales'
export default { export default {
props: ['visible', 'inboundTags', 'groups'], props: ['visible', 'inboundTags', 'groups'],
-1
View File
@@ -169,7 +169,6 @@
<script lang="ts"> <script lang="ts">
import { logicalRule, rule, actionKeys } from '@/types/rules' import { logicalRule, rule, actionKeys } from '@/types/rules'
import RuleOptions from '@/components/Rule.vue' import RuleOptions from '@/components/Rule.vue'
import { title } from 'process';
export default { export default {
props: ['visible', 'data', 'index', 'clients', 'inTags', 'outTags', 'rsTags'], props: ['visible', 'data', 'index', 'clients', 'inTags', 'outTags', 'rsTags'],
emits: ['close', 'save'], emits: ['close', 'save'],
+2 -2
View File
@@ -101,8 +101,8 @@ export default {
tooltip: { tooltip: {
callbacks: { callbacks: {
text: (ctx:any) => { text: (ctx:any) => {
const {axis = 'xy', intersect, mode} = ctx.chart.options.interaction; const {axis = 'xy', intersect, mode} = ctx.chart.options.interaction
return 'Mode: ' + mode + ', axis: ' + axis + ', intersect: ' + intersect; return 'Mode: ' + mode + ', axis: ' + axis + ', intersect: ' + intersect
}, },
footer: (items:any[]) => { footer: (items:any[]) => {
return HumanReadable.sizeFormat(items.reduce((acc, c) => acc + c.raw, 0)) return HumanReadable.sizeFormat(items.reduce((acc, c) => acc + c.raw, 0))
-2
View File
@@ -1,5 +1,3 @@
import { en } from "vuetify/lib/locale/index.mjs";
export default { export default {
message: "Welcome", message: "Welcome",
success: "success", success: "success",
-2
View File
@@ -1,5 +1,3 @@
import { config } from "process";
export default { export default {
message: "خوش آمدید", message: "خوش آمدید",
success: "موفق", success: "موفق",
-2
View File
@@ -1,5 +1,3 @@
import { config } from "process";
export default { export default {
message: "Добро пожаловать", message: "Добро пожаловать",
success: "успех", success: "успех",
-2
View File
@@ -1,5 +1,3 @@
import { title } from "process";
export default { export default {
message: "Chào mừng OHB", message: "Chào mừng OHB",
success: "Thành công", success: "Thành công",
+1 -1
View File
@@ -43,7 +43,7 @@ export interface Warp extends WireGuard {
type InterfaceMap = { type InterfaceMap = {
[Key in keyof typeof EpTypes]: { [Key in keyof typeof EpTypes]: {
type: string type: string
[otherProperties: string]: any; // You can add other properties as needed [otherProperties: string]: any // You can add other properties as needed
} }
} }
+1 -1
View File
@@ -223,7 +223,7 @@ export interface URLTest extends OutboundBasics {
type InterfaceMap = { type InterfaceMap = {
[Key in keyof typeof OutTypes]: { [Key in keyof typeof OutTypes]: {
type: string type: string
[otherProperties: string]: any; // You can add other properties as needed [otherProperties: string]: any // You can add other properties as needed
} }
} }
-1
View File
@@ -223,7 +223,6 @@ import QrCode from '@/layouts/modals/QrCode.vue'
import Stats from '@/layouts/modals/Stats.vue' import Stats from '@/layouts/modals/Stats.vue'
import { Client } from '@/types/clients' import { Client } from '@/types/clients'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { Inbound, inboundWithUsers } from '@/types/inbounds'
import { HumanReadable } from '@/plugins/utils' import { HumanReadable } from '@/plugins/utils'
import { i18n } from '@/locales' import { i18n } from '@/locales'
import { push } from 'notivue' import { push } from 'notivue'
+3 -3
View File
@@ -95,10 +95,10 @@
import Data from '@/store/modules/data' import Data from '@/store/modules/data'
import EndpointVue from '@/layouts/modals/Endpoint.vue' import EndpointVue from '@/layouts/modals/Endpoint.vue'
import Stats from '@/layouts/modals/Stats.vue' import Stats from '@/layouts/modals/Stats.vue'
import { Endpoint } from '@/types/endpoints'; import { Endpoint } from '@/types/endpoints'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { i18n } from '@/locales'; import { i18n } from '@/locales'
import { push } from 'notivue'; import { push } from 'notivue'
const endpoints = computed((): Endpoint[] => { const endpoints = computed((): Endpoint[] => {
return <Endpoint[]> Data().endpoints return <Endpoint[]> Data().endpoints
+3 -7
View File
@@ -95,10 +95,10 @@
import Data from '@/store/modules/data' import Data from '@/store/modules/data'
import OutboundVue from '@/layouts/modals/Outbound.vue' import OutboundVue from '@/layouts/modals/Outbound.vue'
import Stats from '@/layouts/modals/Stats.vue' import Stats from '@/layouts/modals/Stats.vue'
import { Outbound } from '@/types/outbounds'; import { Outbound } from '@/types/outbounds'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { i18n } from '@/locales'; import { i18n } from '@/locales'
import { push } from 'notivue'; import { push } from 'notivue'
const outbounds = computed((): Outbound[] => { const outbounds = computed((): Outbound[] => {
return <Outbound[]> Data().outbounds return <Outbound[]> Data().outbounds
@@ -167,8 +167,4 @@ const showStats = (tag: string) => {
const closeStats = () => { const closeStats = () => {
stats.value.visible = false stats.value.visible = false
} }
function awaitData() {
throw new Error('Function not implemented.');
}
</script> </script>
+6 -6
View File
@@ -291,19 +291,19 @@ const delRuleset = (index: number) => {
delRulesetOverlay.value[index] = false delRulesetOverlay.value[index] = false
} }
const draggedItemIndex = ref(null); const draggedItemIndex = ref(null)
const onDragStart = (index: any) => { const onDragStart = (index: any) => {
draggedItemIndex.value = index; draggedItemIndex.value = index
} }
const onDrop = (index: any) => { const onDrop = (index: any) => {
if (draggedItemIndex.value !== null) { if (draggedItemIndex.value !== null) {
// Swap the dragged item with the dropped one // Swap the dragged item with the dropped one
const draggedItem = rules.value[draggedItemIndex.value]; const draggedItem = rules.value[draggedItemIndex.value]
rules.value.splice(draggedItemIndex.value, 1); rules.value.splice(draggedItemIndex.value, 1)
rules.value.splice(index, 0, draggedItem); rules.value.splice(index, 0, draggedItem)
draggedItemIndex.value = null; draggedItemIndex.value = null
} }
} }
</script> </script>