parent
aa3415ec47
commit
7d8029c6f7
@ -0,0 +1,28 @@ |
|||||||
|
package com.alops.common.core.domain; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
//分页列表数据
|
||||||
|
@Data |
||||||
|
@EqualsAndHashCode(callSuper = false) |
||||||
|
public class ListResultVO<T> implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = -8896090499552990782L; |
||||||
|
|
||||||
|
//列表数据
|
||||||
|
private List<T> list; |
||||||
|
|
||||||
|
//记录总数
|
||||||
|
private Long total; |
||||||
|
|
||||||
|
//每页记录数
|
||||||
|
private Long pageSize; |
||||||
|
|
||||||
|
//当前页码
|
||||||
|
private Long current; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
package com.alops.common.core.domain; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
/** |
||||||
|
* 统一的接口返回数据格式 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"}) |
||||||
|
public class ResultVO<T> { |
||||||
|
|
||||||
|
// 错误码
|
||||||
|
private Integer code; |
||||||
|
|
||||||
|
// 错误信息
|
||||||
|
private String msg; |
||||||
|
|
||||||
|
// 数据
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||||
|
private T data; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,190 @@ |
|||||||
|
package com.alops.common.core.domain.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import org.springframework.validation.BindingResult; |
||||||
|
import org.springframework.validation.ObjectError; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 状态码与错误消息类 |
||||||
|
* |
||||||
|
* 将所有的状态码和错误信息集中到该类当中,便于查阅 |
||||||
|
* 借助GlobalException将错误的信息抛给全局异常处理器,处理器将错误信息转换为Response返回给前端 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class CodeMsg { |
||||||
|
|
||||||
|
public final static CodeMsg SERVER_ERROR = new CodeMsg(500, "服务器错误"); |
||||||
|
public final static CodeMsg BIND_ERROR = new CodeMsg(500, "参数错误:%s"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 用户权限 100XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg USER_NEED_LOGIN = new CodeMsg(10000, "尚未登录,请登录。"); |
||||||
|
public final static CodeMsg USERNAME_REQUIRE_NOT_NULL = new CodeMsg(10001, "用户名不能为空"); |
||||||
|
public final static CodeMsg PASSWORD_REQUIRE_NOT_NULL = new CodeMsg(10002, "用户密码不能为空"); |
||||||
|
public final static CodeMsg USER_NOT_FOUND = new CodeMsg(10003, "该用户不存在。"); |
||||||
|
public final static CodeMsg USERNAME_OR_PASSWORD_ERROR = new CodeMsg(10004, "用户名或密码错误"); |
||||||
|
public final static CodeMsg USER_IS_LOCKED = new CodeMsg(10005, "当前IP已被锁定,请1小时后再试。"); |
||||||
|
public final static CodeMsg USER_CREDENTIALS_EXPIRED = new CodeMsg(10006, "用户登录凭证过期,请重新登录。"); |
||||||
|
public final static CodeMsg USER_ACCOUNT_EXPIRED = new CodeMsg(10007, "用户账号过期,请联系管理员。"); |
||||||
|
public final static CodeMsg USER_IS_DISABLED = new CodeMsg(10008, "该用户已被禁用,请联系管理员。"); |
||||||
|
public final static CodeMsg USER_BAD_CREDENTIALS = new CodeMsg(10009, "无效的登录凭证,请尝试重新登录"); |
||||||
|
public final static CodeMsg USER_TOKEN_EXPIRED = new CodeMsg(10010, "用户凭证已过期,请联系管理员。"); |
||||||
|
public final static CodeMsg NOT_GET_CURRENT_USER_INFO = new CodeMsg(10011, "无法获取当前用户信息。"); |
||||||
|
public final static CodeMsg CAN_NOT_DATA_ACCESS = new CodeMsg(10012, "当前用户没有访问相关数据的权限。"); |
||||||
|
public final static CodeMsg NOT_BIND_WECHAT = new CodeMsg(10013, "当前用户尚未绑定微信号。"); |
||||||
|
public final static CodeMsg BIND_USER_FAIL = new CodeMsg(10014, "绑定用户失败 %s"); |
||||||
|
public final static CodeMsg LOGIN_FAIL = new CodeMsg(10015, "登录失败,未知原因。"); |
||||||
|
public final static CodeMsg CAN_NOT_GET_OPEN_ID = new CodeMsg(10016, "无法获取 OpenID。"); |
||||||
|
public final static CodeMsg BIND_USER_FAIL2 = new CodeMsg(10017, "绑定用户失败 %s"); |
||||||
|
public final static CodeMsg CAPTCHA_IS_NOT_RIGHT = new CodeMsg(10018, "验证码错误。"); |
||||||
|
public final static CodeMsg CAPTCHA_IS_EMPTY = new CodeMsg(10019, "验证码不能为空。"); |
||||||
|
public final static CodeMsg CAPTCHA_IS_EXPIRED = new CodeMsg(10020, "验证码已过期。"); |
||||||
|
public static final CodeMsg TEMP_TOKEN_NOT_FOUND = new CodeMsg(10021,"无法获取临时授权"); |
||||||
|
public static final CodeMsg TEMP_TOKEN_EXPIRED = new CodeMsg(10022,"临时授权已过期"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 基本操作 101XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg FETCH_ERROR = new CodeMsg(10100, "获取数据失败"); |
||||||
|
public final static CodeMsg ADD_ERROR = new CodeMsg(10101, "添加失败%s"); |
||||||
|
public final static CodeMsg MODIFY_ERROR = new CodeMsg(10102, "修改失败"); |
||||||
|
public final static CodeMsg DELETE_ERROR = new CodeMsg(10103, "删除失败"); |
||||||
|
public final static CodeMsg DELETE_ERROR_RELATION_DATA = new CodeMsg(101031, "存在关联业务数据,删除或禁用失败"); |
||||||
|
public final static CodeMsg REPEAT_RECORD = new CodeMsg(10104, "字段与已有记录重复"); |
||||||
|
public final static CodeMsg ENABLE_OR_DISABLE_ERROR = new CodeMsg(10105, "启用或禁用出错。"); |
||||||
|
public final static CodeMsg CAN_FOUND_DICT = new CodeMsg(10106, "找不到字典。"); |
||||||
|
public final static CodeMsg FORM_ERROR = new CodeMsg(10107, "表单参数错误"); |
||||||
|
public static final CodeMsg MORE_THAN_ONE_ITEM = new CodeMsg(10108, "多余一条数据被查出"); |
||||||
|
public static final CodeMsg ALREADY_EXIST_ITEM = new CodeMsg(10109, "数据重复"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 角色管理 102XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg ENABLE_OR_DISABLE_ROLE_ERROR = new CodeMsg(10201, "启用或禁用出错。"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 组织结构管理 103XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg CAN_NOT_SET_CHILDREN_UNIT_AS_PARENT = new CodeMsg(10301, "不能够将单位自身或其下级单位设置为上级单位。"); |
||||||
|
public final static CodeMsg NOT_FOUND_UNIT = new CodeMsg(10302, "找不到对应的单位==%s。"); |
||||||
|
public static final CodeMsg COMPANY_UNIT_CODE_OVERFLOW = new CodeMsg(10303, "公司类型单位编码溢出"); |
||||||
|
public static final CodeMsg NON_COMPANY_UNIT_CODE_OVERFLOW = new CodeMsg(10304, "非公司类型单位编码溢出"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备信息 201XX |
||||||
|
*/ |
||||||
|
public static final CodeMsg NOT_FOUND_ATTRIBUTION_UNIT = new CodeMsg(20101, "无法获取所属单位"); |
||||||
|
public static final CodeMsg CAN_NOT_GENERATE_EQUIPMENT_CODE = new CodeMsg(20102, "无法生成新的设备编码"); |
||||||
|
public static final CodeMsg NEW_EQUIPMENT_CODE_ILLEGAL = new CodeMsg(20103, "新的设备编码不合法或已存在"); |
||||||
|
public static final CodeMsg NOT_FOUND_LEVEL1_CATEGORY_CODE = new CodeMsg(20104, "无法获取一级分类编码"); |
||||||
|
public static final CodeMsg NOT_FOUND_LEVEL2_CATEGORY_CODE = new CodeMsg(20105, "无法获取二级分类编码"); |
||||||
|
public static final CodeMsg NOT_FOUND_UNIT_CODE = new CodeMsg(20106, "无法获取设备所属单位编码"); |
||||||
|
public static final CodeMsg EQUIPMENT_SERIAL_CODE_OVERFLOW = new CodeMsg(20107, "设备序号超出范围"); |
||||||
|
public static final CodeMsg NOT_FOUND_EQUIPMENT = new CodeMsg(20110, "无法获取设备信息"); |
||||||
|
public static final CodeMsg NOT_FOUND_PARENT_EQUIPMENT = new CodeMsg(20110, "无法获取父设备信息"); |
||||||
|
|
||||||
|
public static final CodeMsg ALREADY_EXIST_EQUIPMENT = new CodeMsg(20111, "当前使用单位下设备名称已存在,请更换"); |
||||||
|
|
||||||
|
|
||||||
|
public static final CodeMsg THIS_EQUIPMENT_ALREADY_BIND_QRCODE = new CodeMsg(20113, "该设备已经绑定过二维码"); |
||||||
|
public static final CodeMsg QRCODE_ALREADY_BIND_OTHER_EQUIPMENT = new CodeMsg(20114, "该二维码已经绑定到其它设备"); |
||||||
|
public static final CodeMsg MODIFY_EQUIPMENT_CODE_FAIL = new CodeMsg(20115, "修改设备编码失败"); |
||||||
|
public static final CodeMsg EQUIPMENT_CATEGORY_NOT_CHANGE = new CodeMsg(20116, "设备分类没有改变"); |
||||||
|
public static final CodeMsg SAVEPLACE_CANNOT_FOUND = new CodeMsg(20117, "存放地点不存在===%s");; |
||||||
|
public static final CodeMsg SAVEPLACE_UNIT_NULL = new CodeMsg(20118, "存放地点的所属单位不存在");; |
||||||
|
public static final CodeMsg SAVEPLACE_ADD_ERROR = new CodeMsg(20119, "未选择单位");; |
||||||
|
public static final CodeMsg NAME_PARENTS_IS_EXIST = new CodeMsg(20120, "同名父设备已存在====%s");; |
||||||
|
public static final CodeMsg DUPLICATED_NAMED_EQUIPMENT = new CodeMsg(20121, "父设备命名重复===%s"); |
||||||
|
public static final CodeMsg NO_ITEM = new CodeMsg(20122, "该二维码未绑定设备"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备分类管理 202XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg NOT_FOUND_EQUIPMENT_CATEGORY = new CodeMsg(20201, "找不到该设备分类====%s"); |
||||||
|
public static final CodeMsg CATEGORY_1_CODE_OVERFLOW = new CodeMsg(20303, "一级设备分类编码溢出"); |
||||||
|
public static final CodeMsg CATEGORY_2_CODE_OVERFLOW = new CodeMsg(20304, "二级设备分类编码溢出"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 存放地点 203XX |
||||||
|
*/ |
||||||
|
public static final CodeMsg NOT_FOUND_SAVE_PLACE = new CodeMsg(20301, "找不到对应的存放地点"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 制造厂商 204XX |
||||||
|
*/ |
||||||
|
public static final CodeMsg NOT_FOUND_MANUFACTURER = new CodeMsg(20401, "找不到对应的制造厂商==%s"); |
||||||
|
|
||||||
|
/*** |
||||||
|
* 设备导入导出模块 205XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg FILE_FORMAT_ERROR = new CodeMsg(20501, "文件格式错误,选择xlsx或xls"); |
||||||
|
public final static CodeMsg FILE_NOT_NULL = new CodeMsg(20502, "上传文件不能为空,请重新选择文件"); |
||||||
|
public static final CodeMsg FILE_TOO_LARGE = new CodeMsg(20503,"上传的文件大小超出了限制"); |
||||||
|
public static final CodeMsg FILE_IMPORT_ERROR = new CodeMsg(20504,"上传文件失败");; |
||||||
|
public static final CodeMsg TEMPLATE_ERROR = new CodeMsg(20505,"导入模板未设置任何列头"); |
||||||
|
public static final CodeMsg NONAUTHORIZED_IMPORT_ERROR = new CodeMsg(20506, "导入失败,当前用户不是公司设备管理员"); |
||||||
|
public final static CodeMsg WRITE_ERRMSG_ERROR = new CodeMsg(20507, "错误文件写入异常:【%s】"); |
||||||
|
public final static CodeMsg READ_FILE_ERROR = new CodeMsg(20507, "读取文件异常:【%s】"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备调拨 300XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg EQUIPMENT_DATA_INCONSISTENCY = new CodeMsg(30001, "确认设备列表与调拨申请中设备列表不一致"); |
||||||
|
public final static CodeMsg ALLOT_APPLY_UNPERMITED = new CodeMsg(30002, "调拨申请单状态不是审批完成"); |
||||||
|
public final static CodeMsg ALLOT_APPLY_NEED_SUBMIT = new CodeMsg(30003, "调拨申请单尚未提交"); |
||||||
|
public final static CodeMsg ALLOT_APPLY_UNREJECTED = new CodeMsg(30004, "调拨申请单不是驳回状态"); |
||||||
|
public final static CodeMsg NULL_APPLYID_RESUBMIT = new CodeMsg(30005, "调拨申请单重新提交时申请单ID不可为空"); |
||||||
|
public final static CodeMsg ALLOT_APPLY_IS_NULL = new CodeMsg(30006, "调拨申请单不存在"); |
||||||
|
|
||||||
|
public final static CodeMsg ALLOT_APPLY_WRONG_PERMISSION = new CodeMsg(30007, "当前用户没有权限处理该申请单"); |
||||||
|
public final static CodeMsg ALLOT_APPLY_SAME_COMPANY = new CodeMsg(30008, "调拨申请单只针对跨公司调拨,请选择其他调入公司"); |
||||||
|
public final static CodeMsg NOT_FOUND_AUDIT_UNIT = new CodeMsg(30009, "找不到上级审批单位"); |
||||||
|
public final static CodeMsg NEED_AT_LEAST_ONE_ALLOC_EQUIPMENT = new CodeMsg(30010, "至少需要选中一个设备"); |
||||||
|
public final static CodeMsg ALLOT_APPLY_NOT_FOUND = new CodeMsg(30011, "找不到对应的调拨申请"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备盘点 301XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg OVERLAP_ERROR = new CodeMsg(30101, "所添加盘点任务的起止时间与数据库中存在重叠"); |
||||||
|
public final static CodeMsg OUT_RANGE_ERROR = new CodeMsg(30102, "该设备在本次盘点范围外"); |
||||||
|
public final static CodeMsg OWNERSHIP_ERROR = new CodeMsg(30103, "该设备使用单位异常"); |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备报废 302XX |
||||||
|
*/ |
||||||
|
public final static CodeMsg ABANDON_APPLY_NOT_FOUND_ERROR = new CodeMsg(30201, "找不到此条报废申请"); |
||||||
|
|
||||||
|
// 状态码
|
||||||
|
private Integer code; |
||||||
|
|
||||||
|
// 错误信息
|
||||||
|
private String msg; |
||||||
|
|
||||||
|
public CodeMsg(Integer code, String msg) { |
||||||
|
this.code = code; |
||||||
|
this.msg = msg; |
||||||
|
} |
||||||
|
|
||||||
|
public CodeMsg fillArgs(Object... args) { |
||||||
|
String message = String.format(msg, args); |
||||||
|
return new CodeMsg(code, message); |
||||||
|
} |
||||||
|
|
||||||
|
public CodeMsg fillFieldError(BindingResult bindingResult) { |
||||||
|
String defaultMessage = ""; |
||||||
|
|
||||||
|
if (bindingResult.hasErrors()) { |
||||||
|
List<ObjectError> allErrors = bindingResult.getAllErrors(); |
||||||
|
|
||||||
|
if (!allErrors.isEmpty()) { |
||||||
|
defaultMessage = allErrors.get(0).getDefaultMessage(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
String message = String.format(msg, defaultMessage); |
||||||
|
return new CodeMsg(code, message); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,33 @@ |
|||||||
|
package com.alops.common.exception; |
||||||
|
|
||||||
|
import com.alops.common.core.domain.entity.CodeMsg; |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务逻辑处理异常 |
||||||
|
* 借助 |
||||||
|
*/ |
||||||
|
public class BusinessException extends RuntimeException { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private CodeMsg codeMsg; |
||||||
|
|
||||||
|
public BusinessException(CodeMsg codeMsg) { |
||||||
|
super(codeMsg.getMsg()); |
||||||
|
this.codeMsg = codeMsg; |
||||||
|
} |
||||||
|
|
||||||
|
public BusinessException(String codeMsg) { |
||||||
|
super(codeMsg); |
||||||
|
CodeMsg codeMsg1=new CodeMsg(500, codeMsg); |
||||||
|
this.codeMsg = codeMsg1; |
||||||
|
} |
||||||
|
|
||||||
|
public CodeMsg getCodeMsg() { |
||||||
|
return codeMsg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setCodeMsg(CodeMsg codeMsg) { |
||||||
|
this.codeMsg = codeMsg; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
package com.alops.common.utils; |
||||||
|
|
||||||
|
|
||||||
|
import com.alops.common.core.domain.ResultVO; |
||||||
|
import com.alops.common.core.domain.entity.CodeMsg; |
||||||
|
|
||||||
|
public class ResultUtils { |
||||||
|
|
||||||
|
// 成功
|
||||||
|
public static <T> ResultVO<T> success(String msg, T data) { |
||||||
|
ResultVO<T> resultVO = new ResultVO<>(); |
||||||
|
resultVO.setCode(0); |
||||||
|
resultVO.setMsg(msg); |
||||||
|
resultVO.setData(data); |
||||||
|
|
||||||
|
return resultVO; |
||||||
|
} |
||||||
|
|
||||||
|
// 错误
|
||||||
|
public static <T> ResultVO<T> error(CodeMsg codeMsg) { |
||||||
|
ResultVO<T> resultVO = new ResultVO<>(); |
||||||
|
resultVO.setCode(codeMsg.getCode()); |
||||||
|
resultVO.setMsg(codeMsg.getMsg()); |
||||||
|
resultVO.setData(null); |
||||||
|
|
||||||
|
return resultVO; |
||||||
|
} |
||||||
|
|
||||||
|
// 错误
|
||||||
|
public static <T> ResultVO<T> error(String codeMsg) { |
||||||
|
ResultVO<T> resultVO = new ResultVO<>(); |
||||||
|
resultVO.setCode(500); |
||||||
|
resultVO.setMsg(codeMsg); |
||||||
|
resultVO.setData(null); |
||||||
|
|
||||||
|
return resultVO; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,572 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="zh-CN"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>华为企业网络设备状态监控数据表</title> |
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
||||||
|
<style> |
||||||
|
* { |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
box-sizing: border-box; |
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
||||||
|
} |
||||||
|
|
||||||
|
body { |
||||||
|
background: linear-gradient(135deg, #1a2a6c, #2c3e50); |
||||||
|
color: #333; |
||||||
|
padding: 20px; |
||||||
|
min-height: 100vh; |
||||||
|
} |
||||||
|
|
||||||
|
.container { |
||||||
|
max-width: 1200px; |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
|
||||||
|
header { |
||||||
|
text-align: center; |
||||||
|
padding: 30px 0; |
||||||
|
color: white; |
||||||
|
text-shadow: 0 2px 4px rgba(0,0,0,0.3); |
||||||
|
} |
||||||
|
|
||||||
|
h1 { |
||||||
|
font-size: 2.5rem; |
||||||
|
margin-bottom: 15px; |
||||||
|
background: linear-gradient(45deg, #00c6ff, #0072ff); |
||||||
|
-webkit-background-clip: text; |
||||||
|
background-clip: text; |
||||||
|
color: transparent; |
||||||
|
display: inline-block; |
||||||
|
} |
||||||
|
|
||||||
|
.subtitle { |
||||||
|
font-size: 1.2rem; |
||||||
|
color: #e0f7fa; |
||||||
|
max-width: 800px; |
||||||
|
margin: 0 auto; |
||||||
|
line-height: 1.6; |
||||||
|
} |
||||||
|
|
||||||
|
.card { |
||||||
|
background: rgba(255, 255, 255, 0.95); |
||||||
|
border-radius: 12px; |
||||||
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); |
||||||
|
overflow: hidden; |
||||||
|
margin-bottom: 30px; |
||||||
|
transition: transform 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
.card:hover { |
||||||
|
transform: translateY(-5px); |
||||||
|
} |
||||||
|
|
||||||
|
.card-header { |
||||||
|
background: linear-gradient(90deg, #0072ff, #00c6ff); |
||||||
|
color: white; |
||||||
|
padding: 15px 20px; |
||||||
|
font-size: 1.4rem; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.card-content { |
||||||
|
padding: 20px; |
||||||
|
overflow-x: auto; |
||||||
|
} |
||||||
|
|
||||||
|
table { |
||||||
|
width: 100%; |
||||||
|
border-collapse: collapse; |
||||||
|
min-width: 1000px; |
||||||
|
} |
||||||
|
|
||||||
|
th { |
||||||
|
background: linear-gradient(180deg, #e3f2fd, #bbdefb); |
||||||
|
color: #1565c0; |
||||||
|
padding: 15px 12px; |
||||||
|
text-align: left; |
||||||
|
font-weight: 600; |
||||||
|
border-bottom: 2px solid #64b5f6; |
||||||
|
position: sticky; |
||||||
|
top: 0; |
||||||
|
} |
||||||
|
|
||||||
|
td { |
||||||
|
padding: 14px 12px; |
||||||
|
border-bottom: 1px solid #e0e0e0; |
||||||
|
vertical-align: top; |
||||||
|
line-height: 1.5; |
||||||
|
} |
||||||
|
|
||||||
|
tr:nth-child(even) { |
||||||
|
background-color: #f5f9ff; |
||||||
|
} |
||||||
|
|
||||||
|
tr:hover { |
||||||
|
background-color: #e3f2fd; |
||||||
|
} |
||||||
|
|
||||||
|
.category-row { |
||||||
|
background-color: #e3f2fd !important; |
||||||
|
font-weight: 700; |
||||||
|
color: #0d47a1; |
||||||
|
border-top: 2px solid #bbdefb; |
||||||
|
} |
||||||
|
|
||||||
|
.sub-item { |
||||||
|
padding-left: 30px !important; |
||||||
|
color: #37474f; |
||||||
|
} |
||||||
|
|
||||||
|
.footer { |
||||||
|
text-align: center; |
||||||
|
color: #bbdefb; |
||||||
|
padding: 20px; |
||||||
|
font-size: 0.9rem; |
||||||
|
margin-top: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.logo { |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.logo-inner { |
||||||
|
background: white; |
||||||
|
padding: 15px 30px; |
||||||
|
border-radius: 50px; |
||||||
|
box-shadow: 0 5px 15px rgba(0,0,0,0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.highlight { |
||||||
|
background: #e1f5fe; |
||||||
|
padding: 3px 6px; |
||||||
|
border-radius: 4px; |
||||||
|
font-weight: 600; |
||||||
|
color: #0288d1; |
||||||
|
} |
||||||
|
|
||||||
|
.monitoring-icon { |
||||||
|
color: #0072ff; |
||||||
|
margin-right: 8px; |
||||||
|
font-size: 1.2rem; |
||||||
|
} |
||||||
|
|
||||||
|
.tag { |
||||||
|
display: inline-block; |
||||||
|
padding: 3px 8px; |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 0.8rem; |
||||||
|
font-weight: 600; |
||||||
|
} |
||||||
|
|
||||||
|
.snmp { background: #e3f2fd; color: #1565c0; } |
||||||
|
.syslog { background: #f1f8e9; color: #689f38; } |
||||||
|
.netconf { background: #fff3e0; color: #ef6c00; } |
||||||
|
.esight { background: #fce4ec; color: #c2185b; } |
||||||
|
|
||||||
|
@media (max-width: 768px) { |
||||||
|
.card-content { |
||||||
|
padding: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
th, td { |
||||||
|
padding: 10px 8px; |
||||||
|
font-size: 0.9rem; |
||||||
|
} |
||||||
|
|
||||||
|
h1 { |
||||||
|
font-size: 1.8rem; |
||||||
|
} |
||||||
|
|
||||||
|
.subtitle { |
||||||
|
font-size: 1rem; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="container"> |
||||||
|
<div class="logo"> |
||||||
|
<div class="logo-inner"> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<header> |
||||||
|
<h1><i class="fas fa-network-wired"></i> 华为企业网络设备状态监控系统</h1> |
||||||
|
<p class="subtitle">此表格详细列出了华为企业级交换机和路由器需要监控的关键数据指标,包含设备基本信息、事件日志、资源信息、故障告警、表项查询、密码管理和基础信息等七大类数据。</p> |
||||||
|
</header> |
||||||
|
|
||||||
|
<div class="card"> |
||||||
|
<div class="card-header"> |
||||||
|
<i class="fas fa-server"></i> 设备状态监控数据指标总览 |
||||||
|
</div> |
||||||
|
<div class="card-content"> |
||||||
|
<table> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th width="18%">监控类别</th> |
||||||
|
<th width="22%">监控项</th> |
||||||
|
<th width="30%">数据类型/描述</th> |
||||||
|
<th width="30%">补充说明</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<!-- 设备基本信息 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">设备基本信息</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>设备名称</td> |
||||||
|
<td>字符串</td> |
||||||
|
<td>设备主机名</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>固件版本</td> |
||||||
|
<td>字符串(如:V200R019C10)</td> |
||||||
|
<td><span class="highlight">display version</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>管理IP</td> |
||||||
|
<td>IPv4/IPv6地址</td> |
||||||
|
<td>带外管理地址</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>设备持续运行时长</td> |
||||||
|
<td>时间格式(如:365天12小时)</td> |
||||||
|
<td><span class="highlight">display clock</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>单板在位状态</td> |
||||||
|
<td>枚举值(Online/Offline/Fault)</td> |
||||||
|
<td><span class="highlight">display device</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>健康度</td> |
||||||
|
<td>百分比(0-100%)</td> |
||||||
|
<td>综合计算指标</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>设备温度</td> |
||||||
|
<td>数值(单位:℃)</td> |
||||||
|
<td>部分支持湿度(需设备支持)</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>接口信息</td> |
||||||
|
<td>结构化数据</td> |
||||||
|
<td>包含以下子项:</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 端口Up/Down</td> |
||||||
|
<td>布尔值(True/False)</td> |
||||||
|
<td><span class="highlight">display interface brief</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 速率</td> |
||||||
|
<td>数值(单位:Mbps/Gbps)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 双工模式</td> |
||||||
|
<td>枚举值(Full/Half/Auto)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 入/出方向流量</td> |
||||||
|
<td>数值(单位:bps)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 带宽占用率</td> |
||||||
|
<td>百分比</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 丢包率</td> |
||||||
|
<td>百分比</td> |
||||||
|
<td>关键告警指标</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">└─ 错包率</td> |
||||||
|
<td>百分比</td> |
||||||
|
<td><strong>仅交换机/路由器支持</strong></td> |
||||||
|
</tr> |
||||||
|
|
||||||
|
<!-- 事件日志 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">事件日志</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>设备上下线日志</td> |
||||||
|
<td>时间戳 + 事件描述</td> |
||||||
|
<td><span class="tag syslog">Syslog</span> 协议采集</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>系统上报日志</td> |
||||||
|
<td>结构化日志(含事件类型、级别)</td> |
||||||
|
<td>支持关键词过滤(如:接口震荡、CPU过载)</td> |
||||||
|
</tr> |
||||||
|
|
||||||
|
<!-- 资源信息 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">资源信息</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>CPU使用率</td> |
||||||
|
<td>百分比(5秒/1分钟/5分钟均值)</td> |
||||||
|
<td><span class="tag snmp">SNMP</span> <span class="highlight">display cpu-usage</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>内存使用率</td> |
||||||
|
<td>百分比(物理内存+交换内存)</td> |
||||||
|
<td><span class="tag snmp">SNMP</span> <span class="highlight">display memory-usage</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>风扇转速</td> |
||||||
|
<td>数值(单位:rpm) + 状态(Normal/Abnormal)</td> |
||||||
|
<td><span class="highlight">display fan</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>电源输入/输出电压</td> |
||||||
|
<td>数值(单位:V) + 状态(Normal/UnderVoltage)</td> |
||||||
|
<td><span class="highlight">display power</span></td> |
||||||
|
</tr> |
||||||
|
|
||||||
|
<!-- 故障告警 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">故障告警</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>告警信息</td> |
||||||
|
<td>结构化数据(级别、类型、描述)</td> |
||||||
|
<td> |
||||||
|
<strong>分级规则</strong>:1-6级(6级最高)<br> |
||||||
|
<span class="tag syslog">Syslog</span> 协议采集 |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
|
||||||
|
<!-- 表项查询 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">表项查询</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>VLAN信息</td> |
||||||
|
<td>列表数据</td> |
||||||
|
<td>包含以下字段:</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ ManID</td> |
||||||
|
<td>字符串</td> |
||||||
|
<td>VLAN管理ID</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ IP地址</td> |
||||||
|
<td>IPv4地址</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">└─ 子网掩码</td> |
||||||
|
<td>掩码格式(如:255.255.255.0)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>路由表条目</td> |
||||||
|
<td>列表数据</td> |
||||||
|
<td>包含以下字段:</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 目的地址</td> |
||||||
|
<td>IPv4/IPv6网段</td> |
||||||
|
<td><span class="highlight">display ip routing-table</span></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">├─ 子网掩码</td> |
||||||
|
<td>掩码格式</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td class="sub-item">└─ 下一跳地址</td> |
||||||
|
<td>IPv4/IPv6地址</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
|
||||||
|
<!-- 密码管理 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">密码管理</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>当前密码</td> |
||||||
|
<td>脱敏字符串(如:Ad******min)</td> |
||||||
|
<td> |
||||||
|
<strong>安全规则</strong>:脱敏中间6位<br> |
||||||
|
<span class="tag netconf">NETCONF/API</span> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>历史密码</td> |
||||||
|
<td>列表(最近5次) + 时间戳</td> |
||||||
|
<td>平台校验后可查看完整密码</td> |
||||||
|
</tr> |
||||||
|
|
||||||
|
<!-- 基础信息 --> |
||||||
|
<tr class="category-row"> |
||||||
|
<td colspan="4">基础信息</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>资产ID</td> |
||||||
|
<td>唯一标识符</td> |
||||||
|
<td>CMDB系统同步</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>设备类型</td> |
||||||
|
<td>枚举值(交换机/路由器)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>厂家</td> |
||||||
|
<td>字符串(固定值:华为)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>接口数量</td> |
||||||
|
<td>数值(物理+逻辑接口)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>安装位置</td> |
||||||
|
<td>字符串(如:机房A-机柜3-U5)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>设备管理员</td> |
||||||
|
<td>字符串(责任人姓名)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>购买日期</td> |
||||||
|
<td>日期格式(YYYY-MM-DD)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>质保期限</td> |
||||||
|
<td>日期格式</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>是否过保</td> |
||||||
|
<td>布尔值</td> |
||||||
|
<td>自动计算字段</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>服役年限</td> |
||||||
|
<td>数值(单位:年)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>故障次数</td> |
||||||
|
<td>数值(累计)</td> |
||||||
|
<td>关联告警系统</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>维修次数</td> |
||||||
|
<td>数值(累计)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td></td> |
||||||
|
<td>维修金额(累积总值)</td> |
||||||
|
<td>数值(单位:元)</td> |
||||||
|
<td></td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="card"> |
||||||
|
<div class="card-header"> |
||||||
|
<i class="fas fa-info-circle"></i> 数据采集方式说明 |
||||||
|
</div> |
||||||
|
<div class="card-content"> |
||||||
|
<table> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th width="30%">采集方式</th> |
||||||
|
<th width="70%">适用监控数据</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td><span class="tag snmp">SNMP协议</span></td> |
||||||
|
<td>设备基础状态、资源信息(CPU/内存)、接口流量、设备温度</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td><span class="tag syslog">Syslog协议</span></td> |
||||||
|
<td>事件日志、故障告警、设备上下线记录</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td><span class="tag netconf">NETCONF/YANG模型</span></td> |
||||||
|
<td>表项查询(VLAN/路由表)、密码管理、高级配置信息</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="footer"> |
||||||
|
<p>华为企业网络设备状态监控系统 | 数据表设计 v1.0</p> |
||||||
|
<p>注:实际监控指标需根据具体设备型号和软件版本进行调整</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
||||||
Loading…
Reference in new issue