Skip to content

Commit

Permalink
Merge pull request #150 from SonicCloudOrg/dev
Browse files Browse the repository at this point in the history
RC
  • Loading branch information
ZhouYixun authored May 30, 2022
2 parents 0415c16 + c4f96ca commit edf1352
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 162 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
█▄▄▄▄▄█▀ ██▄▄██ ██ ███ ▄▄██▄▄ ██▄▄▄▄█
▀▀▀▀▀ ▀▀▀▀ ▀▀ ▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀
Version: 1.4.0-beta
Version: 1.4.0-rc
Author: SonicCloudOrg
-->
<!DOCTYPE html>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sonic-client-web",
"version": "1.4.0-beta",
"version": "1.4.0-rc",
"author": "SonicCloudOrg",
"scripts": {
"dev": "vite",
Expand Down
1 change: 1 addition & 0 deletions src/components/TestSuiteUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import RenderDeviceName from "./RenderDeviceName.vue";
import RenderStatus from "./RenderStatus.vue";
import {VueDraggableNext} from 'vue-draggable-next';
import {Delete, Rank, Plus} from "@element-plus/icons";
import Pageable from './Pageable.vue'
const route = useRoute()
const props = defineProps({
Expand Down
33 changes: 26 additions & 7 deletions src/views/RemoteEmulator/AndroidRemote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/
import {useRoute, useRouter} from 'vue-router';
import {computed, nextTick, onBeforeUnmount, onMounted, ref, watch} from 'vue';
import {computed, nextTick, onBeforeMount, onBeforeUnmount, onMounted, ref, watch} from 'vue';
import {useStore} from 'vuex';
import axios from '@/http/axios';
import {ElMessage} from 'element-plus';
Expand Down Expand Up @@ -138,6 +138,7 @@ const pocoTypeList = ref([
img: 'Cocos2dx'
},
])
const isAudoInit = ref('0')
let imgWidth = 0;
let imgHeight = 0;
// 旋转状态 // 0 90 180 270
Expand Down Expand Up @@ -475,15 +476,15 @@ const setImgData = () => {
};
isShowImg.value = true;
};
const openSocket = (host, port, udId, key) => {
const openSocket = (host, port, key, udId) => {
if ('WebSocket' in window) {
//
websocket = new WebSocket(
'ws://' + host + ':' + port + '/websockets/android/' + udId + '/' + key + '/' + localStorage.getItem('SonicToken'),
'ws://' + host + ':' + port + '/websockets/android/' + key + '/' + udId + '/' + localStorage.getItem('SonicToken') + '/' + isAudoInit.value,
);
//
__Scrcpy = new Scrcpy({
socketURL: 'ws://' + host + ':' + port + '/websockets/android/screen/' + udId + '/' + key + '/' + localStorage.getItem('SonicToken'),
socketURL: 'ws://' + host + ':' + port + '/websockets/android/screen/' + key + '/' + udId + '/' + localStorage.getItem('SonicToken'),
node: 'scrcpy-video',
onmessage: screenWebsocketOnmessage,
excuteMode: screenMode.value
Expand All @@ -492,7 +493,7 @@ const openSocket = (host, port, udId, key) => {
changeScreenMode(screenMode.value, 1)
//
terminalWebsocket = new WebSocket(
'ws://' + host + ':' + port + '/websockets/terminal/' + udId + '/' + key,
'ws://' + host + ':' + port + '/websockets/android/terminal/' + key + '/' + udId + '/' + localStorage.getItem('SonicToken'),
);
} else {
console.error('不支持WebSocket');
Expand All @@ -503,7 +504,15 @@ const openSocket = (host, port, udId, key) => {
terminalWebsocket.onmessage = terminalWebsocketOnmessage;
terminalWebsocket.onclose = (e) => {
};
if (isAudoInit.value === '1') {
driverLoading.value = true
}
};
const changeAutoInit = (t) => {
if (t) {
localStorage.setItem('SonicAndroidIsAutoInit', t);
}
}
const sendLogcat = () => {
terminalWebsocket.send(
JSON.stringify({
Expand Down Expand Up @@ -1637,7 +1646,9 @@ const resetAudioPlayer = () => {
message: '远程音频同步成功!',
});
};
onBeforeMount(() => {
isAudoInit.value = localStorage.getItem('SonicAndroidIsAutoInit') ? localStorage.getItem('SonicAndroidIsAutoInit') : '0'
})
onMounted(() => {
if (store.state.project.id) {
project.value = store.state.project;
Expand Down Expand Up @@ -2397,10 +2408,18 @@ onMounted(() => {
<strong>其他</strong>
</template>
<div style="text-align: center">
<div style="margin: 22px 0px">
<div style="margin: 8px 0px">
<el-button size="mini" type="primary" :disabled="isDriverFinish" :loading="driverLoading"
@click="openDriver">初始化AppiumDriver
</el-button>
<div style="margin-top: 10px">
<el-switch class="refresh" active-value="1"
inactive-value="0" @change="changeAutoInit"
size="mini"
active-text="下次进入自动初始化"
active-color="#13ce66"
v-model="isAudoInit"/>
</div>
</div>
</div>
</el-card>
Expand Down
Loading

0 comments on commit edf1352

Please sign in to comment.