Skip to content

Commit

Permalink
Merge pull request SonicCloudOrg#172 from SonicCloudOrg/dev
Browse files Browse the repository at this point in the history
rcReady
  • Loading branch information
ZhouYixun authored Jun 29, 2022
2 parents 7939d44 + 3f95b57 commit 946cecc
Show file tree
Hide file tree
Showing 16 changed files with 425 additions and 208 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login -u zhouyixun --password-stdin
- name: build docker image
run: docker build -t sonicorg/sonic-client-web:v1.4.1-beta .
run: docker build -t sonicorg/sonic-client-web:v1.4.1-rc .
- name: push docker image
run: docker push sonicorg/sonic-client-web:v1.4.1-beta
run: docker push sonicorg/sonic-client-web:v1.4.1-rc
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN_ALIYUN }}" | docker login --username=小虫哔哔 registry.cn-hangzhou.aliyuncs.com --password-stdin
- name: tag
run : docker tag sonicorg/sonic-client-web:v1.4.1-beta registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-client-web:v1.4.1-beta
run : docker tag sonicorg/sonic-client-web:v1.4.1-rc registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-client-web:v1.4.1-rc
- name: push docker image
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-client-web:v1.4.1-beta
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-client-web:v1.4.1-rc
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.1-beta
Version: 1.4.1-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.1-beta",
"version": "1.4.1-rc",
"author": "SonicCloudOrg",
"scripts": {
"dev": "vite",
Expand Down
4 changes: 2 additions & 2 deletions replace.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sed -i "s/SERVER_HOST/${SERVER_HOST}/g" /usr/share/nginx/html/assets/*.js
sed -i "s/SERVER_PORT/${SERVER_PORT}/g" /usr/share/nginx/html/assets/*.js
sed -i "s/SONIC_SERVER_HOST/${SONIC_SERVER_HOST}/g" /usr/share/nginx/html/assets/*.js
sed -i "s/SONIC_SERVER_PORT/${SONIC_SERVER_PORT}/g" /usr/share/nginx/html/assets/*.js
/usr/sbin/nginx -c /etc/nginx/nginx.conf -g 'daemon off;'
Binary file added src/assets/img/jenkins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 5 additions & 13 deletions src/components/ElementSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,20 @@ const props = defineProps({
const pageData = ref({
content: []
});
const name = ref("")
const pageSize = ref(10);
const currentPage = ref(0)
const findByName = (name) => {
const findByName = (n) => {
props.step.elements[props.index] = null
axios.get("/controller/elements/list", {
params: {
name,
projectId: props.projectId,
type: props.type,
page: 1,
pageSize: pageSize.value,
}
}).then(resp => {
pageData.value = resp.data
currentPage.value = pageData.value['number'] + 1
})
name.value = n
findByProjectIdAndEleType(true)
}
const findByProjectIdAndEleType = (event, pageNum, pSize) => {
if (event) {
props.step.elements[props.index] = null
axios.get("/controller/elements/list", {
params: {
name: name.value,
projectId: props.projectId,
type: props.type,
page: pageNum || 1,
Expand Down
1 change: 1 addition & 0 deletions src/components/ElementUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ onMounted(() => {
<el-option label="id(resource-id)" value="id"></el-option>
<el-option value="xpath"></el-option>
<el-option label="nsPredicate(仅支持iOS10或以上)" value="nsPredicate"></el-option>
<el-option label="uiautomator(仅支持Android)" value="androidUIAutomator"></el-option>
<el-option value="accessibilityId"></el-option>
</el-option-group>
<el-option-group label="特殊定位方式">
Expand Down
61 changes: 59 additions & 2 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,28 @@ import {ElMessage} from "element-plus";
import {localeList} from '@/config/locale'
import useLocale from '@/locales/useLocale'
import {useI18n} from 'vue-i18n'
import useClipboard from 'vue-clipboard3';
const {toClipboard} = useClipboard();
const changePwdForm = ref(null)
const changePwd = ref({
oldPwd: "",
newPwd: "",
newPwdSec: ""
})
const copy = (value) => {
try {
toClipboard(value);
ElMessage.success({
message: '复制成功!',
});
} catch (e) {
ElMessage.error({
message: '复制失败!',
});
}
};
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error($t('form.notEmpty')))
Expand All @@ -30,6 +45,7 @@ const validatePass = (rule, value, callback) => {
}
}
const dialogChangePwd = ref(false)
const tokenNew = ref("")
watch(dialogChangePwd, (newValue, oldValue) => {
if (!newValue) {
changePwd.value = {
Expand All @@ -39,6 +55,18 @@ watch(dialogChangePwd, (newValue, oldValue) => {
}
}
})
const generateToken = () => {
axios.get("/controller/users/generateToken", {
params: {day: day.value}
}).then(resp => {
if (resp['code'] === 2000) {
ElMessage.success({
message: resp['message'],
});
tokenNew.value = resp['data']
}
})
}
const changePwdSummit = () => {
changePwdForm['value'].validate((valid) => {
if (valid) {
Expand All @@ -58,6 +86,8 @@ const changePwdSummit = () => {
}
const dialogUserInfo = ref(false)
const dialogVisible = ref(false)
const dialogToken = ref(false)
const day = ref(14)
const store = useStore();
const router = useRouter();
const route = useRoute();
Expand Down Expand Up @@ -187,7 +217,7 @@ const changeLocaleHandler = function (val) {
</el-menu-item>
<el-menu-item index="1-1" @click="dialogUserInfo = true">{{ $t('layout.myInfo') }}</el-menu-item>
<el-menu-item index="1-2" @click="dialogChangePwd = true">{{ $t('layout.changePassword') }}</el-menu-item>
<el-menu-item index="1-3" @click="logout">{{ $t('layout.signOut') }}</el-menu-item>
<el-menu-item index="1-4" @click="dialogToken = true">Access Token</el-menu-item>
<el-sub-menu index="2">
<template #title
><span
Expand Down Expand Up @@ -224,6 +254,7 @@ const changeLocaleHandler = function (val) {
REST API
</el-menu-item>
</el-sub-menu>
<el-menu-item index="1-3" @click="logout">{{ $t('layout.signOut') }}</el-menu-item>
</el-sub-menu>
</el-menu>
</div>
Expand All @@ -249,7 +280,7 @@ const changeLocaleHandler = function (val) {
</el-form-item>
<el-form-item :label="$t('form.role')">
<el-tag size="small">
{{ store.state.userInfo.roleName }}
{{ store.state.userInfo.roleName ? store.state.userInfo.roleName : "无" }}
</el-tag>
</el-form-item>
</el-form>
Expand Down Expand Up @@ -311,6 +342,32 @@ const changeLocaleHandler = function (val) {
<el-button size="small" type="primary" @click="changePwdSummit">{{ $t('form.confirm') }}</el-button>
</div>
</el-dialog>
<el-dialog
title="AccessToken"
v-model="dialogToken"
width="520px"
>
<el-form
v-if="dialogToken"
label-position="left"
class="demo-table-expand"
label-width="70px"
size="small"
>
<el-form-item label="过期天数">
<el-input-number size="small" :min="1" :max="999" v-model="day"></el-input-number>
</el-form-item>
<el-form-item label="生成结果">
<div style="cursor: pointer" v-if="tokenNew!==''" @click="copy(tokenNew)">
{{ tokenNew.substring(0, 15) + "*******(请点击复制)" }}
</div>
<div v-else>点击确定后在此处复制</div>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button size="small" type="primary" @click="generateToken">{{ $t('form.confirm') }}</el-button>
</div>
</el-dialog>
<el-scrollbar class="demo-tree-scrollbar" style="height: 100%">
<el-main
v-if="route.params.projectId || route.params.deviceId|| route.fullPath==='/Index/Devices' || route.fullPath.indexOf('/Setting') != -1">
Expand Down
4 changes: 2 additions & 2 deletions src/components/StepShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ defineProps({
</span>
<span v-if="step.stepType === 'install'">
<el-tag size="small" style="margin-right: 10px">安装应用</el-tag>
App路径:{{ step.text }}
{{ step.content === "2" ? "从安装包列表安装" : ("App路径:" + step.text) }}
</span>
<span v-if="step.stepType === 'uninstall'">
<el-tag size="small" style="margin-right: 10px">卸载应用</el-tag>
Expand Down Expand Up @@ -159,7 +159,7 @@ defineProps({
>
{{ step.content }}
</span>
<span v-if="step.stepType === 'sendKeysByActions'">
<span v-if="step.stepType === 'sendKeysByActions'">
<el-tag type="info" size="small">{{ step.elements[0]['eleName'] }}</el-tag>
<el-tag size="small" style="margin-left: 10px; margin-right: 10px"
>输入文本(Actions)</el-tag
Expand Down
44 changes: 40 additions & 4 deletions src/components/StepUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ const getStepInfo = (id) => {
|| step.value.stepType === 'checkImage') {
step.value.content = parseInt(step.value.content);
}
if (step.value.stepType === 'install') {
if (step.value.content === "") {
step.value.content = 1
} else {
step.value.content = parseInt(step.value.content);
}
}
if (step.value.stepType === 'monkey') {
monkey.value = JSON.parse(step.value.content);
activityList.value = JSON.parse(step.value.text);
Expand Down Expand Up @@ -888,6 +895,21 @@ onMounted(() => {
<el-alert show-icon style="margin-bottom:10px" close-text="Get!" type="info"
title="TIPS: 需要临时变量或全局变量时,可以添加{{变量名}}的形式"/>
<el-form-item
label="安装方式"
prop="content"
:rules="{
required: true,
message: '安装方式不能为空',
trigger: 'change',
}"
>
<el-select v-model="step.content">
<el-option label="自定义下载路径或本地安装" :value="1"></el-option>
<el-option label="已有安装包列表安装" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="step.content===1"
prop="text"
label="安装路径"
:rules="{
Expand All @@ -901,6 +923,18 @@ onMounted(() => {
placeholder="请输入App下载路径或本地apk路径"
></el-input>
</el-form-item>
<el-alert v-if="step.content===2" show-icon style="margin-bottom:10px" close-text="Get!" type="info"
title="TIPS: 需要先接入Jenkins插件,并确认安装包管理有对应安装包。多个符合条件的安装包优先选择最新的安装。"/>
<el-form-item
v-if="step.content===2"
prop="text"
label="分支名称"
>
<el-input
v-model="step.text"
placeholder="请输入分支名称,支持模糊匹配,可以为空"
></el-input>
</el-form-item>
</div>

<div v-if="step.stepType === 'uninstall'">
Expand Down Expand Up @@ -987,10 +1021,12 @@ onMounted(() => {
</div>

<div v-if="step.stepType === 'sendKeysByActions'">
<el-alert show-icon style="margin-bottom:10px" close-text="Get!" type="info"
title="TIPS: 使用Android Driver在Flutter页面输入文本时使用此方式"/>
<el-alert show-icon style="margin-bottom:10px" close-text="Get!" type="info"
title="TIPS: 需要临时变量或全局变量时,可以添加{{变量名}}的形式"/>
<el-alert show-icon style="margin-bottom:10px" close-text="Get!" type="info">
<template #title>
<div>TIPS: 使用Android Driver在Flutter页面输入文本时使用此方式。</div>
<div> 需要临时变量或全局变量时,可以添加{{ 变量名 }}的形式。</div>
</template>
</el-alert>
<element-select label="控件元素" place="请选择控件元素"
:index="0" :project-id="projectId" type="normal" :step="step"/>
<el-form-item label="输入值">
Expand Down
2 changes: 1 addition & 1 deletion src/http/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (process.env.NODE_ENV === 'development') {
baseURL = 'http://localhost:8094/api'
}
if (process.env.NODE_ENV === 'production') {
baseURL = 'http://SERVER_HOST:SERVER_PORT/server/api'
baseURL = 'http://SONIC_SERVER_HOST:SONIC_SERVER_PORT/server/api'
}
const $http = axios.create()
baseURL = baseURL.replace(":80/", "/")
Expand Down
Loading

0 comments on commit 946cecc

Please sign in to comment.