summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhanyuxia <[email protected]>2024-09-06 10:43:54 +0800
committerhanyuxia <[email protected]>2024-09-06 10:43:54 +0800
commita3669fadfd7d7c0aa832b1b0a77d2d6857aec579 (patch)
treeb3b3bfd5e30c4a0b776a29524f8674d63f4cc444 /src
parentc1db7fce9fd89fff6c341adeb23fa6632e782564 (diff)
fix: device 修改为 environment
Diffstat (limited to 'src')
-rw-r--r--src/axios/api/environment.js (renamed from src/axios/api/device.js)4
-rw-r--r--src/axios/api/index.js2
-rw-r--r--src/components/layout/layoutHeader.vue2
-rw-r--r--src/i18n/en.js3
-rw-r--r--src/i18n/zh.js3
-rw-r--r--src/styles/theme/dark.scss4
-rw-r--r--src/styles/theme/light.scss4
-rw-r--r--src/views/environments/index.vue74
-rw-r--r--src/views/environments/start.vue36
9 files changed, 65 insertions, 67 deletions
diff --git a/src/axios/api/device.js b/src/axios/api/environment.js
index c562482..9808f49 100644
--- a/src/axios/api/device.js
+++ b/src/axios/api/environment.js
@@ -1,7 +1,7 @@
import axiosInstance from '@/axios/index.js';
-// device列表
-export const deviceListApi = async (data) => {
+// environment列表
+export const environmentListApi = async (data) => {
try {
const res = await axiosInstance({
url: '/api/v1/env',
diff --git a/src/axios/api/index.js b/src/axios/api/index.js
index 1aa3a51..74bc948 100644
--- a/src/axios/api/index.js
+++ b/src/axios/api/index.js
@@ -4,5 +4,5 @@ export * from './application'
export * from './user'
export * from './workspace'
export * from './role'
-export * from './device'
+export * from './environment'
export * from './workspaceMember' \ No newline at end of file
diff --git a/src/components/layout/layoutHeader.vue b/src/components/layout/layoutHeader.vue
index 28b2824..8b85ad0 100644
--- a/src/components/layout/layoutHeader.vue
+++ b/src/components/layout/layoutHeader.vue
@@ -61,7 +61,7 @@
@click="desktopEnd"
>
<i class="asw-icon icon-End" style="margin-right: 6px"></i>
- <span>{{ t('device.end') }}</span>
+ <span>{{ t('environment.end') }}</span>
</el-button>
<template v-else>
<el-switch
diff --git a/src/i18n/en.js b/src/i18n/en.js
index 6280238..50c55d6 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -8,7 +8,6 @@ export default {
applications: 'Applications',
users: 'Users',
pcaps: 'PCAPs',
- devices: 'Devices',
environments: 'Environments',
workspace_members: 'Members',
packages: 'Packages',
@@ -162,7 +161,7 @@ export default {
empty_tips: 'workspace member cannot be empty.'
}
},
- device: {
+ environment: {
location: 'Location',
platform: 'Platform',
description: 'Description',
diff --git a/src/i18n/zh.js b/src/i18n/zh.js
index a5d2fa1..c4ce66e 100644
--- a/src/i18n/zh.js
+++ b/src/i18n/zh.js
@@ -8,7 +8,6 @@ export default {
applications: '应用',
users: '用户',
pcaps: 'PCAPS',
- devices: '设备',
environments: '环境',
workspace_members: '工作空间成员',
packages: '包',
@@ -162,7 +161,7 @@ export default {
empty_tips: '工作区成员不能为空'
}
},
- device: {
+ environment: {
location: '位置',
platform: '平台',
description: '描述',
diff --git a/src/styles/theme/dark.scss b/src/styles/theme/dark.scss
index aed1cb0..cb91e26 100644
--- a/src/styles/theme/dark.scss
+++ b/src/styles/theme/dark.scss
@@ -41,6 +41,6 @@
--error_border: #e36969;
--box_shadow: -3px 0 8px -3px rgba(16, 16, 16, 0.8);
--pre_background: #1e1e1e;
- --device_tool_background: #454545;
- --device_top_button_border: #505050;
+ --environment_tool_background: #454545;
+ --environment_top_button_border: #505050;
}
diff --git a/src/styles/theme/light.scss b/src/styles/theme/light.scss
index 0ae4496..3bf225a 100644
--- a/src/styles/theme/light.scss
+++ b/src/styles/theme/light.scss
@@ -41,6 +41,6 @@
--error_border: #ffc5c5;
--box_shadow: -3px 0 8px -3px #cccccc;
--pre_background: #f6f8fa;
- --device_tool_background: #ceced2;
- --device_top_button_border: #ceced2;
+ --environment_tool_background: #ceced2;
+ --environment_top_button_border: #ceced2;
}
diff --git a/src/views/environments/index.vue b/src/views/environments/index.vue
index 6987dc6..0073e81 100644
--- a/src/views/environments/index.vue
+++ b/src/views/environments/index.vue
@@ -1,5 +1,5 @@
<template>
- <div id="devices" class="pageList">
+ <div id="environments" class="pageList">
<div class="list-header">
<div class="list-header-left">
<span>{{ t('overall.environments') }}</span>
@@ -10,26 +10,26 @@
<div class="list-header-right">
<div
- class="devices-change"
- v-has:all="['environment_all', 'environment_myDevices']"
+ class="environments-change"
+ v-has:all="['environment_all', 'environment_myDevices']"
>
<el-button
type="primary"
size="large"
- class="devices-all"
- @click="showDeviceList('all')"
- :class="{ inactive: !showAllDevice }"
+ class="environments-all"
+ @click="showEnvironmentList('all')"
+ :class="{ inactive: !showAllEnvironment }"
>
- {{ t('device.all') }}
+ {{ t('environment.all') }}
</el-button>
<el-button
type="primary"
size="large"
- class="devices-my"
- @click="showDeviceList('my')"
- :class="{ inactive: showAllDevice }"
+ class="environments-my"
+ @click="showEnvironmentList('my')"
+ :class="{ inactive: showAllEnvironment }"
>
- {{ t('device.my_devices') }}
+ {{ t('environment.my_devices') }}
</el-button>
</div>
<el-input
@@ -77,18 +77,18 @@
<template #default="scope">
<!-- status -->
<template v-if="item.prop === 'status'">
- <div class="device-status">
+ <div class="environment-status">
<template v-if="scope.row.status === 0">
<div class="circle offline"></div>
- <div class="in-use">{{ t('device.offline') }}</div>
+ <div class="in-use">{{ t('environment.offline') }}</div>
</template>
<template v-else-if="scope.row.status === 1">
<div class="circle free"></div>
- <div>{{ t('device.free') }}</div>
+ <div>{{ t('environment.free') }}</div>
</template>
<template v-else-if="scope.row.status === 2">
<div class="circle in_use"></div>
- <div class="in-use">{{ t('device.in_use') }}</div>
+ <div class="in-use">{{ t('environment.in_use') }}</div>
</template>
</div>
</template>
@@ -121,20 +121,20 @@
v-has="'environment_start'"
v-if="scope.row.status === 1"
type="primary"
- class="device-start"
+ class="environment-start"
@click="start(scope.row.id)"
>
<i class="asw-icon icon-start"></i>
- {{ t('device.start') }}
+ {{ t('environment.start') }}
</el-button>
<el-button
v-has="'environment_busy'"
v-else-if="scope.row.status === 2"
type="primary"
- class="device-busy"
+ class="environment-busy"
>
<i class="asw-icon icon-busy"></i>
- {{ t('device.busy') }}
+ {{ t('environment.busy') }}
</el-button>
</template>
</el-table-column>
@@ -146,7 +146,7 @@
<script setup>
import { ref, reactive, onBeforeMount, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
-import { deviceListApi, myDeviceListApi, deviceSessionApi } from '@/axios/api';
+import { environmentListApi, myDeviceListApi, deviceSessionApi } from '@/axios/api';
import { ElMessage } from 'element-plus';
import { toThousands, bytes } from '@/utils';
import { useSystemStore } from '@/store/index';
@@ -167,7 +167,7 @@ watch(
}
);
-const showAllDevice = ref(true);
+const showAllEnvironment = ref(true);
const tableTitle = ref([
{
@@ -179,25 +179,25 @@ const tableTitle = ref([
{
minWidth: 150,
prop: 'location',
- label: t('device.location'),
+ label: t('environment.location'),
sortable: 'custom',
},
{
width: 150,
prop: 'platform',
- label: t('device.platform'),
+ label: t('environment.platform'),
sortable: 'custom',
},
{
minWidth: 200,
prop: 'description',
- label: t('device.description'),
+ label: t('environment.description'),
sortable: 'custom',
},
{
width: 100,
prop: 'status',
- label: t('device.status'),
+ label: t('environment.status'),
sortable: 'custom',
},
]);
@@ -219,12 +219,12 @@ const paginat = reactive({
const disabledLoad = computed(() => loading.value || paginat.noMore);
-const showDeviceList = (dataType) => {
+const showEnvironmentList = (dataType) => {
if (dataType === 'all') {
- showAllDevice.value = true;
+ showAllEnvironment.value = true;
fetchList();
} else {
- showAllDevice.value = false;
+ showAllEnvironment.value = false;
fetchMyList();
}
};
@@ -249,7 +249,7 @@ const fetchList = async (reset = true) => {
workspaceId: workspace.value.id,
};
- let res = await deviceListApi(params);
+ let res = await environmentListApi(params);
tableData.value = [];
if (res.code == 200) {
if (reset) {
@@ -348,21 +348,21 @@ const packets = (summary) => {
</script>
<style lang="scss" scoped>
-.devices-change {
+.environments-change {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 40px;
background: transparent;
- border: 1px solid var(--device_top_button_border);
+ border: 1px solid var(--environment_top_button_border);
border-radius: 4px;
margin-right: 20px;
padding: 2px;
- .devices-all {
+ .environments-all {
width: 120px;
}
- .devices-my {
+ .environments-my {
margin-left: 4px;
}
@@ -376,21 +376,21 @@ const packets = (summary) => {
}
}
-.device-start {
+.environment-start {
padding: 8px 10px;
i {
color: #fff;
margin-right: 6px;
}
}
-.device-start:hover {
+.environment-start:hover {
background: #e0eaff;
color: var(--primary);
i {
color: var(--primary);
}
}
-.device-busy {
+.environment-busy {
padding: 8px 10px;
color: #99a0bc;
background: #fff;
@@ -406,7 +406,7 @@ const packets = (summary) => {
color: #99a0bc;
}
-.device-status {
+.environment-status {
display: flex;
flex-direction: row;
justify-content: left;
diff --git a/src/views/environments/start.vue b/src/views/environments/start.vue
index 72100bf..a161821 100644
--- a/src/views/environments/start.vue
+++ b/src/views/environments/start.vue
@@ -4,7 +4,7 @@
<div class="device-header">
<span>{{ deviceInfo.name }}</span>
<span>
- <span>{{ t('device.location') }}: </span>
+ <span>{{ t('environment.location') }}: </span>
<span>{{ deviceInfo.location }}</span>
</span>
</div>
@@ -31,11 +31,11 @@
>
<i class="asw-icon icon-upload-file"></i>
<div class="el-upload__text">
- {{ t('device.upload_application_package') }}
+ {{ t('environment.upload_application_package') }}
</div>
</el-upload>
- <div class="install-title">{{ t('device.installed') }}</div>
+ <div class="install-title">{{ t('environment.installed') }}</div>
<ul class="install-list" v-loading="appLoading">
<li class="install-item" v-for="item in appList" :key="item.id">
<span>{{ item.packageName }}</span>
@@ -45,17 +45,17 @@
plain
@click="uninstall(item.packageName)"
>
- {{ t('device.uninstall') }}
+ {{ t('environment.uninstall') }}
</el-button>
</li>
</ul>
</el-tab-pane>
<!-- tcpdump -->
- <el-tab-pane :label="t('device.tcpdump')" class="tcpdump-tab">
+ <el-tab-pane :label="t('environment.tcpdump')" class="tcpdump-tab">
<el-input
v-model="packageName"
size="large"
- :placeholder="t('device.input_package_name')"
+ :placeholder="t('environment.input_package_name')"
clearable
>
</el-input>
@@ -66,14 +66,14 @@
size="large"
@click="stopCapture"
>
- {{ t('device.stop_capture') }}
+ {{ t('environment.stop_capture') }}
</el-button>
<el-button v-else type="primary" size="large" @click="capture">
- {{ t('device.capture') }}
+ {{ t('environment.capture') }}
</el-button>
</el-tab-pane>
<!-- file explorer -->
- <el-tab-pane :label="t('device.file_explorer')" class="files-tab">
+ <el-tab-pane :label="t('environment.file_explorer')" class="files-tab">
<div class="directory-header">
<div>
<i class="asw-icon icon-home" @click="getDirectory('/')"></i>
@@ -179,7 +179,7 @@
v-model="visible"
align-center
width="480"
- :title="t('device.attribute')"
+ :title="t('environment.attribute')"
class="directory-dialog"
>
<div class="directory-dialog-name">
@@ -196,9 +196,9 @@
<span>{{ t('overall.type') }}:</span>
<span class="directory-info-row-value">
<template v-if="directoryInfo.isDir">
- {{ t('device.catalogue_file') }}
+ {{ t('environment.catalogue_file') }}
</template>
- <template v-else>{{ t('device.file') }}</template>
+ <template v-else>{{ t('environment.file') }}</template>
</span>
</div>
<div class="directory-info-row">
@@ -208,7 +208,7 @@
</span>
</div>
<div class="directory-info-row">
- <span>{{ t('device.location') }}:</span>
+ <span>{{ t('environment.location') }}:</span>
<span class="directory-info-row-value">{{ directoryPath }}</span>
</div>
<div class="directory-info-row">
@@ -226,11 +226,11 @@
</span>
</div>
<div class="directory-info-row">
- <span>{{ t('device.owner') }}:</span>
+ <span>{{ t('environment.owner') }}:</span>
<span class="directory-info-row-value">{{ directoryInfo.uid }} </span>
</div>
<div class="directory-info-row">
- <span>{{ t('device.group') }}:</span>
+ <span>{{ t('environment.group') }}:</span>
<span class="directory-info-row-value">{{ directoryInfo.gid }} </span>
</div>
<div class="directory-info-row">
@@ -317,7 +317,7 @@ const install = debounce(async (file) => {
}, 10);
// 卸载
const uninstall = (packageName) => {
- ElMessageBox.confirm(t('device.confirm_uninstall'), t('overall.hint'), {
+ ElMessageBox.confirm(t('environment.confirm_uninstall'), t('overall.hint'), {
confirmButtonText: t('overall.confirm'),
cancelButtonText: t('overall.cancel'),
type: 'warning',
@@ -375,7 +375,7 @@ const stopCapture = async () => {
const params = { id: captureId.value, returnFile: true };
let config = {};
try {
- await ElMessageBox.confirm(t('device.return_file'), t('overall.hint'), {
+ await ElMessageBox.confirm(t('environment.return_file'), t('overall.hint'), {
confirmButtonText: t('overall.confirm'),
cancelButtonText: t('overall.cancel'),
type: 'warning',
@@ -628,7 +628,7 @@ onUnmounted(() => {
flex-shrink: 0;
width: 100%;
height: 40px;
- background: var(--device_tool_background);
+ background: var(--environment_tool_background);
display: flex;
justify-content: space-between;
align-items: center;