diff --git a/package.json b/package.json index 03c30ef..90e951f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "media_player_client", - "version": "1.5.8", + "version": "1.5.9", "description": "A Quasar Framework app", "productName": "MediaPlayerClient", "author": "fangxiang ", diff --git a/quasar.conf.js b/quasar.conf.js index 9050962..1a04b15 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -41,7 +41,11 @@ module.exports = configure(function (ctx) { // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build build: { vueRouterMode: "hash", // available values: 'hash', 'history' - + uglifyOptions: { + compress: { + drop_console: true, + }, + }, // transpile: false, // Add dependencies for transpiling with Babel (Array of string/regex) // (from node_modules, which are by default not transpiled). diff --git a/src/components/AdvancedDebugDialog.vue b/src/components/AdvancedDebugDialog.vue index 635c746..f0f1902 100644 --- a/src/components/AdvancedDebugDialog.vue +++ b/src/components/AdvancedDebugDialog.vue @@ -11,7 +11,7 @@ } " > - +
@@ -37,8 +37,67 @@ - + + + {{ $t("product") }} + + + + + + + + + + + + {{ $t("fusion") }} + +
+ +
+
+
{{ $t("function") }} @@ -69,7 +128,6 @@ :disable="loading" /> - @@ -83,40 +141,22 @@ :disable="loading" /> - + + + - - - - - - + + {{ $t("language") }} @@ -153,7 +193,6 @@ /> - @@ -199,8 +238,10 @@ import { useStore } from "src/store"; import { useQuasar, date as $date } from "quasar"; import { useI18n } from "vue-i18n"; import GlobalData from "src/common/GlobalData"; -import { Protocol } from "src/entities/WSProtocol"; -import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; +import { + EDeviceAttribute, + EDeviceAttributeHelper, +} from "src/entities/EDeviceAttribute"; export default defineComponent({ name: "ComponentAdvancedDebugDialog", @@ -226,10 +267,44 @@ export default defineComponent({ const function_magic_wall = ref( $store.state.custom_defines.function_magic_wall ); - const function_fusion = ref( - $store.state.custom_defines.function_magic_wall - ); + const function_fusion = ref($store.state.custom_defines.function_fusion); + const function_fusion_count = ref(0); const target_language = ref("zh-CN"); + const selected_product = ref(""); + + watch( + () => selected_product.value, + (newValue) => { + function_fusion.value = newValue == "fusion"; + function_magic_wall.value = newValue == "magic_wall"; + } + ); + + const getFinalAttribute = () => { + let attribute = EDeviceAttribute.None; + if (function_center_control.value) { + attribute |= EDeviceAttribute.CenterControl; + } + if (function_output_board.value) { + attribute |= EDeviceAttribute.OutputBoard; + } + if (function_mirroring_output.value) { + attribute |= EDeviceAttribute.MirroringOutput; + } + + if (function_custom_ISV.value) { + attribute |= EDeviceAttribute.CustomISV; + } + if (function_magic_wall.value) { + attribute |= EDeviceAttribute.ProductMagicWall; + } + if (function_fusion.value) { + attribute |= EDeviceAttributeHelper.getProdictFusionAttributeByIndex( + function_fusion_count.value + ); + } + return attribute; + }; return { show_dialog, @@ -239,8 +314,10 @@ export default defineComponent({ function_custom_ISV, function_magic_wall, function_fusion, + function_fusion_count, function_mirroring_output, target_language, + selected_product, showDialog() { show_dialog.value = true; @@ -254,8 +331,18 @@ export default defineComponent({ $store.state.custom_defines.function_mirroring_output; function_magic_wall.value = $store.state.custom_defines.function_magic_wall; - function_fusion.value = - $store.state.custom_defines.function_fusion; + function_fusion.value = $store.state.custom_defines.function_fusion; + function_fusion_count.value = + EDeviceAttributeHelper.getProductFusionOutputCountDefault( + $store.state.device_attribute, + 1 + ); + + if (function_magic_wall.value) { + selected_product.value = "magic_wall"; + } else if (function_fusion.value) { + selected_product.value = "fusion"; + } }, resetData() { loading.value = false; @@ -264,8 +351,9 @@ export default defineComponent({ function_output_board.value = false; function_mirroring_output.value = false; function_custom_ISV.value = false; - function_magic_wall.value=false; - function_fusion.value=false + function_magic_wall.value = false; + function_fusion.value = false; + selected_product.value = ""; }, restartDevice() { @@ -343,27 +431,22 @@ export default defineComponent({
`, }); }, - setDeviceAttribute() { - let attribute = EDeviceAttribute.None; - if (function_center_control.value) { - attribute |= EDeviceAttribute.CenterControl; - } - if (function_output_board.value) { - attribute |= EDeviceAttribute.OutputBoard; - } - if (function_mirroring_output.value) { - attribute |= EDeviceAttribute.MirroringOutput; - } + setDeviceAttributeAndProduct() { + let attribute = getFinalAttribute(); + GlobalData.getInstance() + .getCurrentClient() + ?.setDeviceAttribute(attribute); - if (function_custom_ISV.value) { - attribute |= EDeviceAttribute.CustomISV; - } - if (function_magic_wall.value) { - attribute |= EDeviceAttribute.ProductMagicWall; - } - if (function_fusion.value) { - attribute |= EDeviceAttribute.ProductFusion; - } + $q.notify({ + color: "positive", + icon: "done", + message: $t.t("set device function") + $t.t("success") + "!", + position: "top", + timeout: 1500, + }); + }, + setDeviceAttribute() { + let attribute = getFinalAttribute(); GlobalData.getInstance() .getCurrentClient() @@ -389,16 +472,16 @@ export default defineComponent({ timeout: 1500, }); }, - changeMagic(){ - if(function_magic_wall.value){ - function_fusion.value=false; + changeMagic() { + if (function_magic_wall.value) { + function_fusion.value = false; } }, - changeFusion(){ - if(function_fusion.value){ - function_magic_wall.value=false; + changeFusion() { + if (function_fusion.value) { + function_magic_wall.value = false; } - } + }, }; }, }); diff --git a/src/components/RegisterDialog.vue b/src/components/RegisterDialog.vue index a2d1377..16502f8 100644 --- a/src/components/RegisterDialog.vue +++ b/src/components/RegisterDialog.vue @@ -73,286 +73,346 @@ - - - - {{ $t("register type") }} - - -
- + + + + {{ $t("register type") }} + + +
+ + +
+
+
+ + + {{ $t("register code") }} + + +
+ {{ register_code }} +
+
+ + + + + - + + {{ $t("copy") }}{{ $t("register code") }} + + + +
+ + + {{ $t("active code") }} + + + -
-
-
- - - {{ $t("register code") }} - - -
- {{ register_code }} -
-
- - - - - - - {{ $t("copy") }}{{ $t("register code") }} - - - -
- - - {{ $t("active code") }} - - - - - - - - {{ $t("open file") }} - - - - - - - {{ $t("secret key") }} - - - - - ({{ $t("optional") }}) - - - - {{ $t("server ipaddress") }} - - - - - - - - {{ $t("active type") }} - - -
- + + - + + {{ $t("open file") }} + + + + + + + {{ $t("secret key") }} + + + + + ({{ $t("optional") }}) + + + + {{ $t("server ipaddress") }} + + + -
-
-
- - - {{ $t("active time") }} - - - - - - - + + + + + {{ $t("active type") }} + + +
+ + +
+
+
+ + + {{ $t("active time") }} + + + + + + + + + + + {{ $t("product") }} + - - - {{ $t("function") }} - - -
- - - -
-
-
+ +
+ - - - -
- - - -
-
-
+ + +
+
+
+ + + {{ $t("fusion") }} + - - - {{ $t("language") }} - - -
- - -
-
-
-
+ +
+ +
+
+ +
+
+
+ + + + + + {{ $t("function") }} + + +
+ + + +
+
+
+ + + + +
+ +
+
+
+ + + + {{ $t("language") }} + + +
+ + +
+
+
@@ -406,7 +466,10 @@ import { useI18n } from "vue-i18n"; import GlobalData from "src/common/GlobalData"; import QrcodeVue from "qrcode.vue"; import { Protocol } from "src/entities/WSProtocol"; -import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; +import { + EDeviceAttribute, + EDeviceAttributeHelper, +} from "src/entities/EDeviceAttribute"; import ValidationUtil from "src/common/ValidationUtil"; export default defineComponent({ @@ -440,6 +503,16 @@ export default defineComponent({ const function_custom_ISV = ref(false); const function_magic_wall = ref(false); const function_fusion = ref(false); + const function_fusion_count = ref(1); + const selected_product = ref(""); + + watch( + () => selected_product.value, + (newValue) => { + function_fusion.value = newValue == "fusion"; + function_magic_wall.value = newValue == "magic_wall"; + } + ); const trial_days = ref(0); const last_days = ref(0); @@ -457,6 +530,7 @@ export default defineComponent({ trial_days.value = 0; register_date.value = ""; last_days.value = 0; + selected_product.value = ""; function_center_control.value = false; function_output_board.value = false; @@ -497,7 +571,18 @@ export default defineComponent({ $store.state.custom_defines.function_mirroring_output; function_magic_wall.value = $store.state.custom_defines.function_magic_wall; - function_magic_wall.value = $store.state.custom_defines.function_fusion; + function_fusion.value = $store.state.custom_defines.function_fusion; + function_fusion_count.value = + EDeviceAttributeHelper.getProductFusionOutputCountDefault( + $store.state.device_attribute, + 1 + ); + + if (function_magic_wall.value) { + selected_product.value = "magic_wall"; + } else if (function_fusion.value) { + selected_product.value = "fusion"; + } }; return { @@ -521,8 +606,10 @@ export default defineComponent({ function_custom_ISV, function_magic_wall, function_fusion, + function_fusion_count, function_center_control, function_mirroring_output, + selected_product, target_language, copyToClipboard, isShow() { @@ -653,7 +740,10 @@ export default defineComponent({ attribute |= EDeviceAttribute.ProductMagicWall; } if (function_fusion.value) { - attribute |= EDeviceAttribute.ProductFusion; + attribute |= + EDeviceAttributeHelper.getProdictFusionAttributeByIndex( + function_fusion_count.value + ); } GlobalData.getInstance() @@ -694,16 +784,6 @@ export default defineComponent({ isIpAddress(str: string) { return ValidationUtil.isIpAddress(str); }, - changeMagic() { - if (function_magic_wall.value) { - function_fusion.value = false; - } - }, - changeFusion() { - if (function_fusion.value) { - function_magic_wall.value = false; - } - }, }; }, }); diff --git a/src/entities/EDeviceAttribute.ts b/src/entities/EDeviceAttribute.ts index 585d87a..f53ccea 100644 --- a/src/entities/EDeviceAttribute.ts +++ b/src/entities/EDeviceAttribute.ts @@ -1,38 +1,145 @@ export enum EDeviceAttribute { - None_UnKNow = 0x0000, + None = 0x0000000000000001, + OutputBoard = 0x0000000000000002, + CenterControl = 0x0000000000000004, + MirroringOutput = 0x0000000000000008, + CustomISV = 0x0000000000000010, + Reserve5 = 0x0000000000000020, + Reserve6 = 0x0000000000000040, + Reserve7 = 0x0000000000000080, + Reserve8 = 0x0000000000000100, + Reserve9 = 0x0000000000000200, + Reserve10 = 0x0000000000000400, + Reserve11 = 0x0000000000000800, + Reserve12 = 0x0000000000001000, + Reserve13 = 0x0000000000002000, + Reserve14 = 0x0000000000004000, + Reserve15 = 0x0000000000008000, + Reserve16 = 0x0000000000010000, + Reserve17 = 0x0000000000020000, + Reserve18 = 0x0000000000040000, + Reserve19 = 0x0000000000080000, + Reserve20 = 0x0000000000100000, + ProductMagicWall = 0x0000000000200000, + ProductFusion_1 = 0x0000000000400000, + ProductFusion_2 = 0x0000000000800000, + ProductFusion_3 = 0x0000000001000000, + ProductFusion_4 = 0x0000000002000000, + ProductFusion_5 = 0x0000000004000000, + ProductFusion_6 = 0x0000000008000000, + ProductFusion_7 = 0x0000000010000000, + ProductFusion_8 = 0x0000000020000000, + ProductFusion_9 = 0x0000000040000000, + Reserve31 = 0x0000000080000000, + Reserve32 = 0x0000000100000000, + Reserve33 = 0x0000000200000000, + Reserve34 = 0x0000000400000000, + Reserve35 = 0x0000000800000000, + Reserve36 = 0x0000001000000000, + Reserve37 = 0x0000002000000000, + Reserve38 = 0x0000004000000000, + Reserve39 = 0x0000008000000000, + Reserve40 = 0x0000010000000000, + Reserve41 = 0x0000020000000000, + Reserve42 = 0x0000040000000000, + Reserve43 = 0x0000080000000000, + Reserve44 = 0x0000100000000000, + Reserve45 = 0x0000200000000000, + Reserve46 = 0x0000400000000000, + Reserve47 = 0x0000800000000000, + Reserve48 = 0x0001000000000000, + Reserve49 = 0x0002000000000000, + Reserve50 = 0x0004000000000000, + Reserve51 = 0x0008000000000000, + Reserve52 = 0x0010000000000000, + Reserve53 = 0x0020000000000000, + Reserve54 = 0x0040000000000000, + Reserve55 = 0x0080000000000000, + Reserve56 = 0x0100000000000000, + Reserve57 = 0x0200000000000000, + Reserve58 = 0x0400000000000000, + Reserve59 = 0x0800000000000000, + Reserve60 = 0x1000000000000000, + Reserve61 = 0x2000000000000000, + Reserve62 = 0x4000000000000000, + Reserve63 = 0x8000000000000000, - None = 0x00000001, - OutputBoard = 0x00000002, - CenterControl = 0x00000004, - MirroringOutput = 0x00000008, - CustomISV = 0x00000010, - Reserve5 = 0x00000020, - Reserve6 = 0x00000040, - Reserve7 = 0x00000080, - Reserve8 = 0x00000100, - Reserve9 = 0x00000200, - Reserve10 = 0x00000400, - Reserve11 = 0x00000800, - Reserve12 = 0x00001000, - Reserve13 = 0x00002000, - Reserve14 = 0x00004000, - Reserve15 = 0x00008000, - Reserve16 = 0x00010000, - Reserve17 = 0x00020000, - Reserve18 = 0x00040000, - Reserve19 = 0x00080000, - Reserve20 = 0x00100000, - ProductMagicWall = 0x00200000, - ProductFusion = 0x00400000, - Reserve23 = 0x00800000, - Reserve24 = 0x01000000, - Reserve25 = 0x02000000, - Reserve26 = 0x04000000, - Reserve27 = 0x08000000, - Reserve28 = 0x10000000, - Reserve29 = 0x20000000, - Reserve30 = 0x40000000, - Reserve31 = 0x80000000, - - All = 0xffffffff, + StandMediaControl = OutputBoard | CenterControl, + All = 0xffffffffffffffff, +} + +export class EDeviceAttributeHelper { + public static isProductFusion(attribute: number) { + return ( + (attribute & EDeviceAttribute.ProductFusion_1) != 0 || + (attribute & EDeviceAttribute.ProductFusion_2) != 0 || + (attribute & EDeviceAttribute.ProductFusion_3) != 0 || + (attribute & EDeviceAttribute.ProductFusion_4) != 0 || + (attribute & EDeviceAttribute.ProductFusion_5) != 0 || + (attribute & EDeviceAttribute.ProductFusion_6) != 0 || + (attribute & EDeviceAttribute.ProductFusion_7) != 0 || + (attribute & EDeviceAttribute.ProductFusion_8) != 0 || + (attribute & EDeviceAttribute.ProductFusion_9) != 0 + ); + } + + public static getProductFusionOutputCount(attribute: number) { + if (attribute & EDeviceAttribute.ProductFusion_1) { + return 1; + } else if (attribute & EDeviceAttribute.ProductFusion_2) { + return 2; + } else if (attribute & EDeviceAttribute.ProductFusion_3) { + return 3; + } else if (attribute & EDeviceAttribute.ProductFusion_4) { + return 4; + } else if (attribute & EDeviceAttribute.ProductFusion_5) { + return 5; + } else if (attribute & EDeviceAttribute.ProductFusion_6) { + return 6; + } else if (attribute & EDeviceAttribute.ProductFusion_7) { + return 7; + } else if (attribute & EDeviceAttribute.ProductFusion_8) { + return 8; + } else if (attribute & EDeviceAttribute.ProductFusion_9) { + return 9; + } else { + return 0; + } + } + + public static getProductFusionOutputCountDefault( + attribute: number, + default_Value: number + ) { + const ret = EDeviceAttributeHelper.getProductFusionOutputCount(attribute); + if (ret == 0) { + return default_Value; + } + return ret; + } + + public static getProdictFusionAttributeByIndex(index: number) { + switch (index) { + case 1: + return EDeviceAttribute.ProductFusion_1; + case 2: + return EDeviceAttribute.ProductFusion_2; + case 3: + return EDeviceAttribute.ProductFusion_3; + case 4: + return EDeviceAttribute.ProductFusion_4; + case 5: + return EDeviceAttribute.ProductFusion_5; + case 6: + return EDeviceAttribute.ProductFusion_6; + case 7: + return EDeviceAttribute.ProductFusion_7; + case 8: + return EDeviceAttribute.ProductFusion_8; + case 9: + return EDeviceAttribute.ProductFusion_9; + default: + return 0; + } + } } diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index ff19701..dd057e4 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -470,8 +470,9 @@ export default { "Please enter the points you need to add": "Please enter the points you need to add", "Whether to add control points": "Whether to add control points", - "Reset all program control points":"Reset all program control points", - "Reset the current program control point":"Reset the current program control point", + "Reset all program control points": "Reset all program control points", + "Reset the current program control point": + "Reset the current program control point", "device verify key": "Device Verify Key", "use wss": "Use Wss", "server address": "Server Address", @@ -490,6 +491,12 @@ export default { "export magic": "Export", "raster graph": "Raster Graph", "the folder name cannot start with a '.'": + "The Folder Name Cannot Start With a '.'", + "change resolution": "change resolution", + "Loading please wait": "Loading please wait", + product: "Product", + normal: "Normal", + "fusion out": "Out", "The Folder Name Cannot Start With a '.'", "change resolution":"change resolution", "Loading please wait":"Loading please wait", diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index e629f63..a9b6830 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -761,6 +761,9 @@ export default { "Version Mismatch !": "版本不匹配!", "Version Mismatch ! Please Upgrade The Software Again ! Otherwise, The File Function Cannot Be Used !": "版本不匹配!请重新升级软件!否则文件功能无法正常使用!", + product: "产品", + normal: "普通", + "fusion out": "出", "Please enter the square number":"请输入平方数", "Change projector layout":"更改投影机布局" }; diff --git a/src/store/index.ts b/src/store/index.ts index fd7e98c..7e1436a 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,3 +1,4 @@ +import { EDeviceAttributeHelper } from "./../entities/EDeviceAttribute"; import { ConnectTableEntity } from "src/entities/ConnectTableEntity"; import { PollingEntity, @@ -440,7 +441,7 @@ export default store(function (/* { ssrContext } */) { state.custom_defines.function_magic_wall = (state.device_attribute & EDeviceAttribute.ProductMagicWall) != 0; state.custom_defines.function_fusion = - (state.device_attribute & EDeviceAttribute.ProductFusion) != 0; + EDeviceAttributeHelper.isProductFusion(state.device_attribute); } }, setAvancedDebug(state: StateInterface, playload?: any) {