-
-
-
-
diff --git a/localwaf/src/pages/dashboard/base/components/TopPanel.vue b/localwaf/src/pages/dashboard/base/components/TopPanel.vue
index 0d52529..b696857 100644
--- a/localwaf/src/pages/dashboard/base/components/TopPanel.vue
+++ b/localwaf/src/pages/dashboard/base/components/TopPanel.vue
@@ -5,7 +5,7 @@
:title="item.title"
:style="{ height: '168px' }"
:class="{ 'dashboard-item': true, 'dashboard-item--main-color': index == 0 }"
- @click.native="jumpLog(item.title)"
+ @click.native="jumpLog(index)"
>
{{ item.number }}
@@ -110,7 +110,7 @@ export default {
jumpLog(title){
console.log(title)
switch (title){
- case '今日攻击数':
+ case 0: //今日攻击数量
this.$router.push({
path: '/waf/wafattacklog',
query: {
@@ -118,30 +118,21 @@ export default {
}
});
break;
- case '今天总访问量':
+ case 1: //今天总访问量
this.$router.push({
path: '/waf/wafattacklog',
query: {
}
- });
- break;
- case '今天异常IP(个)':
+ });break;
+ case 2: //今天异常IP(个)
this.$router.push({
path: '/waf/wafattacklog',
query: {
action: "禁止"
}
});
- break;
- case '今天正常IP(个)':
- this.$router.push({
- path: '/waf/wafattacklog',
- query: {
- action: "放行"
- }
- });
- break;
+ break;
default:
break;
}
@@ -160,19 +151,19 @@ export default {
that.wafstat_data = resdata.data;
that.panelList.push({
- title: '今日攻击数',
+ title: this.$t('dashboard.counter.today_of_attack_count') ,
number: that.wafstat_data.AttackCountOfToday,
upTrend: '0%',
leftType: 'echarts-line',
})
that.panelList.push({
- title: '今天总访问量',
+ title: this.$t('dashboard.counter.all_visit_count') ,
number: that.wafstat_data.VisitCountOfToday,
upTrend: '0%',
leftType: 'echarts-line',
})
that.panelList.push({
- title: '今天异常IP(个)',
+ title:this.$t('dashboard.counter.not_normal_visit_count'),
number: that.wafstat_data.IllegalIpCountOfToday,
upTrend: '0%',
leftType: 'echarts-line',
@@ -184,7 +175,7 @@ export default {
leftType: 'echarts-line',
})*/
that.panelList.push({
- title: '当前QPS',
+ title: this.$t('dashboard.counter.qps'),
number: that.wafstat_data.CurrentQps,
upTrend: '0%',
leftType: 'echarts-line',
@@ -204,30 +195,10 @@ export default {
} else {
this.resizeTime = 1;
}
- /* this.moneyCharts.resize({
- // 根据父容器的大小设置大小
- width: `${this.resizeTime * 120}px`,
- height: `${this.resizeTime * 66}px`,
- });
-
- this.refundChart.resize({
- // 根据父容器的大小设置大小
- width: `${this.resizeTime * 120}px`,
- height: `${this.resizeTime * 42}px`,
- }); */
},
renderCharts() {
const { chartColors } = this.$store.state.setting;
- // 收入汇总图
- /* if (!this.moneyContainer) this.moneyContainer = document.getElementById('moneyContainer');
- this.moneyCharts = echarts.init(this.moneyContainer);
- this.moneyCharts.setOption(constructInitDashboardDataset('line'));
-
- // 退款图
- if (!this.refundContainer) this.refundContainer = document.getElementById('refundContainer');
- this.refundChart = echarts.init(this.refundContainer);
- this.refundChart.setOption(constructInitDashboardDataset('bar', chartColors)); */
},
},
};
diff --git a/localwaf/src/pages/dashboard/base/index.ts b/localwaf/src/pages/dashboard/base/index.ts
index 4319213..1ed4256 100644
--- a/localwaf/src/pages/dashboard/base/index.ts
+++ b/localwaf/src/pages/dashboard/base/index.ts
@@ -1,7 +1,7 @@
import dayjs from 'dayjs';
import { getChartListColor } from '@/utils/color';
import { getRandomArray } from '@/utils/charts';
-
+console.log(window.vm.$i18n)
/** 首页 dashboard 折线图 */
export function constructInitDashboardDataset(type: string) {
const dateArray: Array
= ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
@@ -190,31 +190,13 @@ export function getLineChartDataSet({
placeholderColor,
borderColor,
}: { dateTime?: Array,inchartarr?: Array,outchartarr?: Array } & Record) {
- console.log('getLineChartDataSet',inchartarr)
+
const divideNum = 10;
const timeArray = [];
const inArray = [];
const outArray = [];
- /* for (let i = 0; i < divideNum; i++) {
- if (dateTime.length > 0) {
- const dateAbsTime: number = (new Date(dateTime[1]).getTime() - new Date(dateTime[0]).getTime()) / divideNum;
- const enhandTime: number = new Date(dateTime[0]).getTime() + dateAbsTime * i;
- timeArray.push(dayjs(enhandTime).format('MM-DD'));
- } else {
- timeArray.push(
- dayjs()
- .subtract(divideNum - i, 'day')
- .format('MM-DD'),
- );
- }
- inArray.push(getRandomArray().toString());
- outArray.push(getRandomArray().toString());
- } */
- console.log('line ',dateTime)
- console.log('line inArray',inchartarr)
- console.log('line outArray',outchartarr)
const dataSet = {
color: getChartListColor(),
tooltip: {
@@ -231,7 +213,7 @@ export function getLineChartDataSet({
left: 'center',
bottom: '0',
orient: 'horizontal', // legend 横向布局。
- data: ['本周期攻击数', '本周期正常数'],
+ data: [window.vm.$i18n.t('dashboard.cycle_attack_count'), window.vm.$i18n.t('dashboard.cycle_normal_count')],
textStyle: {
fontSize: 12,
color: placeholderColor,
@@ -263,7 +245,7 @@ export function getLineChartDataSet({
},
series: [
{
- name: '本周期攻击数',
+ name: window.vm.$i18n.t('dashboard.cycle_attack_count'),
data: inchartarr,
type: 'line',
smooth: false,
@@ -283,7 +265,7 @@ export function getLineChartDataSet({
},
},
{
- name: '本周期正常数',
+ name: window.vm.$i18n.t('dashboard.cycle_normal_count'),
data: outchartarr,
type: 'line',
smooth: false,
@@ -318,300 +300,6 @@ export function getSelftItemList(productName: string, divideNum: number): string
return productArray;
}
-/**
- * 散点图数据
- *
- * @export
- * @returns {any[]}
- */
-export function getScatterDataSet({
- dateTime = [],
- placeholderColor,
- borderColor,
-}: { dateTime?: Array } & Record): any {
- const divideNum = 40;
- const timeArray = [];
- const inArray = [];
- const outArray = [];
- for (let i = 0; i < divideNum; i++) {
- // const [timeArray, inArray, outArray] = dataset;
- if (dateTime.length > 0) {
- const dateAbsTime: number = (new Date(dateTime[1]).getTime() - new Date(dateTime[0]).getTime()) / divideNum;
- const enhandTime: number = new Date(dateTime[0]).getTime() + dateAbsTime * i;
- timeArray.push(dayjs(enhandTime).format('MM-DD'));
- } else {
- timeArray.push(
- dayjs()
- .subtract(divideNum - i, 'day')
- .format('MM-DD'),
- );
- }
-
- inArray.push(getRandomArray().toString());
- outArray.push(getRandomArray().toString());
- }
-
- return {
- color: getChartListColor(),
- xAxis: {
- data: timeArray,
- axisLabel: {
- color: placeholderColor,
- },
- splitLine: { show: false },
- axisLine: {
- lineStyle: {
- color: borderColor,
- width: 1,
- },
- },
- },
- yAxis: {
- type: 'value',
- // splitLine: { show: false},
- axisLabel: {
- color: placeholderColor,
- },
- nameTextStyle: {
- padding: [0, 0, 0, 60],
- },
- axisTick: {
- show: false,
- axisLine: {
- show: false,
- },
- },
- axisLine: {
- show: false,
- },
- splitLine: {
- lineStyle: {
- color: borderColor,
- },
- },
- },
- tooltip: {
- trigger: 'item',
- },
- grid: {
- top: '5px',
- left: '25px',
- right: '5px',
- bottom: '60px',
- },
- legend: {
- left: 'center',
- bottom: '0',
- orient: 'horizontal', // legend 横向布局。
- data: ['按摩仪', '咖啡机'],
- itemHeight: 8,
- itemWidth: 8,
- textStyle: {
- fontSize: 12,
- color: placeholderColor,
- },
- },
- series: [
- {
- name: '按摩仪',
- symbolSize: 10,
- data: outArray.reverse(),
- type: 'scatter',
- },
- {
- name: '咖啡机',
- symbolSize: 10,
- data: inArray.concat(inArray.reverse()),
- type: 'scatter',
- },
- ],
- };
-}
-
-/**
- * 获域图数据结构
- *
- * @export
- * @returns {any[]}
- */
-export function getAreaChartDataSet(): any {
- const xAxisData = [];
- const data1 = [];
- const data2 = [];
- for (let i = 0; i < 50; i++) {
- xAxisData.push(`${i}`);
- data1.push((getRandomArray() * Math.sin(i / 5) * (i / 5 - 5) + i / 6) * 2);
- data2.push((getRandomArray() * Math.cos(i / 5) * (i / 5 - 5) + i / 6) * 2);
- }
-
- return {
- color: getChartListColor(),
- // title: {
- // text: '柱状图动画延迟',
- // },
- legend: {
- left: 'center',
- bottom: '5%',
- orient: 'horizontal',
- data: ['测试', '上线'],
- },
- tooltip: {
- trigger: 'item',
- },
- xAxis: {
- data: xAxisData,
- splitLine: {
- show: false,
- },
- },
- yAxis: {},
- series: [
- {
- name: '测试',
- type: 'bar',
- data: data1,
- emphasis: {
- focus: 'series',
- },
- animationDelay(idx: number) {
- return idx * 10;
- },
- },
- {
- name: '上线',
- type: 'bar',
- data: data2,
- emphasis: {
- focus: 'series',
- },
- animationDelay(idx: number) {
- return idx * 10 + 100;
- },
- },
- ],
- animationEasing: 'elasticOut',
- animationDelayUpdate(idx: number) {
- return idx * 5;
- },
- };
-}
-
-/**
- * 柱状图数据结构
- *
- * @export
- * @param {boolean} [isMonth=false]
- * @returns {*}
- */
-export function getColumnChartDataSet(isMonth = false) {
- if (isMonth) {
- return {
- color: getChartListColor(),
- legend: {
- left: 'center',
- top: '10%',
- orient: 'horizontal', // legend 横向布局。
- data: ['直接访问'],
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: 'shadow', // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true,
- },
- xAxis: [
- {
- type: 'category',
- data: ['1', '4', '8', '12', '16', '20', '24'],
- axisTick: {
- alignWithLabel: true,
- },
- },
- ],
- yAxis: [
- {
- type: 'value',
- },
- ],
- series: [
- {
- name: '直接访问',
- type: 'bar',
- barWidth: '60%',
- data: [
- getRandomArray(Math.random() * 100),
- getRandomArray(Math.random() * 200),
- getRandomArray(Math.random() * 300),
- getRandomArray(Math.random() * 400),
- getRandomArray(Math.random() * 500),
- getRandomArray(Math.random() * 600),
- getRandomArray(Math.random() * 700),
- ],
- },
- ],
- };
- }
-
- return {
- color: getChartListColor(),
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: 'shadow', // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- left: 'center',
- bottom: '0%',
- orient: 'horizontal', // legend 横向布局。
- data: ['直接访问'],
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '13%',
- containLabel: true,
- },
- xAxis: [
- {
- type: 'category',
- data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
- axisTick: {
- alignWithLabel: true,
- },
- },
- ],
- yAxis: [
- {
- type: 'value',
- },
- ],
- series: [
- {
- name: '直接访问',
- type: 'bar',
- barWidth: '20%',
- data: [
- getRandomArray(Math.random() * 100),
- getRandomArray(Math.random() * 200),
- getRandomArray(Math.random() * 300),
- getRandomArray(Math.random() * 400),
- getRandomArray(Math.random() * 500),
- getRandomArray(Math.random() * 600),
- getRandomArray(Math.random() * 700),
- ],
- },
- ],
- };
-}
export function getPieChartDataSet({
radius = 42,
@@ -660,7 +348,7 @@ export function getPieChartDataSet({
label: {
show: true,
position: 'center',
- formatter: ['{value|{d}%}', '{name|{b}渠道占比}'].join('\n'),
+ formatter: ['{value|{d}%}', '{name|{b}}'].join('\n'),
rich: {
value: {
color: textColor,
@@ -678,7 +366,7 @@ export function getPieChartDataSet({
emphasis: {
label: {
show: true,
- formatter: ['{value|{d}%}', '{name|{b}渠道占比}'].join('\n'),
+ formatter: ['{value|{d}%}', '{name|{b}}'].join('\n'),
rich: {
value: {
color: textColor,
@@ -700,10 +388,10 @@ export function getPieChartDataSet({
data: [
{
value: attackCount,
- name: '攻击数',
+ name: window.vm.$i18n.t('dashboard.cycle_attack_count'),
},
{ value: normalCount,
- name: '正常数' },
+ name: window.vm.$i18n.t('dashboard.cycle_normal_count') },
],
},
],
diff --git a/localwaf/src/pages/dashboard/base/index.vue b/localwaf/src/pages/dashboard/base/index.vue
index 5720c55..264888a 100644
--- a/localwaf/src/pages/dashboard/base/index.vue
+++ b/localwaf/src/pages/dashboard/base/index.vue
@@ -1,19 +1,15 @@
-
-
-
-
+
- 马上创建
- 马上修改
+ {{$t('dashboard.tip_create_website_link')}}
+ {{$t('dashboard.tip_modify_pwd_link')}}
-
@@ -27,7 +23,6 @@
import TopPanel from './components/TopPanel.vue';
import MiddleChart from './components/MiddleChart.vue';
import RankList from './components/RankList.vue';
-import OutputOverview from './components/OutputOverview.vue';
import {
wafStatSysinfoapi
} from '@/apis/stats';
@@ -37,7 +32,6 @@ export default {
TopPanel,
MiddleChart,
RankList,
- OutputOverview,
},
data() {
return {
@@ -54,13 +48,13 @@ export default {
{
name:"emptyHost",
visable:false,
- message:"您当前未创建需要防护的网站,点击进行创建",
+ message:'dashboard.tip_create_website_title',
tipsType:"success"
},
{
name:"defaultAccount",
visable:false,
- message:"您当前还是使用默认帐号和密码请尽快修改",
+ message:'dashboard.tip_modify_pwd_title',
tipsType:"error"
},
]
diff --git a/localwaf/src/pages/login/components/components-login.vue b/localwaf/src/pages/login/components/components-login.vue
index 4d46efe..ff3c352 100644
--- a/localwaf/src/pages/login/components/components-login.vue
+++ b/localwaf/src/pages/login/components/components-login.vue
@@ -9,7 +9,7 @@
>
-
+
@@ -23,7 +23,7 @@
:type="showPsw ? 'text' : 'password'"
clearable
key="password"
- placeholder="请输入登录密码:"
+ :placeholder="$t('login.input_password_placeholder')"
>
@@ -34,55 +34,15 @@
-
-
-
-
-
-
-
-
- 登录
+ {{ $t('login.login_btn_title') }}
-
-
-
diff --git a/localwaf/src/pages/waf/accountlog/index.vue b/localwaf/src/pages/waf/accountlog/index.vue
index e57623d..2e51070 100644
--- a/localwaf/src/pages/waf/accountlog/index.vue
+++ b/localwaf/src/pages/waf/accountlog/index.vue
@@ -2,11 +2,7 @@
@@ -32,29 +28,28 @@
-
-
+
+
-
-
-
+
+
-
-
+
+
-
-
+
+
- 取消
+ {{ $t('common.close') }}
-
+
-
diff --git a/localwaf/src/pages/waf/host/index.vue b/localwaf/src/pages/waf/host/index.vue
index d09e6b8..0ea88a9 100644
--- a/localwaf/src/pages/waf/host/index.vue
+++ b/localwaf/src/pages/waf/host/index.vue
@@ -3,35 +3,34 @@