feat: api test and e2e test

This commit is contained in:
pnoker
2026-05-14 00:09:05 +08:00
parent 2cd6bd2794
commit e3970a244a
9 changed files with 0 additions and 221 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

-1
View File
@@ -146,7 +146,6 @@
profileEdit: 'nav.profileEdit',
pointDetail: 'nav.pointDetail',
pointEdit: 'nav.pointEdit',
application: 'nav.application',
settings: 'nav.settings',
settingsUser: 'nav.settingsUser',
settingsRole: 'nav.settingsRole',
-1
View File
@@ -78,7 +78,6 @@ export default {
profileEdit: 'Profile Edit',
pointDetail: 'Point Detail',
pointEdit: 'Point Edit',
application: 'Application',
settings: 'Settings',
settingsUser: 'User',
settingsRole: 'Role',
-1
View File
@@ -78,7 +78,6 @@ export default {
profileEdit: '模板编辑',
pointDetail: '位号详情',
pointEdit: '位号编辑',
application: '应用',
settings: '设置',
settingsUser: '用户管理',
settingsRole: '角色管理',
-15
View File
@@ -26,21 +26,6 @@ const Layout = () => import('@/components/layout/Layout.vue');
* Includes detail and edit pages for various entities
*/
const routes: Array<RouteRecordRaw> = [
{
path: '/home',
component: Layout,
children: [
{
name: 'application',
path: '/home/application',
meta: {
icon: 'el-icon-s-home',
title: 'Application',
},
component: () => import('@/views/application/Application.vue'),
},
],
},
{
path: '/driver',
component: Layout,
-35
View File
@@ -1,35 +0,0 @@
<!--
- Copyright 2016-present the IoT DC3 original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<template>
<iframe
:src="iframeUrl"
border="0"
class="things-application-iframe"
frameborder="no"
marginheight="0"
marginwidth="0"
></iframe>
</template>
<script lang="ts" src="./index.ts" />
<style lang="scss" scoped>
.things-application-iframe {
width: 100%;
height: 100%;
}
</style>
@@ -1,119 +0,0 @@
<!--
- Copyright 2016-present the IoT DC3 original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<template>
<div class="things-card things-card-application">
<el-card shadow="hover">
<div class="things-card-content">
<div class="things-card__body">
<div class="things-card-body-content">
<div class="things-card-body-content-application-icon" @click="show()">
<el-avatar :size="120" :src="icon" fit="fill" shape="square"></el-avatar>
</div>
</div>
</div>
<div class="things-card__footer">
<div class="things-card-footer-title">
<span class="things-card-body-content-application-name">{{ name }}</span>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { encode } from 'js-base64';
export default {
name: 'ApplicationCard',
props: {
name: {
type: String,
default: 'Dashboard',
},
icon: {
type: String,
default: 'images/app/application.png',
},
url: {
type: String,
default: '',
},
},
methods: {
show() {
if (this.url) {
this.$router.push({ name: 'application', query: { id: encode(this.url) } }).catch(() => {
// nothing to do
});
}
},
},
};
</script>
<style lang="scss" scoped>
@use '@/styles/things-card.scss';
// ApplicationCard 内联了一个 title 式 footer,不使用 ThingsCardActions。
.things-card__footer {
height: 35px;
margin-top: 2px;
display: flex;
justify-content: flex-end;
border-top: 1px solid #dcdfe6;
.things-card-footer-title {
text-align: center;
font-size: 14px;
font-weight: bold;
width: 100%;
margin-top: 5px;
}
}
.things-card-application {
width: 140px;
height: 170px;
margin-right: 10px;
margin-bottom: 10px;
.el-card {
width: 100%;
min-width: 140px !important;
min-height: 170px !important;
box-sizing: border-box;
}
}
.things-card-body-content-application-icon {
width: 120px;
cursor: pointer;
.el-avatar {
background: transparent;
}
}
.things-card-body-content-application-name {
display: block;
width: 120px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
-48
View File
@@ -1,48 +0,0 @@
/*
* Copyright 2016-present the IoT DC3 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { computed, defineComponent } from 'vue';
import { useRoute } from 'vue-router';
import { decode } from 'js-base64';
import { isUrl } from '@/utils/validationUtil';
export default defineComponent({
props: {
url: {
type: String,
default: 'http://zhb_nyx.gitee.io/data-view',
},
},
setup(props) {
const route = useRoute();
const iframeUrl = computed(() => {
const id = route.query.id as string;
if (!id) return props.url;
try {
const decodedUrl = decode(id);
return isUrl(decodedUrl) ? decodedUrl : props.url;
} catch {
return props.url;
}
});
return {
iframeUrl,
};
},
});
-1
View File
@@ -29,7 +29,6 @@ export interface RouteIds {
export const protectedRoutes = [
'/home',
'/home/application',
'/driver',
'/profile',
'/device',