code
stringlengths 1
1.05M
| repo_name
stringlengths 6
83
| path
stringlengths 3
242
| language
stringclasses 222
values | license
stringclasses 20
values | size
int64 1
1.05M
|
|---|---|---|---|---|---|
package com.zzyl.system.service.impl;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.zzyl.common.constant.UserConstants;
import com.zzyl.common.core.domain.entity.SysDictData;
import com.zzyl.common.core.domain.entity.SysDictType;
import com.zzyl.common.exception.ServiceException;
import com.zzyl.common.utils.DictUtils;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.system.mapper.SysDictDataMapper;
import com.zzyl.system.mapper.SysDictTypeMapper;
import com.zzyl.system.service.ISysDictTypeService;
/**
* 字典 业务层处理
*
* @author ruoyi
*/
@Service
public class SysDictTypeServiceImpl implements ISysDictTypeService
{
@Autowired
private SysDictTypeMapper dictTypeMapper;
@Autowired
private SysDictDataMapper dictDataMapper;
/**
* 项目启动时,初始化字典到缓存
*/
@PostConstruct
public void init()
{
loadingDictCache();
}
/**
* 根据条件分页查询字典类型
*
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
@Override
public List<SysDictType> selectDictTypeList(SysDictType dictType)
{
return dictTypeMapper.selectDictTypeList(dictType);
}
/**
* 根据所有字典类型
*
* @return 字典类型集合信息
*/
@Override
public List<SysDictType> selectDictTypeAll()
{
return dictTypeMapper.selectDictTypeAll();
}
/**
* 根据字典类型查询字典数据
*
* @param dictType 字典类型
* @return 字典数据集合信息
*/
@Override
public List<SysDictData> selectDictDataByType(String dictType)
{
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
if (StringUtils.isNotEmpty(dictDatas))
{
return dictDatas;
}
dictDatas = dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotEmpty(dictDatas))
{
DictUtils.setDictCache(dictType, dictDatas);
return dictDatas;
}
return null;
}
/**
* 根据字典类型ID查询信息
*
* @param dictId 字典类型ID
* @return 字典类型
*/
@Override
public SysDictType selectDictTypeById(Long dictId)
{
return dictTypeMapper.selectDictTypeById(dictId);
}
/**
* 根据字典类型查询信息
*
* @param dictType 字典类型
* @return 字典类型
*/
@Override
public SysDictType selectDictTypeByType(String dictType)
{
return dictTypeMapper.selectDictTypeByType(dictType);
}
/**
* 批量删除字典类型信息
*
* @param dictIds 需要删除的字典ID
*/
@Override
public void deleteDictTypeByIds(Long[] dictIds)
{
for (Long dictId : dictIds)
{
SysDictType dictType = selectDictTypeById(dictId);
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
{
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
}
dictTypeMapper.deleteDictTypeById(dictId);
DictUtils.removeDictCache(dictType.getDictType());
}
}
/**
* 加载字典缓存数据
*/
@Override
public void loadingDictCache()
{
SysDictData dictData = new SysDictData();
dictData.setStatus("0");
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
{
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
}
}
/**
* 清空字典缓存数据
*/
@Override
public void clearDictCache()
{
DictUtils.clearDictCache();
}
/**
* 重置字典缓存数据
*/
@Override
public void resetDictCache()
{
clearDictCache();
loadingDictCache();
}
/**
* 新增保存字典类型信息
*
* @param dict 字典类型信息
* @return 结果
*/
@Override
public int insertDictType(SysDictType dict)
{
int row = dictTypeMapper.insertDictType(dict);
if (row > 0)
{
DictUtils.setDictCache(dict.getDictType(), null);
}
return row;
}
/**
* 修改保存字典类型信息
*
* @param dict 字典类型信息
* @return 结果
*/
@Override
@Transactional
public int updateDictType(SysDictType dict)
{
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
int row = dictTypeMapper.updateDictType(dict);
if (row > 0)
{
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
DictUtils.setDictCache(dict.getDictType(), dictDatas);
}
return row;
}
/**
* 校验字典类型称是否唯一
*
* @param dict 字典类型
* @return 结果
*/
@Override
public boolean checkDictTypeUnique(SysDictType dict)
{
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysDictTypeServiceImpl.java
|
Java
|
unknown
| 6,129
|
package com.zzyl.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.system.domain.SysLogininfor;
import com.zzyl.system.mapper.SysLogininforMapper;
import com.zzyl.system.service.ISysLogininforService;
/**
* 系统访问日志情况信息 服务层处理
*
* @author ruoyi
*/
@Service
public class SysLogininforServiceImpl implements ISysLogininforService
{
@Autowired
private SysLogininforMapper logininforMapper;
/**
* 新增系统登录日志
*
* @param logininfor 访问日志对象
*/
@Override
public void insertLogininfor(SysLogininfor logininfor)
{
logininforMapper.insertLogininfor(logininfor);
}
/**
* 查询系统登录日志集合
*
* @param logininfor 访问日志对象
* @return 登录记录集合
*/
@Override
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor)
{
return logininforMapper.selectLogininforList(logininfor);
}
/**
* 批量删除系统登录日志
*
* @param infoIds 需要删除的登录日志ID
* @return 结果
*/
@Override
public int deleteLogininforByIds(Long[] infoIds)
{
return logininforMapper.deleteLogininforByIds(infoIds);
}
/**
* 清空系统登录日志
*/
@Override
public void cleanLogininfor()
{
logininforMapper.cleanLogininfor();
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysLogininforServiceImpl.java
|
Java
|
unknown
| 1,537
|
package com.zzyl.system.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.common.constant.Constants;
import com.zzyl.common.constant.UserConstants;
import com.zzyl.common.core.domain.TreeSelect;
import com.zzyl.common.core.domain.entity.SysMenu;
import com.zzyl.common.core.domain.entity.SysRole;
import com.zzyl.common.core.domain.entity.SysUser;
import com.zzyl.common.utils.SecurityUtils;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.system.domain.vo.MetaVo;
import com.zzyl.system.domain.vo.RouterVo;
import com.zzyl.system.mapper.SysMenuMapper;
import com.zzyl.system.mapper.SysRoleMapper;
import com.zzyl.system.mapper.SysRoleMenuMapper;
import com.zzyl.system.service.ISysMenuService;
/**
* 菜单 业务层处理
*
* @author ruoyi
*/
@Service
public class SysMenuServiceImpl implements ISysMenuService
{
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
@Autowired
private SysMenuMapper menuMapper;
@Autowired
private SysRoleMapper roleMapper;
@Autowired
private SysRoleMenuMapper roleMenuMapper;
/**
* 根据用户查询系统菜单列表
*
* @param userId 用户ID
* @return 菜单列表
*/
@Override
public List<SysMenu> selectMenuList(Long userId)
{
return selectMenuList(new SysMenu(), userId);
}
/**
* 查询系统菜单列表
*
* @param menu 菜单信息
* @return 菜单列表
*/
@Override
public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
{
List<SysMenu> menuList = null;
// 管理员显示所有菜单信息
if (SysUser.isAdmin(userId))
{
menuList = menuMapper.selectMenuList(menu);
}
else
{
menu.getParams().put("userId", userId);
menuList = menuMapper.selectMenuListByUserId(menu);
}
return menuList;
}
/**
* 根据用户ID查询权限
*
* @param userId 用户ID
* @return 权限列表
*/
@Override
public Set<String> selectMenuPermsByUserId(Long userId)
{
List<String> perms = menuMapper.selectMenuPermsByUserId(userId);
Set<String> permsSet = new HashSet<>();
for (String perm : perms)
{
if (StringUtils.isNotEmpty(perm))
{
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
}
}
return permsSet;
}
/**
* 根据角色ID查询权限
*
* @param roleId 角色ID
* @return 权限列表
*/
@Override
public Set<String> selectMenuPermsByRoleId(Long roleId)
{
List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId);
Set<String> permsSet = new HashSet<>();
for (String perm : perms)
{
if (StringUtils.isNotEmpty(perm))
{
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
}
}
return permsSet;
}
/**
* 根据用户ID查询菜单
*
* @param userId 用户名称
* @return 菜单列表
*/
@Override
public List<SysMenu> selectMenuTreeByUserId(Long userId)
{
List<SysMenu> menus = null;
if (SecurityUtils.isAdmin(userId))
{
menus = menuMapper.selectMenuTreeAll();
}
else
{
menus = menuMapper.selectMenuTreeByUserId(userId);
}
return getChildPerms(menus, 0);
}
/**
* 根据角色ID查询菜单树信息
*
* @param roleId 角色ID
* @return 选中菜单列表
*/
@Override
public List<Long> selectMenuListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
}
/**
* 构建前端路由所需要的菜单
*
* @param menus 菜单列表
* @return 路由列表
*/
@Override
public List<RouterVo> buildMenus(List<SysMenu> menus)
{
List<RouterVo> routers = new LinkedList<RouterVo>();
for (SysMenu menu : menus)
{
RouterVo router = new RouterVo();
router.setHidden("1".equals(menu.getVisible()));
router.setName(getRouteName(menu));
router.setPath(getRouterPath(menu));
router.setComponent(getComponent(menu));
router.setQuery(menu.getQuery());
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
List<SysMenu> cMenus = menu.getChildren();
if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
{
router.setAlwaysShow(true);
router.setRedirect("noRedirect");
router.setChildren(buildMenus(cMenus));
}
else if (isMenuFrame(menu))
{
router.setMeta(null);
List<RouterVo> childrenList = new ArrayList<RouterVo>();
RouterVo children = new RouterVo();
children.setPath(menu.getPath());
children.setComponent(menu.getComponent());
children.setName(getRouteName(menu.getRouteName(), menu.getPath()));
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
children.setQuery(menu.getQuery());
childrenList.add(children);
router.setChildren(childrenList);
}
else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
{
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
router.setPath("/");
List<RouterVo> childrenList = new ArrayList<RouterVo>();
RouterVo children = new RouterVo();
String routerPath = innerLinkReplaceEach(menu.getPath());
children.setPath(routerPath);
children.setComponent(UserConstants.INNER_LINK);
children.setName(getRouteName(menu.getRouteName(), routerPath));
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath()));
childrenList.add(children);
router.setChildren(childrenList);
}
routers.add(router);
}
return routers;
}
/**
* 构建前端所需要树结构
*
* @param menus 菜单列表
* @return 树结构列表
*/
@Override
public List<SysMenu> buildMenuTree(List<SysMenu> menus)
{
List<SysMenu> returnList = new ArrayList<SysMenu>();
List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList());
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
{
SysMenu menu = (SysMenu) iterator.next();
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(menu.getParentId()))
{
recursionFn(menus, menu);
returnList.add(menu);
}
}
if (returnList.isEmpty())
{
returnList = menus;
}
return returnList;
}
/**
* 构建前端所需要下拉树结构
*
* @param menus 菜单列表
* @return 下拉树结构列表
*/
@Override
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus)
{
List<SysMenu> menuTrees = buildMenuTree(menus);
return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
/**
* 根据菜单ID查询信息
*
* @param menuId 菜单ID
* @return 菜单信息
*/
@Override
public SysMenu selectMenuById(Long menuId)
{
return menuMapper.selectMenuById(menuId);
}
/**
* 是否存在菜单子节点
*
* @param menuId 菜单ID
* @return 结果
*/
@Override
public boolean hasChildByMenuId(Long menuId)
{
int result = menuMapper.hasChildByMenuId(menuId);
return result > 0;
}
/**
* 查询菜单使用数量
*
* @param menuId 菜单ID
* @return 结果
*/
@Override
public boolean checkMenuExistRole(Long menuId)
{
int result = roleMenuMapper.checkMenuExistRole(menuId);
return result > 0;
}
/**
* 新增保存菜单信息
*
* @param menu 菜单信息
* @return 结果
*/
@Override
public int insertMenu(SysMenu menu)
{
return menuMapper.insertMenu(menu);
}
/**
* 修改保存菜单信息
*
* @param menu 菜单信息
* @return 结果
*/
@Override
public int updateMenu(SysMenu menu)
{
return menuMapper.updateMenu(menu);
}
/**
* 删除菜单管理信息
*
* @param menuId 菜单ID
* @return 结果
*/
@Override
public int deleteMenuById(Long menuId)
{
return menuMapper.deleteMenuById(menuId);
}
/**
* 校验菜单名称是否唯一
*
* @param menu 菜单信息
* @return 结果
*/
@Override
public boolean checkMenuNameUnique(SysMenu menu)
{
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 获取路由名称
*
* @param menu 菜单信息
* @return 路由名称
*/
public String getRouteName(SysMenu menu)
{
// 非外链并且是一级目录(类型为目录)
if (isMenuFrame(menu))
{
return StringUtils.EMPTY;
}
return getRouteName(menu.getRouteName(), menu.getPath());
}
/**
* 获取路由名称,如没有配置路由名称则取路由地址
*
* @param routerName 路由名称
* @param path 路由地址
* @return 路由名称(驼峰格式)
*/
public String getRouteName(String name, String path)
{
String routerName = StringUtils.isNotEmpty(name) ? name : path;
return StringUtils.capitalize(routerName);
}
/**
* 获取路由地址
*
* @param menu 菜单信息
* @return 路由地址
*/
public String getRouterPath(SysMenu menu)
{
String routerPath = menu.getPath();
// 内链打开外网方式
if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
{
routerPath = innerLinkReplaceEach(routerPath);
}
// 非外链并且是一级目录(类型为目录)
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
&& UserConstants.NO_FRAME.equals(menu.getIsFrame()))
{
routerPath = "/" + menu.getPath();
}
// 非外链并且是一级目录(类型为菜单)
else if (isMenuFrame(menu))
{
routerPath = "/";
}
return routerPath;
}
/**
* 获取组件信息
*
* @param menu 菜单信息
* @return 组件信息
*/
public String getComponent(SysMenu menu)
{
String component = UserConstants.LAYOUT;
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu))
{
component = menu.getComponent();
}
else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu))
{
component = UserConstants.INNER_LINK;
}
else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu))
{
component = UserConstants.PARENT_VIEW;
}
return component;
}
/**
* 是否为菜单内部跳转
*
* @param menu 菜单信息
* @return 结果
*/
public boolean isMenuFrame(SysMenu menu)
{
return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
&& menu.getIsFrame().equals(UserConstants.NO_FRAME);
}
/**
* 是否为内链组件
*
* @param menu 菜单信息
* @return 结果
*/
public boolean isInnerLink(SysMenu menu)
{
return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath());
}
/**
* 是否为parent_view组件
*
* @param menu 菜单信息
* @return 结果
*/
public boolean isParentView(SysMenu menu)
{
return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
}
/**
* 根据父节点的ID获取所有子节点
*
* @param list 分类表
* @param parentId 传入的父节点ID
* @return String
*/
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
{
List<SysMenu> returnList = new ArrayList<SysMenu>();
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();)
{
SysMenu t = (SysMenu) iterator.next();
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
if (t.getParentId() == parentId)
{
recursionFn(list, t);
returnList.add(t);
}
}
return returnList;
}
/**
* 递归列表
*
* @param list 分类表
* @param t 子节点
*/
private void recursionFn(List<SysMenu> list, SysMenu t)
{
// 得到子节点列表
List<SysMenu> childList = getChildList(list, t);
t.setChildren(childList);
for (SysMenu tChild : childList)
{
if (hasChild(list, tChild))
{
recursionFn(list, tChild);
}
}
}
/**
* 得到子节点列表
*/
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t)
{
List<SysMenu> tlist = new ArrayList<SysMenu>();
Iterator<SysMenu> it = list.iterator();
while (it.hasNext())
{
SysMenu n = (SysMenu) it.next();
if (n.getParentId().longValue() == t.getMenuId().longValue())
{
tlist.add(n);
}
}
return tlist;
}
/**
* 判断是否有子节点
*/
private boolean hasChild(List<SysMenu> list, SysMenu t)
{
return getChildList(list, t).size() > 0;
}
/**
* 内链域名特殊字符替换
*
* @return 替换后的内链域名
*/
public String innerLinkReplaceEach(String path)
{
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":" },
new String[] { "", "", "", "/", "/" });
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysMenuServiceImpl.java
|
Java
|
unknown
| 15,610
|
package com.zzyl.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.system.domain.SysNotice;
import com.zzyl.system.mapper.SysNoticeMapper;
import com.zzyl.system.service.ISysNoticeService;
/**
* 公告 服务层实现
*
* @author ruoyi
*/
@Service
public class SysNoticeServiceImpl implements ISysNoticeService
{
@Autowired
private SysNoticeMapper noticeMapper;
/**
* 查询公告信息
*
* @param noticeId 公告ID
* @return 公告信息
*/
@Override
public SysNotice selectNoticeById(Long noticeId)
{
return noticeMapper.selectNoticeById(noticeId);
}
/**
* 查询公告列表
*
* @param notice 公告信息
* @return 公告集合
*/
@Override
public List<SysNotice> selectNoticeList(SysNotice notice)
{
return noticeMapper.selectNoticeList(notice);
}
/**
* 新增公告
*
* @param notice 公告信息
* @return 结果
*/
@Override
public int insertNotice(SysNotice notice)
{
return noticeMapper.insertNotice(notice);
}
/**
* 修改公告
*
* @param notice 公告信息
* @return 结果
*/
@Override
public int updateNotice(SysNotice notice)
{
return noticeMapper.updateNotice(notice);
}
/**
* 删除公告对象
*
* @param noticeId 公告ID
* @return 结果
*/
@Override
public int deleteNoticeById(Long noticeId)
{
return noticeMapper.deleteNoticeById(noticeId);
}
/**
* 批量删除公告信息
*
* @param noticeIds 需要删除的公告ID
* @return 结果
*/
@Override
public int deleteNoticeByIds(Long[] noticeIds)
{
return noticeMapper.deleteNoticeByIds(noticeIds);
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysNoticeServiceImpl.java
|
Java
|
unknown
| 1,942
|
package com.zzyl.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.system.domain.SysOperLog;
import com.zzyl.system.mapper.SysOperLogMapper;
import com.zzyl.system.service.ISysOperLogService;
/**
* 操作日志 服务层处理
*
* @author ruoyi
*/
@Service
public class SysOperLogServiceImpl implements ISysOperLogService
{
@Autowired
private SysOperLogMapper operLogMapper;
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
@Override
public void insertOperlog(SysOperLog operLog)
{
operLogMapper.insertOperlog(operLog);
}
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
@Override
public List<SysOperLog> selectOperLogList(SysOperLog operLog)
{
return operLogMapper.selectOperLogList(operLog);
}
/**
* 批量删除系统操作日志
*
* @param operIds 需要删除的操作日志ID
* @return 结果
*/
@Override
public int deleteOperLogByIds(Long[] operIds)
{
return operLogMapper.deleteOperLogByIds(operIds);
}
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
@Override
public SysOperLog selectOperLogById(Long operId)
{
return operLogMapper.selectOperLogById(operId);
}
/**
* 清空操作日志
*/
@Override
public void cleanOperLog()
{
operLogMapper.cleanOperLog();
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysOperLogServiceImpl.java
|
Java
|
unknown
| 1,678
|
package com.zzyl.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.common.constant.UserConstants;
import com.zzyl.common.exception.ServiceException;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.system.domain.SysPost;
import com.zzyl.system.mapper.SysPostMapper;
import com.zzyl.system.mapper.SysUserPostMapper;
import com.zzyl.system.service.ISysPostService;
/**
* 岗位信息 服务层处理
*
* @author ruoyi
*/
@Service
public class SysPostServiceImpl implements ISysPostService
{
@Autowired
private SysPostMapper postMapper;
@Autowired
private SysUserPostMapper userPostMapper;
/**
* 查询岗位信息集合
*
* @param post 岗位信息
* @return 岗位信息集合
*/
@Override
public List<SysPost> selectPostList(SysPost post)
{
return postMapper.selectPostList(post);
}
/**
* 查询所有岗位
*
* @return 岗位列表
*/
@Override
public List<SysPost> selectPostAll()
{
return postMapper.selectPostAll();
}
/**
* 通过岗位ID查询岗位信息
*
* @param postId 岗位ID
* @return 角色对象信息
*/
@Override
public SysPost selectPostById(Long postId)
{
return postMapper.selectPostById(postId);
}
/**
* 根据用户ID获取岗位选择框列表
*
* @param userId 用户ID
* @return 选中岗位ID列表
*/
@Override
public List<Long> selectPostListByUserId(Long userId)
{
return postMapper.selectPostListByUserId(userId);
}
/**
* 校验岗位名称是否唯一
*
* @param post 岗位信息
* @return 结果
*/
@Override
public boolean checkPostNameUnique(SysPost post)
{
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
SysPost info = postMapper.checkPostNameUnique(post.getPostName());
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验岗位编码是否唯一
*
* @param post 岗位信息
* @return 结果
*/
@Override
public boolean checkPostCodeUnique(SysPost post)
{
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 通过岗位ID查询岗位使用数量
*
* @param postId 岗位ID
* @return 结果
*/
@Override
public int countUserPostById(Long postId)
{
return userPostMapper.countUserPostById(postId);
}
/**
* 删除岗位信息
*
* @param postId 岗位ID
* @return 结果
*/
@Override
public int deletePostById(Long postId)
{
return postMapper.deletePostById(postId);
}
/**
* 批量删除岗位信息
*
* @param postIds 需要删除的岗位ID
* @return 结果
*/
@Override
public int deletePostByIds(Long[] postIds)
{
for (Long postId : postIds)
{
SysPost post = selectPostById(postId);
if (countUserPostById(postId) > 0)
{
throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName()));
}
}
return postMapper.deletePostByIds(postIds);
}
/**
* 新增保存岗位信息
*
* @param post 岗位信息
* @return 结果
*/
@Override
public int insertPost(SysPost post)
{
return postMapper.insertPost(post);
}
/**
* 修改保存岗位信息
*
* @param post 岗位信息
* @return 结果
*/
@Override
public int updatePost(SysPost post)
{
return postMapper.updatePost(post);
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysPostServiceImpl.java
|
Java
|
unknown
| 4,279
|
package com.zzyl.system.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.zzyl.common.annotation.DataScope;
import com.zzyl.common.constant.UserConstants;
import com.zzyl.common.core.domain.entity.SysRole;
import com.zzyl.common.core.domain.entity.SysUser;
import com.zzyl.common.exception.ServiceException;
import com.zzyl.common.utils.SecurityUtils;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.common.utils.spring.SpringUtils;
import com.zzyl.system.domain.SysRoleDept;
import com.zzyl.system.domain.SysRoleMenu;
import com.zzyl.system.domain.SysUserRole;
import com.zzyl.system.mapper.SysRoleDeptMapper;
import com.zzyl.system.mapper.SysRoleMapper;
import com.zzyl.system.mapper.SysRoleMenuMapper;
import com.zzyl.system.mapper.SysUserRoleMapper;
import com.zzyl.system.service.ISysRoleService;
/**
* 角色 业务层处理
*
* @author ruoyi
*/
@Service
public class SysRoleServiceImpl implements ISysRoleService
{
@Autowired
private SysRoleMapper roleMapper;
@Autowired
private SysRoleMenuMapper roleMenuMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
@Autowired
private SysRoleDeptMapper roleDeptMapper;
/**
* 根据条件分页查询角色数据
*
* @param role 角色信息
* @return 角色数据集合信息
*/
@Override
@DataScope(deptAlias = "d")
public List<SysRole> selectRoleList(SysRole role)
{
return roleMapper.selectRoleList(role);
}
/**
* 根据用户ID查询角色
*
* @param userId 用户ID
* @return 角色列表
*/
@Override
public List<SysRole> selectRolesByUserId(Long userId)
{
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
List<SysRole> roles = selectRoleAll();
for (SysRole role : roles)
{
for (SysRole userRole : userRoles)
{
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
{
role.setFlag(true);
break;
}
}
}
return roles;
}
/**
* 根据用户ID查询权限
*
* @param userId 用户ID
* @return 权限列表
*/
@Override
public Set<String> selectRolePermissionByUserId(Long userId)
{
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
Set<String> permsSet = new HashSet<>();
for (SysRole perm : perms)
{
if (StringUtils.isNotNull(perm))
{
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
}
}
return permsSet;
}
/**
* 查询所有角色
*
* @return 角色列表
*/
@Override
public List<SysRole> selectRoleAll()
{
return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
}
/**
* 根据用户ID获取角色选择框列表
*
* @param userId 用户ID
* @return 选中角色ID列表
*/
@Override
public List<Long> selectRoleListByUserId(Long userId)
{
return roleMapper.selectRoleListByUserId(userId);
}
/**
* 通过角色ID查询角色
*
* @param roleId 角色ID
* @return 角色对象信息
*/
@Override
public SysRole selectRoleById(Long roleId)
{
return roleMapper.selectRoleById(roleId);
}
/**
* 校验角色名称是否唯一
*
* @param role 角色信息
* @return 结果
*/
@Override
public boolean checkRoleNameUnique(SysRole role)
{
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验角色权限是否唯一
*
* @param role 角色信息
* @return 结果
*/
@Override
public boolean checkRoleKeyUnique(SysRole role)
{
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验角色是否允许操作
*
* @param role 角色信息
*/
@Override
public void checkRoleAllowed(SysRole role)
{
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
{
throw new ServiceException("不允许操作超级管理员角色");
}
}
/**
* 校验角色是否有数据权限
*
* @param roleIds 角色id
*/
@Override
public void checkRoleDataScope(Long... roleIds)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
for (Long roleId : roleIds)
{
SysRole role = new SysRole();
role.setRoleId(roleId);
List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
if (StringUtils.isEmpty(roles))
{
throw new ServiceException("没有权限访问角色数据!");
}
}
}
}
/**
* 通过角色ID查询角色使用数量
*
* @param roleId 角色ID
* @return 结果
*/
@Override
public int countUserRoleByRoleId(Long roleId)
{
return userRoleMapper.countUserRoleByRoleId(roleId);
}
/**
* 新增保存角色信息
*
* @param role 角色信息
* @return 结果
*/
@Override
@Transactional
public int insertRole(SysRole role)
{
// 新增角色信息
roleMapper.insertRole(role);
return insertRoleMenu(role);
}
/**
* 修改保存角色信息
*
* @param role 角色信息
* @return 结果
*/
@Override
@Transactional
public int updateRole(SysRole role)
{
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与菜单关联
roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
return insertRoleMenu(role);
}
/**
* 修改角色状态
*
* @param role 角色信息
* @return 结果
*/
@Override
public int updateRoleStatus(SysRole role)
{
return roleMapper.updateRole(role);
}
/**
* 修改数据权限信息
*
* @param role 角色信息
* @return 结果
*/
@Override
@Transactional
public int authDataScope(SysRole role)
{
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与部门关联
roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
// 新增角色和部门信息(数据权限)
return insertRoleDept(role);
}
/**
* 新增角色菜单信息
*
* @param role 角色对象
*/
public int insertRoleMenu(SysRole role)
{
int rows = 1;
// 新增用户与角色管理
List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
for (Long menuId : role.getMenuIds())
{
SysRoleMenu rm = new SysRoleMenu();
rm.setRoleId(role.getRoleId());
rm.setMenuId(menuId);
list.add(rm);
}
if (list.size() > 0)
{
rows = roleMenuMapper.batchRoleMenu(list);
}
return rows;
}
/**
* 新增角色部门信息(数据权限)
*
* @param role 角色对象
*/
public int insertRoleDept(SysRole role)
{
int rows = 1;
// 新增角色与部门(数据权限)管理
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
for (Long deptId : role.getDeptIds())
{
SysRoleDept rd = new SysRoleDept();
rd.setRoleId(role.getRoleId());
rd.setDeptId(deptId);
list.add(rd);
}
if (list.size() > 0)
{
rows = roleDeptMapper.batchRoleDept(list);
}
return rows;
}
/**
* 通过角色ID删除角色
*
* @param roleId 角色ID
* @return 结果
*/
@Override
@Transactional
public int deleteRoleById(Long roleId)
{
// 删除角色与菜单关联
roleMenuMapper.deleteRoleMenuByRoleId(roleId);
// 删除角色与部门关联
roleDeptMapper.deleteRoleDeptByRoleId(roleId);
return roleMapper.deleteRoleById(roleId);
}
/**
* 批量删除角色信息
*
* @param roleIds 需要删除的角色ID
* @return 结果
*/
@Override
@Transactional
public int deleteRoleByIds(Long[] roleIds)
{
for (Long roleId : roleIds)
{
checkRoleAllowed(new SysRole(roleId));
checkRoleDataScope(roleId);
SysRole role = selectRoleById(roleId);
if (countUserRoleByRoleId(roleId) > 0)
{
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
}
}
// 删除角色与菜单关联
roleMenuMapper.deleteRoleMenu(roleIds);
// 删除角色与部门关联
roleDeptMapper.deleteRoleDept(roleIds);
return roleMapper.deleteRoleByIds(roleIds);
}
/**
* 取消授权用户角色
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
@Override
public int deleteAuthUser(SysUserRole userRole)
{
return userRoleMapper.deleteUserRoleInfo(userRole);
}
/**
* 批量取消授权用户角色
*
* @param roleId 角色ID
* @param userIds 需要取消授权的用户数据ID
* @return 结果
*/
@Override
public int deleteAuthUsers(Long roleId, Long[] userIds)
{
return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
}
/**
* 批量选择授权用户角色
*
* @param roleId 角色ID
* @param userIds 需要授权的用户数据ID
* @return 结果
*/
@Override
public int insertAuthUsers(Long roleId, Long[] userIds)
{
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>();
for (Long userId : userIds)
{
SysUserRole ur = new SysUserRole();
ur.setUserId(userId);
ur.setRoleId(roleId);
list.add(ur);
}
return userRoleMapper.batchUserRole(list);
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysRoleServiceImpl.java
|
Java
|
unknown
| 11,226
|
package com.zzyl.system.service.impl;
import org.springframework.stereotype.Service;
import com.zzyl.common.core.domain.model.LoginUser;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.system.domain.SysUserOnline;
import com.zzyl.system.service.ISysUserOnlineService;
/**
* 在线用户 服务层处理
*
* @author ruoyi
*/
@Service
public class SysUserOnlineServiceImpl implements ISysUserOnlineService
{
/**
* 通过登录地址查询信息
*
* @param ipaddr 登录地址
* @param user 用户信息
* @return 在线用户信息
*/
@Override
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user)
{
if (StringUtils.equals(ipaddr, user.getIpaddr()))
{
return loginUserToUserOnline(user);
}
return null;
}
/**
* 通过用户名称查询信息
*
* @param userName 用户名称
* @param user 用户信息
* @return 在线用户信息
*/
@Override
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user)
{
if (StringUtils.equals(userName, user.getUsername()))
{
return loginUserToUserOnline(user);
}
return null;
}
/**
* 通过登录地址/用户名称查询信息
*
* @param ipaddr 登录地址
* @param userName 用户名称
* @param user 用户信息
* @return 在线用户信息
*/
@Override
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user)
{
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
{
return loginUserToUserOnline(user);
}
return null;
}
/**
* 设置在线用户信息
*
* @param user 用户信息
* @return 在线用户
*/
@Override
public SysUserOnline loginUserToUserOnline(LoginUser user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser()))
{
return null;
}
SysUserOnline sysUserOnline = new SysUserOnline();
sysUserOnline.setTokenId(user.getToken());
sysUserOnline.setUserName(user.getUsername());
sysUserOnline.setIpaddr(user.getIpaddr());
sysUserOnline.setLoginLocation(user.getLoginLocation());
sysUserOnline.setBrowser(user.getBrowser());
sysUserOnline.setOs(user.getOs());
sysUserOnline.setLoginTime(user.getLoginTime());
if (StringUtils.isNotNull(user.getUser().getDept()))
{
sysUserOnline.setDeptName(user.getUser().getDept().getDeptName());
}
return sysUserOnline;
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysUserOnlineServiceImpl.java
|
Java
|
unknown
| 2,740
|
package com.zzyl.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.zzyl.common.annotation.DataScope;
import com.zzyl.common.constant.UserConstants;
import com.zzyl.common.core.domain.entity.SysRole;
import com.zzyl.common.core.domain.entity.SysUser;
import com.zzyl.common.exception.ServiceException;
import com.zzyl.common.utils.SecurityUtils;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.common.utils.bean.BeanValidators;
import com.zzyl.common.utils.spring.SpringUtils;
import com.zzyl.system.domain.SysPost;
import com.zzyl.system.domain.SysUserPost;
import com.zzyl.system.domain.SysUserRole;
import com.zzyl.system.mapper.SysPostMapper;
import com.zzyl.system.mapper.SysRoleMapper;
import com.zzyl.system.mapper.SysUserMapper;
import com.zzyl.system.mapper.SysUserPostMapper;
import com.zzyl.system.mapper.SysUserRoleMapper;
import com.zzyl.system.service.ISysConfigService;
import com.zzyl.system.service.ISysDeptService;
import com.zzyl.system.service.ISysUserService;
/**
* 用户 业务层处理
*
* @author ruoyi
*/
@Service
public class SysUserServiceImpl implements ISysUserService
{
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
@Autowired
private SysUserMapper userMapper;
@Autowired
private SysRoleMapper roleMapper;
@Autowired
private SysPostMapper postMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
@Autowired
private SysUserPostMapper userPostMapper;
@Autowired
private ISysConfigService configService;
@Autowired
private ISysDeptService deptService;
@Autowired
protected Validator validator;
/**
* 根据条件分页查询用户列表
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUserList(SysUser user)
{
return userMapper.selectUserList(user);
}
/**
* 根据条件分页查询已分配用户角色列表
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectAllocatedList(SysUser user)
{
return userMapper.selectAllocatedList(user);
}
/**
* 根据条件分页查询未分配用户角色列表
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUnallocatedList(SysUser user)
{
return userMapper.selectUnallocatedList(user);
}
/**
* 通过用户名查询用户
*
* @param userName 用户名
* @return 用户对象信息
*/
@Override
public SysUser selectUserByUserName(String userName)
{
return userMapper.selectUserByUserName(userName);
}
/**
* 通过用户ID查询用户
*
* @param userId 用户ID
* @return 用户对象信息
*/
@Override
public SysUser selectUserById(Long userId)
{
return userMapper.selectUserById(userId);
}
/**
* 查询用户所属角色组
*
* @param userName 用户名
* @return 结果
*/
@Override
public String selectUserRoleGroup(String userName)
{
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
if (CollectionUtils.isEmpty(list))
{
return StringUtils.EMPTY;
}
return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
}
/**
* 查询用户所属岗位组
*
* @param userName 用户名
* @return 结果
*/
@Override
public String selectUserPostGroup(String userName)
{
List<SysPost> list = postMapper.selectPostsByUserName(userName);
if (CollectionUtils.isEmpty(list))
{
return StringUtils.EMPTY;
}
return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
}
/**
* 校验用户名称是否唯一
*
* @param user 用户信息
* @return 结果
*/
@Override
public boolean checkUserNameUnique(SysUser user)
{
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkUserNameUnique(user.getUserName());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验手机号码是否唯一
*
* @param user 用户信息
* @return
*/
@Override
public boolean checkPhoneUnique(SysUser user)
{
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验email是否唯一
*
* @param user 用户信息
* @return
*/
@Override
public boolean checkEmailUnique(SysUser user)
{
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkEmailUnique(user.getEmail());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验用户是否允许操作
*
* @param user 用户信息
*/
@Override
public void checkUserAllowed(SysUser user)
{
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
{
throw new ServiceException("不允许操作超级管理员用户");
}
}
/**
* 校验用户是否有数据权限
*
* @param userId 用户id
*/
@Override
public void checkUserDataScope(Long userId)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
SysUser user = new SysUser();
user.setUserId(userId);
List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
if (StringUtils.isEmpty(users))
{
throw new ServiceException("没有权限访问用户数据!");
}
}
}
/**
* 新增保存用户信息
*
* @param user 用户信息
* @return 结果
*/
@Override
@Transactional
public int insertUser(SysUser user)
{
// 新增用户信息
int rows = userMapper.insertUser(user);
// 新增用户岗位关联
insertUserPost(user);
// 新增用户与角色管理
insertUserRole(user);
return rows;
}
/**
* 注册用户信息
*
* @param user 用户信息
* @return 结果
*/
@Override
public boolean registerUser(SysUser user)
{
return userMapper.insertUser(user) > 0;
}
/**
* 修改保存用户信息
*
* @param user 用户信息
* @return 结果
*/
@Override
@Transactional
public int updateUser(SysUser user)
{
Long userId = user.getUserId();
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId);
// 新增用户与角色管理
insertUserRole(user);
// 删除用户与岗位关联
userPostMapper.deleteUserPostByUserId(userId);
// 新增用户与岗位管理
insertUserPost(user);
return userMapper.updateUser(user);
}
/**
* 用户授权角色
*
* @param userId 用户ID
* @param roleIds 角色组
*/
@Override
@Transactional
public void insertUserAuth(Long userId, Long[] roleIds)
{
userRoleMapper.deleteUserRoleByUserId(userId);
insertUserRole(userId, roleIds);
}
/**
* 修改用户状态
*
* @param user 用户信息
* @return 结果
*/
@Override
public int updateUserStatus(SysUser user)
{
return userMapper.updateUser(user);
}
/**
* 修改用户基本信息
*
* @param user 用户信息
* @return 结果
*/
@Override
public int updateUserProfile(SysUser user)
{
return userMapper.updateUser(user);
}
/**
* 修改用户头像
*
* @param userName 用户名
* @param avatar 头像地址
* @return 结果
*/
@Override
public boolean updateUserAvatar(String userName, String avatar)
{
return userMapper.updateUserAvatar(userName, avatar) > 0;
}
/**
* 重置用户密码
*
* @param user 用户信息
* @return 结果
*/
@Override
public int resetPwd(SysUser user)
{
return userMapper.updateUser(user);
}
/**
* 重置用户密码
*
* @param userName 用户名
* @param password 密码
* @return 结果
*/
@Override
public int resetUserPwd(String userName, String password)
{
return userMapper.resetUserPwd(userName, password);
}
/**
* 新增用户角色信息
*
* @param user 用户对象
*/
public void insertUserRole(SysUser user)
{
this.insertUserRole(user.getUserId(), user.getRoleIds());
}
/**
* 新增用户岗位信息
*
* @param user 用户对象
*/
public void insertUserPost(SysUser user)
{
Long[] posts = user.getPostIds();
if (StringUtils.isNotEmpty(posts))
{
// 新增用户与岗位管理
List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length);
for (Long postId : posts)
{
SysUserPost up = new SysUserPost();
up.setUserId(user.getUserId());
up.setPostId(postId);
list.add(up);
}
userPostMapper.batchUserPost(list);
}
}
/**
* 新增用户角色信息
*
* @param userId 用户ID
* @param roleIds 角色组
*/
public void insertUserRole(Long userId, Long[] roleIds)
{
if (StringUtils.isNotEmpty(roleIds))
{
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
for (Long roleId : roleIds)
{
SysUserRole ur = new SysUserRole();
ur.setUserId(userId);
ur.setRoleId(roleId);
list.add(ur);
}
userRoleMapper.batchUserRole(list);
}
}
/**
* 通过用户ID删除用户
*
* @param userId 用户ID
* @return 结果
*/
@Override
@Transactional
public int deleteUserById(Long userId)
{
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId);
// 删除用户与岗位表
userPostMapper.deleteUserPostByUserId(userId);
return userMapper.deleteUserById(userId);
}
/**
* 批量删除用户信息
*
* @param userIds 需要删除的用户ID
* @return 结果
*/
@Override
@Transactional
public int deleteUserByIds(Long[] userIds)
{
for (Long userId : userIds)
{
checkUserAllowed(new SysUser(userId));
checkUserDataScope(userId);
}
// 删除用户与角色关联
userRoleMapper.deleteUserRole(userIds);
// 删除用户与岗位关联
userPostMapper.deleteUserPost(userIds);
return userMapper.deleteUserByIds(userIds);
}
/**
* 导入用户数据
*
* @param userList 用户数据列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param operName 操作用户
* @return 结果
*/
@Override
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
{
if (StringUtils.isNull(userList) || userList.size() == 0)
{
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (SysUser user : userList)
{
try
{
// 验证是否存在这个用户
SysUser u = userMapper.selectUserByUserName(user.getUserName());
if (StringUtils.isNull(u))
{
BeanValidators.validateWithException(validator, user);
deptService.checkDeptDataScope(user.getDeptId());
String password = configService.selectConfigByKey("sys.user.initPassword");
user.setPassword(SecurityUtils.encryptPassword(password));
user.setCreateBy(operName);
userMapper.insertUser(user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
}
else if (isUpdateSupport)
{
BeanValidators.validateWithException(validator, user);
checkUserAllowed(u);
checkUserDataScope(u.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
user.setUserId(u.getUserId());
user.setUpdateBy(operName);
userMapper.updateUser(user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
}
|
2201_75631765/zzyl
|
zzyl-system/src/main/java/com/zzyl/system/service/impl/SysUserServiceImpl.java
|
Java
|
unknown
| 15,498
|
FROM alpine:latest AS base
LABEL org.opencontainers.image.authors="Teemu Toivola"
LABEL org.opencontainers.image.url="https://humdi.net/vnstat/"
LABEL org.opencontainers.image.source="https://github.com/vergoh/vnstat-docker"
LABEL org.opencontainers.image.title="vnStat"
LABEL org.opencontainers.image.description="vnStat (https://humdi.net/vnstat/) in a container with image output via http"
ENV HTTP_PORT=8685
ENV HTTP_BIND=*
ENV HTTP_LOG=/dev/stdout
ENV LARGE_FONTS=0
ENV CACHE_TIME=1
ENV RATE_UNIT=1
ENV INTERFACE_ORDER=0
ENV QUERY_MODE=0
ENV DARK_MODE=0
ENV PAGE_REFRESH=0
ENV RUN_VNSTATD=1
COPY favicon.ico /var/www/localhost/htdocs/favicon.ico
COPY start.sh /
RUN true \
&& set -ex \
&& apk add --no-cache \
tzdata \
gd \
perl \
lighttpd \
sqlite-libs \
curl
FROM alpine:latest AS builder
COPY vnstat-latest.tar.gz /
RUN true \
&& set -ex \
&& apk add --no-cache \
gcc \
make \
musl-dev \
linux-headers \
gd-dev \
sqlite-dev
RUN tar zxvf vnstat-latest.tar.gz \
&& cd vnstat-*/ \
&& ./configure --prefix=/usr --sysconfdir=/etc \
&& make \
&& make install
FROM base AS runtime
COPY --from=builder /usr/bin/vnstat /usr/bin/vnstat
COPY --from=builder /usr/bin/vnstati /usr/bin/vnstati
COPY --from=builder /usr/sbin/vnstatd /usr/sbin/vnstatd
COPY --from=builder /etc/vnstat.conf /etc/vnstat.conf
COPY --from=builder vnstat-*/examples/vnstat.cgi /var/www/localhost/htdocs/index.cgi
COPY --from=builder vnstat-*/examples/vnstat-json.cgi /var/www/localhost/htdocs/json.cgi
COPY --from=builder vnstat-*/examples/vnstat-metrics.cgi /var/www/localhost/htdocs/metrics.cgi
RUN true \
&& set -ex \
&& addgroup -S vnstat \
&& adduser -S -h /var/lib/vnstat -s /sbin/nologin -g vnStat -D -H -G vnstat vnstat
VOLUME /var/lib/vnstat
EXPOSE ${HTTP_PORT}
CMD [ "/start.sh" ]
|
00fly/vnstat-docker
|
Dockerfile
|
Dockerfile
|
unknown
| 1,917
|
#!/bin/sh
docker build -t vergoh/vnstat:test .
|
00fly/vnstat-docker
|
build.sh
|
Shell
|
unknown
| 46
|
#!/bin/sh
if [ "${HTTP_PORT}" -eq 0 ] && [ "${RUN_VNSTATD}" -ne 1 ]; then
echo "Error: Invalid configuration, HTTP_PORT cannot be 0 when RUN_VNSTATD is not 1"
exit 1
fi
# configure web content
test ! -z "$SERVER_NAME" && \
sed -i -e "s/^my \$servername =.*;/my \$servername = \'${SERVER_NAME}\';/g" \
/var/www/localhost/htdocs/index.cgi
test -d "/dev/shm" && \
sed -i -e "s/^my \$tmp_dir =.*/my \$tmp_dir = \'\/dev\/shm\/vnstatcgi\';/g" \
/var/www/localhost/htdocs/index.cgi
sed -i -e "s/^my \$largefonts =.*;/my \$largefonts = \'${LARGE_FONTS}\';/g" \
-e "s/^my \$cachetime =.*/my \$cachetime = \'${CACHE_TIME}\';/g" \
-e "s/^my \$darkmode =.*/my \$darkmode = \'${DARK_MODE}\';/g" \
-e "s/^my \$pagerefresh =.*/my \$pagerefresh = \'${PAGE_REFRESH}\';/g" \
/var/www/localhost/htdocs/index.cgi
# configure vnStat
sed -i -e 's/^;RateUnit /RateUnit /g' -e "s/^RateUnit .*/RateUnit ${RATE_UNIT}/g" \
-e 's/^;Interface /Interface /g' -e "s/^Interface .*/Interface \"${INTERFACE}\"/g" \
-e 's/^;InterfaceOrder /InterfaceOrder /g' -e "s/^InterfaceOrder .*/InterfaceOrder ${INTERFACE_ORDER}/g" \
-e 's/^;QueryMode /QueryMode /g' -e "s/^QueryMode .*/QueryMode ${QUERY_MODE}/g" \
/etc/vnstat.conf
# configure and start httpd if port > 0
if [ "${HTTP_PORT}" -gt 0 ]; then
echo 'server.compat-module-load = "disable"
server.modules = ("mod_indexfile", "mod_cgi", "mod_staticfile", "mod_accesslog", "mod_rewrite")
server.username = "lighttpd"
server.groupname = "lighttpd"
server.document-root = "/var/www/localhost/htdocs"
server.pid-file = "/run/lighttpd.pid"
server.indexfiles = ("index.cgi")
url.rewrite-once = ("^/metrics" => "/metrics.cgi")
cgi.assign = (".cgi" => "/usr/bin/perl")' >/etc/lighttpd/lighttpd.conf
echo "server.port = ${HTTP_PORT}" >>/etc/lighttpd/lighttpd.conf
if [ -n "${HTTP_BIND}" ] && [ "${HTTP_BIND}" != "*" ]; then
echo "server.bind = \"${HTTP_BIND}\"" >>/etc/lighttpd/lighttpd.conf
fi
if [ "${HTTP_LOG}" = "/dev/stdout" ]; then
exec 3>&1
chmod a+rwx /dev/fd/3
echo 'accesslog.filename = "/dev/fd/3"' >>/etc/lighttpd/lighttpd.conf
echo 'server.errorlog = "/dev/fd/3"' >>/etc/lighttpd/lighttpd.conf
else
echo "accesslog.filename = \"${HTTP_LOG}\"" >>/etc/lighttpd/lighttpd.conf
echo "server.errorlog = \"${HTTP_LOG}\"" >>/etc/lighttpd/lighttpd.conf
fi
if [ "${RUN_VNSTATD}" -eq 1 ]; then
lighttpd-angel -f /etc/lighttpd/lighttpd.conf && \
echo "lighttpd started on ${HTTP_BIND:-*}:${HTTP_PORT}"
else
echo "lighttpd starting on ${HTTP_BIND:-*}:${HTTP_PORT}"
exec lighttpd -D -f /etc/lighttpd/lighttpd.conf
fi
fi
if [ -n "${EXCLUDE_PATTERN}" ]; then
if [ "${RUN_VNSTATD}" -eq 1 ]; then
echo "Interface exclude pattern: ${EXCLUDE_PATTERN}"
# if database doesn't exist, create and populate it with interfaces not matching the pattern
vnstat --dbiflist 1 >/dev/null 2>&1 || \
{ vnstatd --user vnstat --group vnstat --initdb ; vnstat --iflist ; vnstat --iflist 1 | grep -vE "${EXCLUDE_PATTERN}" | xargs -r -n 1 vnstat --add -i ; }
# if database exists, remove possible excluded interfaces
vnstat --dbiflist 1 | grep -E "${EXCLUDE_PATTERN}" | xargs -r -n 1 vnstat --remove --force -i
fi
fi
# start vnStat daemon
if [ "${RUN_VNSTATD}" -eq 1 ]; then
exec vnstatd -n -t --user vnstat --group vnstat
fi
|
00fly/vnstat-docker
|
start.sh
|
Shell
|
unknown
| 3,402
|
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
globalData: {
userInfo: null
}
})
|
2201_75373101/AITranslationWeChatMiniProgram
|
Client/miniprogram-1/app.js
|
JavaScript
|
unknown
| 364
|
// utils/config.js
module.exports = {
URL_TRANSLATE_TEXT: "http://10.30.33.34:8081/textTranslate",
URL_TRANSLATE_REALTIME: "ws://10.30.33.34:8081/realtimeTranslate",
URL_TRANSLATE_PHOTO: "http://10.30.33.34:8081/photoTranslate",
// 录音参数
RECORD_OPTION_FORMAT: "PCM",
RECORD_OPTION_SAMPLE_RATE: 44100,
RECORD_OPTION_NUMBER_OF_CHANNELS: 1,
RECORD_OPTION_ENCODE_BIT_RATE: 64000,
RECORD_OPTION_FRAME_SIZE: 2, // 2kb
// 语言
// LANGUAGE_CHINESE: 'zh',
// LANGUAGE_ENGLISH: 'en',
// LANGUAGE_JAPANESE: 'ja',
// LANGUAGE_KOREAN: 'ko',
LANGUAGE_SOURCE_LIST: ['自动', '中文', '英文', '日文', '韩文'],
LANGUAGE_SOURCE_CODE: ['auto', 'zh', 'en', 'ja', 'ko'],
LANGUAGE_TARGET_LIST: ['中文', '英文', '日文', '韩文'],
LANGUAGE_TARGET_CODE: ['zh', 'en', 'ja', 'ko'],
AUDIO_PLAY_LIST: ['开启', '关闭'],
AUDIO_VOICE_SELECT_LIST: ['女声', '男声'],
// sourceLanguageIndex
// 其他配置
};
|
2201_75373101/AITranslationWeChatMiniProgram
|
Client/miniprogram-1/pages/home/config.js
|
JavaScript
|
unknown
| 963
|
const config = require('config.js');
Page({
data: {
inputTextValue: "",
outputTextValue: "",
recordingTime: 0, // 录音时长
timer: null, // 计时器
// tempFilePath: null, // 临时录音文件路径
isRecording: false,
isRecordingName: "实时翻译",
isConnected: false,
recorderManager: null,
socketTask: null,
bgColor: "#2cc6d1",
languageSourceList: config.LANGUAGE_SOURCE_LIST,
languageSourceCode: config.LANGUAGE_SOURCE_CODE,
languageTargetList: config.LANGUAGE_TARGET_LIST,
languageTargetCode: config.LANGUAGE_TARGET_CODE,
sourceLanguageIndex: 1, // 默认选中文
targetLanguageIndex: 1, // 默认选英文
sourceCurrentLanguageName: '中文',
sourceCurrentLanguageCode: 'zh',
targetCurrentLanguageName: '英文',
targetCurrentLanguageCode: 'en',
audioPlayList: config.AUDIO_PLAY_LIST,
isPlayAudioIndex: 0,
isPlayAudioName: '开启',
audioVoiceSelectList: config.AUDIO_VOICE_SELECT_LIST,
selectVoiceIndex: 0,
selectVoiceName: '女声',
isShowSetModal: false,
isShowPhotoModal: false,
imagePath: '', // 图片路径(空表示未拍摄/选择)
status: '', // 状态提示文字
modalAnimation: {} // 新增动画对象
},
// 显示设置弹窗
showSettingModal() {
if(this.data.isRecording){
wx.showToast({ title: "请先关闭语音实时翻译", icon: "none" });
return
}
const animation = wx.createAnimation({
duration: 300,
timingFunction: 'ease-out'
})
this.animation = animation
//animation.opacity(0).scale(0.95).step()
this.setData({
isShowSetModal: true,
modalAnimation: animation.export()
})
// 执行动画
setTimeout(() => {
//animation.opacity(1).scale(1).step()
this.setData({
modalAnimation: animation.export()
})
}, 10)
},
// 隐藏设置弹窗
hideSettingModal() {
const animation = wx.createAnimation({
duration: 200,
timingFunction: 'ease-in'
})
this.animation = animation
animation.opacity(0).scale(0.95).step()
this.setData({
modalAnimation: animation.export()
})
// 延迟隐藏弹窗
setTimeout(() => {
this.setData({
isShowSetModal: false
})
}, 200)
},
// 显示拍照弹窗
showPhotoModal() {
if(this.data.isRecording){
wx.showToast({ title: "请先关闭语音实时翻译", icon: "none" });
return
}
const animation = wx.createAnimation({
duration: 300,
timingFunction: 'ease-out'
})
this.animation = animation
//animation.opacity(0).scale(0.95).step()
this.setData({
isShowPhotoModal: true,
modalAnimation: animation.export()
})
// 执行动画
setTimeout(() => {
//animation.opacity(1).scale(1).step()
this.setData({
modalAnimation: animation.export()
})
}, 10)
this.requestCameraPermission();
},
// 隐藏拍照弹窗
hidePhotoModal() {
const animation = wx.createAnimation({
duration: 200,
timingFunction: 'ease-in'
})
this.animation = animation
animation.opacity(0).scale(0.95).step()
this.setData({
modalAnimation: animation.export()
})
// 延迟隐藏弹窗
setTimeout(() => {
this.setData({
isShowPhotoModal: false
})
}, 200)
},
// 请求相机权限
requestCameraPermission() {
console.log("尝试申请相机权限");
wx.authorize({
scope: 'scope.camera',
success: () => {
console.log('已获得相机权限')
},
fail: () => {
this.setData({
status: '需要相机权限才能拍照,请在设置中开启'
})
// 引导用户打开权限设置
wx.showModal({
title: '权限不足',
content: '请允许相机权限以使用拍照功能',
success: (res) => {
if (res.confirm) {
wx.openSetting()
}
}
})
}
})
},
// 拍照(绑定到"拍照"按钮)
takePhoto() {
wx.showToast({
title: "拍照翻译请求中...",
icon: "loading",
duration: 16000 // 若需长期显示,可设为0,然后手动关闭
});
const ctx = wx.createCameraContext()
ctx.takePhoto({
quality: 'high', // 高质量
success: (res) => {
this.setData({
imagePath: res.tempImagePath, // 保存临时路径
status: '拍照成功'
})
this.uploadImage();
},
fail: (err) => {
console.error('拍照失败', err)
this.setData({
status: '拍照失败,请重试'
})
}
})
this.hidePhotoModal();
},
// 图片上传
uploadImage() {
if (!this.data.imagePath) {
wx.showToast({
title: '请先拍照或选择图片',
icon: 'none',
duration: 2000
})
return
}
this.setData({
status: '正在上传...'
})
// 读取图片并转为base64
wx.getFileSystemManager().readFile({
filePath: this.data.imagePath,
encoding: 'base64',
success: (res) => {
// 发送到服务器(替换为你的服务器地址)
wx.request({
url: config.URL_TRANSLATE_PHOTO, // 注意:开发时需开启"不校验合法域名"
method: 'POST',
header: {
'Content-Type': 'application/json'
},
data: {
image: res.data, // base64数据
sourceLanguage: this.data.sourceCurrentLanguageCode,
targetLanguage: this.data.targetCurrentLanguageCode,
isPlayAudio: this.data.isPlayAudioIndex,
audioVoice: this.data.selectVoiceIndex
},
success: (response) => {
wx.hideToast();
if (response.statusCode === 200 && response.data.success) {
this.setData({
inputTextValue: response.data.recognizeResult,
outputTextValue: response.data.translateResult
})
this.saveTextLog(response.data.recognizeResult, response.data.translateResult);
if(this.data.isPlayAudioIndex == 0){
this.audioDecode(response.data.audioDataBase64);
}
} else {
this.setData({
status: `上传失败:${response.data.message || '服务器错误'}`
})
}
},
fail: (err) => {
wx.hideToast();
console.error('上传请求失败', err)
this.setData({
status: '上传失败,请检查网络或服务器'
})
}
})
},
fail: (err) => {
wx.hideToast();
console.error('读取图片失败', err)
this.setData({
status: '读取图片失败,请重试'
})
}
})
},
// 存储当前音频上下文
innerAudioContext: null,
// 存储当前使用的音频文件路径
currentAudioPath: null,
onTextInput(e) {
this.setData({ inputTextValue: e.detail.value });
},
onSourceLangChange(e) {
const index = e.detail.value;
const Code = this.data.languageSourceCode[index];
const Name = this.data.languageSourceList[index];
this.setData({
sourceLanguageIndex: index,
sourceCurrentLanguageName: Name,
sourceCurrentLanguageCode: Code
});
},
onTargetLangChange(e) {
const index = e.detail.value;
const Code = this.data.languageTargetCode[index];
const Name = this.data.languageTargetList[index];
this.setData({
targetLanguageIndex: index,
targetCurrentLanguageName: Name,
targetCurrentLanguageCode: Code
});
},
onPlayAudioChange(e) {
const index = Number(e.detail.value);
const Name = this.data.audioPlayList[index];
this.setData({
isPlayAudioIndex: index,
isPlayAudioName: Name,
});
},
onSelectVoiceChange(e) {
const index = Number(e.detail.value);
const Name = this.data.audioVoiceSelectList[index];
this.setData({
selectVoiceIndex: index,
selectVoiceName: Name,
});
},
// 清理旧音频资源
cleanOldAudio() {
if (this.innerAudioContext) {
this.innerAudioContext.stop();
this.innerAudioContext.destroy();
this.innerAudioContext = null;
console.log("旧音频上下文已销毁");
}
if (this.currentAudioPath) {
const fs = wx.getFileSystemManager();
try {
fs.unlinkSync(this.currentAudioPath);
console.log(`旧音频文件已删除: ${this.currentAudioPath}`);
} catch (err) {
console.warn("删除旧音频文件失败:", err);
}
this.currentAudioPath = null;
}
},
audioDecode(audioData) {
this.setData({ isPlaying: false, loading: true });
// 验证音频数据
if (!audioData || typeof audioData !== 'string') {
return this.handleAudioError("音频数据缺失或格式错误");
}
// 验证 Base64 格式
if (!/^[A-Za-z0-9+/=]+$/.test(audioData)) {
return this.handleAudioError("非法 Base64 字符串");
}
// 解码 Base64 数据
const audioBytes = wx.base64ToArrayBuffer(audioData);
this.audioHandler(audioBytes);
},
audioHandler(audioBytes) {
if(this.data.isPlayAudioName == '关闭') return;
// console.log("解码");
try {
// 生成唯一临时文件名
const timestamp = new Date().getTime();
const tempFilePath = `${wx.env.USER_DATA_PATH}/temp_audio_${timestamp}.mp3`;
// 清理之前的音频上下文和临时文件
this.cleanupAudioResources();
// 保存当前音频路径
this.currentAudioPath = tempFilePath;
// 写入文件
wx.getFileSystemManager().writeFile({
filePath: tempFilePath,
data: audioBytes,
encoding: 'binary',
success: () => {
// 创建音频上下文
this.innerAudioContext = wx.createInnerAudioContext();
this.innerAudioContext.obeyMuteSwitch = false;
this.innerAudioContext.src = tempFilePath;
// 监听事件
this.setupAudioListeners();
// 准备播放
this.innerAudioContext.play();
this.setData({ isPlaying: true, loading: false });
},
fail: (err) => this.handleAudioError(`保存音频失败: ${err.errMsg}`)
});
} catch (e) {
this.handleAudioError(`音频处理异常: ${e.message}`);
}
},
// 统一错误处理
handleAudioError(message) {
console.error(message);
this.setData({ loading: false, isPlaying: false });
wx.showToast({ title: message, icon: "none" });
},
// 设置音频监听器
setupAudioListeners() {
// 移除旧监听(避免重复)
this.innerAudioContext.offCanplay();
this.innerAudioContext.offEnded();
this.innerAudioContext.offError();
// 监听音频加载完成
this.innerAudioContext.onCanplay(() => {
console.log("音频准备就绪");
this.recorderManager.pause();
if (this.data.loading) {
this.setData({ loading: false });
}
});
// 监听播放结束
this.innerAudioContext.onEnded(() => {
console.log("音频播放结束");
this.setData({ isPlaying: false });
this.recorderManager.resume();
this.scheduleFileCleanup();
});
// 监听错误
this.innerAudioContext.onError(err => {
this.handleAudioError(`播放失败: ${err.errMsg}`);
this.scheduleFileCleanup();
});
},
// 清理音频资源
cleanupAudioResources() {
// 销毁当前音频上下文
if (this.innerAudioContext) {
this.innerAudioContext.destroy();
this.innerAudioContext = null;
}
// 安排清理旧临时文件(延迟执行,避免影响当前播放)
this.scheduleFileCleanup();
},
// 安排临时文件清理
scheduleFileCleanup() {
// 使用 setTimeout 避免阻塞主线程
setTimeout(() => {
try {
const fs = wx.getFileSystemManager();
const dirPath = wx.env.USER_DATA_PATH;
// 读取目录内容
fs.readdir({
dirPath,
success: ({ files }) => {
// 过滤出旧的音频文件(保留最近3个)
const audioFiles = files
.filter(file => file.startsWith('temp_audio_') && file.endsWith('.mp3'))
.sort()
.slice(0, -3); // 保留最近3个文件
// 删除旧文件
audioFiles.forEach(file => {
fs.unlink({
filePath: `${dirPath}/${file}`,
fail: err => console.warn(`删除旧文件失败: ${file}`, err)
});
});
},
fail: err => console.warn('读取临时目录失败', err)
});
} catch (e) {
console.warn('清理临时文件异常', e);
}
}, 5000); // 5秒后执行清理
},
// 控制音频播放
togglePlayback() {
if (!this.innerAudioContext) return;
if (this.data.isPlaying) {
this.innerAudioContext.pause();
} else {
this.innerAudioContext.play();
}
this.setData({ isPlaying: !this.data.isPlaying });
},
// 文本翻译
handleTranslateText() {
if(this.data.isRecording){
wx.showToast({ title: "请先关闭语音实时翻译", icon: "none" });
return
}
const { inputTextValue: text1Value } = this.data;
if (!text1Value.trim()) {
wx.showToast({ title: "请输入要翻译的内容", icon: "none" });
return;
}
// 先清理旧资源,避免干扰
this.cleanOldAudio();
console.log(this.data.selectVoiceIndex, typeof this.data.selectVoiceIndex)
wx.showToast({
title: "文本翻译请求中...",
icon: "loading",
duration: 8000 // 设置为0,手动关闭
});
wx.request({
url: config.URL_TRANSLATE_TEXT,
method: "POST",
header: { "Content-Type": "application/json" },
data: {
text: text1Value,
from: this.data.sourceCurrentLanguageCode,
to: this.data.targetCurrentLanguageCode,
isPlayAudio: this.data.isPlayAudioIndex,
audioVoice: this.data.selectVoiceIndex,
},
// responseType: 'arraybuffer',
success: (res) => {
wx.hideToast();
// 检查响应格式
if (!res.data || typeof res.data !== 'object') {
try {
res.data = JSON.parse(res.data);
} catch (e) {
console.error("JSON 解析失败:", res.data);
wx.showToast({ title: "服务器响应格式错误", icon: "none" });
return;
}
}
// 检查翻译结果
const { translatedText, audioData, error } = res.data;
if (error || !translatedText) {
wx.showToast({ title: error || "翻译失败", icon: "none" });
return;
}
// 更新翻译文本
this.setData({
outputTextValue: translatedText || ""
});
this.saveTextLog(this.data.inputTextValue ,translatedText);
// 处理音频
if(this.data.isPlayAudioIndex == 0){
this.audioDecode(audioData);
}
},
fail: (err) => {
wx.hideToast();
console.error("请求失败:", err);
wx.showToast({ title: "网络错误", icon: "none" });
}
});
},
handleTranslatePhoto(){
console.log("被点击");
},
onLoad() {
// 初始化录音管理器
this.recorderManager = wx.getRecorderManager();
// 录音管理器事件监听
this.recorderManager.onStart(() => {
console.log('录音开始');
this.setData({
isRecording: true,
isRecordingName: '停止录音',
bgColor: 'red',
status: "录音中..."
});
});
this.recorderManager.onStop((res) => {
console.log('录音停止', res);
this.setData({
isRecording: false,
isRecordingName: '实时翻译',
bgColor: '#2cc6d1',
});
});
this.recorderManager.onPause(() =>{
this.setData({
status: "播放中..."
})
});
this.recorderManager.onResume(() =>{
this.setData({
status: "录音中..."
})
});
this.recorderManager.onFrameRecorded((res) => {
const { frameBuffer, isLastFrame } = res;
// 发送数据到服务器
if (this.data.isConnected) {
this.socketTask.send({
data: frameBuffer,
success: () => {
//console.log('数据发送成功');
},
fail: (err) => {
console.error('数据发送失败:', err);
}
});
}
});
},
handleTranslateRealTime(){
console.log(this.data.isRecording);
if(this.data.isRecording){
this.stopRecording();
return;
}
this.connectWebSocket();
},
connectWebSocket() {
if (this.data.isConnected) {
console.log('WebSocket已连接');
return;
}
// 连接WebSocket服务器
this.socketTask = wx.connectSocket({
url: config.URL_TRANSLATE_REALTIME,
success: () => {
this.setData({ isConnected: true });
console.log('WebSocket连接成功');
},
fail: (err) => {
wx.showToast({ title: "WebSocket连接失败", icon: "none" });
console.error('WebSocket连接失败:', err);
}
});
// 监听WebSocket连接打开
this.socketTask.onOpen(() => {
console.log('WebSocket连接已打开');
console.log('准备发送目标语音');
// 准备要发送的数据
const requestData = {
from: this.data.sourceCurrentLanguageCode,
to: this.data.targetCurrentLanguageCode,
audioVoice: this.data.selectVoiceIndex
};
// 通过WebSocket发送数据
this.socketTask.send({
data: JSON.stringify(requestData), // 将对象转换为JSON字符串
success: () => {
console.log('已经发送目标语音');
},
fail: (err) => {
console.error('数据发送失败:', err);
}
});
});
// 监听WebSocket消息
this.socketTask.onMessage((res) => {
console.log('收到服务器消息');
if(res.data instanceof ArrayBuffer){
this.audioHandler(res.data)
}else{
this.handleTextMessage(res.data);
}
});
// 监听WebSocket错误
this.socketTask.onError((err) => {
wx.showToast({ title: "WebSocket错误", icon: "none" });
console.error('监听到WebSocket错误:', err);
this.setData({ isConnected: false });
});
// 监听WebSocket关闭
this.socketTask.onClose(() => {
wx.showToast({ title: "WebSocket连接已关闭", icon: "none" });
console.log('WebSocket连接已关闭');
this.setData({ isConnected: false });
});
},
// 处理消息
handleTextMessage(message) {
try {
// 将JSON字符串解析为JavaScript对象
const result = JSON.parse(message);
if(result.message_type == "OK"){
this.startRecording();
return
}
// 更新页面数据
this.setData({
inputTextValue: result.transcriptionWx,
outputTextValue: result.translationWx
});
if(result.sentenceEnd){
this.saveTextLog(result.transcriptionWx, result.translationWx);
}
// 在这里可以进行UI更新或其他业务逻辑
} catch (error) {
console.error('解析消息失败:', error);
}
},
disconnectWebSocket() {
if (!this.data.isConnected) {
wx.showToast({ title: "WebSocket未连接", icon: "none" });
console.log('WebSocket未连接');
return;
}
// 停止录音
if (this.data.isRecording) {
this.recorderManager.stop();
}
// 关闭WebSocket连接
if (this.socketTask) {
this.socketTask.close({
success: () => {
console.log('WebSocket关闭成功');
},
fail: (err) => {
console.error('WebSocket关闭失败:', err);
}
});
}
},
startRecording() {
// console.log("Rec", this.data.isConnected)
if (!this.data.isConnected) {
wx.showToast({
title: '请先连接WebSocket',
icon: 'none'
});
return;
}
if (this.data.isRecording) {
console.log('正在录音中');
return;
}
const options = {
format: config.RECORD_OPTION_FORMAT,
sampleRate: config.RECORD_OPTION_SAMPLE_RATE,
numberOfChannels: config.RECORD_OPTION_NUMBER_OF_CHANNELS,
encodeBitRate: config.RECORD_OPTION_ENCODE_BIT_RATE,
frameSize: config.RECORD_OPTION_FRAME_SIZE,
duration: 600000,
// audioSource: 'communications' // 选择适合通话的音频源
};
this.recorderManager.start(options);
// this.setData({ isRecording: true, innerAudioContext });
},
stopRecording: function() {
if (!this.data.isRecording) {
console.log('未在录音');
return;
}
this.recorderManager.stop();
this.disconnectWebSocket();
},
saveTextLog(inText, outText){
const inTxt = String(inText);
const outTxt = String(outText);
// 获取当前时间
const date = new Date();
const timeStr = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
// 创建新记录
const newRecord = {
inText: inTxt,
outText: outTxt,
time: timeStr
};
// 从本地存储获取现有记录
const existingHistory = wx.getStorageSync('textRecords') || [];
// 更新历史记录列表(新记录放在最前面)
const newHistory = [newRecord, ...existingHistory];
// 保存到本地存储
wx.setStorageSync('textRecords', newHistory);
},
// 页面卸载时清理资源
onUnload() {
this.cleanOldAudio();
clearInterval(this.data.timer);
if (this.data.socketOpen) {
wx.closeSocket();
}
wx.clearStorageSync();
}
});
|
2201_75373101/AITranslationWeChatMiniProgram
|
Client/miniprogram-1/pages/home/index.js
|
JavaScript
|
unknown
| 22,513
|
// logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return {
date: util.formatTime(new Date(log)),
timeStamp: log
}
})
})
}
})
|
2201_75373101/AITranslationWeChatMiniProgram
|
Client/miniprogram-1/pages/logs/logs.js
|
JavaScript
|
unknown
| 305
|
Page({
data: {
historyList: [] // 历史记录列表
},
onLoad() {
// 可以保留做其他初始化,但不再读取textRecords
},
onUnload() {
wx.clearStorageSync();
},
onShow() {
// 每次页面显示都从本地存储获取最新历史记录
const history = wx.getStorageSync('textRecords') || [];
this.setData({
historyList: history
});
},
// 保存文本记录
saveText(Text) {
console.log("mine:保存记录", Text);
const text = String(Text)
if (!text) return;
// 获取当前时间
const date = new Date();
const timeStr = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
// 创建新记录
const newRecord = {
text: text,
time: timeStr
};
// 更新历史记录列表
const newHistory = [newRecord, ...this.data.historyList];
// 保存到本地存储
wx.setStorageSync('textRecords', newHistory);
// 更新页面数据
this.setData({
historyList: newHistory,
currentText: ''
});
// 显示保存成功提示
wx.showToast({
title: '保存成功',
icon: 'success',
duration: 1500
});
},
// 清空
clearInput() {
wx.showModal({
title: '确认清空记录',
content: '确定要确认清空历史记录吗?',
success: (res) => {
if (res.confirm) {
wx.clearStorageSync();
this.setData({
historyList: []
});
// 显示删除成功提示
wx.showToast({
title: '已删除',
icon: 'none',
duration: 1500
});
}
}
});
},
// 删除记录
deleteRecord(e) {
const index = e.currentTarget.dataset.index;
const historyList = this.data.historyList;
// 显示确认对话框
wx.showModal({
title: '确认删除',
content: '确定要删除这条记录吗?',
success: (res) => {
if (res.confirm) {
// 删除对应记录
historyList.splice(index, 1);
// 更新本地存储
wx.setStorageSync('textRecords', historyList);
// 更新页面数据
this.setData({
historyList: historyList
});
// 显示删除成功提示
wx.showToast({
title: '已删除',
icon: 'none',
duration: 1500
});
}
}
});
}
});
|
2201_75373101/AITranslationWeChatMiniProgram
|
Client/miniprogram-1/pages/mine/index.js
|
JavaScript
|
unknown
| 2,659
|
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : `0${n}`
}
module.exports = {
formatTime
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Client/miniprogram-1/utils/util.js
|
JavaScript
|
unknown
| 460
|
package ImageHandleModel
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
const (
ApiKey = "sk-0ad14d234ede4a8cad3d76e5e8136ff0"
URL = "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions" // WebSocket服务器地址
)
// 定义请求结构体
type OCRRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
}
type Message struct {
Role string `json:"role"`
Content []Content `json:"content"`
}
type Content struct {
Type string `json:"type"`
ImageURL *ImageURL `json:"image_url,omitempty"`
Text string `json:"text,omitempty"`
MinPixels int `json:"min_pixels,omitempty"`
MaxPixels int `json:"max_pixels,omitempty"`
}
type ImageURL struct {
URL string `json:"url"`
}
// 定义响应结构体
type OCRResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []struct {
Index int `json:"index"`
Message struct {
Role string `json:"role"`
Content string `json:"content"`
} `json:"message"`
} `json:"choices"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}
func qwenVlOcr(base64Image string) string {
// 构建请求数据
requestData := OCRRequest{
Model: "qwen-vl-ocr-latest",
Messages: []Message{
{
Role: "user",
Content: []Content{
{
Type: "image_url",
ImageURL: &ImageURL{URL: fmt.Sprintf("data:image/jpeg;base64,%s", base64Image)},
MinPixels: 28 * 28 * 4,
MaxPixels: 28 * 28 * 8192,
},
},
},
},
}
// 转换请求数据为JSON
jsonData, err := json.Marshal(requestData)
if err != nil {
fmt.Printf("JSON序列化错误: %v\n", err)
return ""
}
// 创建HTTP客户端
client := &http.Client{}
req, err := http.NewRequest("POST", URL, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Printf("创建请求错误: %v\n", err)
return ""
}
// 设置请求头
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", ApiKey))
// 发送请求
resp, err := client.Do(req)
if err != nil {
fmt.Printf("发送请求错误: %v\n", err)
return ""
}
defer resp.Body.Close()
// 读取响应
respBody, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Printf("读取响应错误: %v\n", err)
return ""
}
// 检查HTTP状态码
if resp.StatusCode != http.StatusOK {
fmt.Printf("请求失败,状态码: %d, 响应: %s\n", resp.StatusCode, string(respBody))
return ""
}
// 解析响应
var ocrResp OCRResponse
err = json.Unmarshal(respBody, &ocrResp)
if err != nil {
fmt.Printf("解析响应错误: %v, 原始响应: %s\n", err, string(respBody))
return ""
}
// 输出结果
if len(ocrResp.Choices) > 0 {
return ocrResp.Choices[0].Message.Content
} else {
fmt.Println("未获取到识别结果")
}
return ""
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/ImageHandleModel/OCR.go
|
Go
|
unknown
| 3,047
|
package ImageHandleModel
import (
"encoding/base64"
"encoding/json"
"io/ioutil"
"log"
"myproject/textTranslateModel"
"myproject/ttsModel"
"net/http"
)
// 定义接收的JSON结构
type ImageRequest struct {
Image string `json:"image"` // Base64编码的图片数据
SourceLanguage string `json:"sourceLanguage"`
TargetLanguage string `json:"targetLanguage"`
IsPlayAudioIndex int `json:"isPlayAudio"`
AudioVoiceIndex int `json:"audioVoice"`
}
// 定义响应的JSON结构
type Response struct {
Success bool `json:"success"`
RecognizeResult string `json:"recognizeResult"`
TranslateResult string `json:"translateResult"`
AudioDataBase64 string `json:"audioDataBase64"`
}
func PhotoTranslateHandler(w http.ResponseWriter, r *http.Request) {
log.Println("收到拍照翻译请求")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
w.Header().Set("Content-Type", "application/json")
// 只允许POST方法
if r.Method != http.MethodPost {
resp := Response{Success: false, RecognizeResult: "只支持POST方法"}
err := json.NewEncoder(w).Encode(resp)
if err != nil {
return
}
return
}
// 读取请求体
body, err := ioutil.ReadAll(r.Body)
if err != nil {
resp := Response{Success: false, RecognizeResult: "读取请求失败"}
json.NewEncoder(w).Encode(resp)
log.Printf("读取请求失败: %v", err)
return
}
defer r.Body.Close()
// 解析JSON
var req ImageRequest
err = json.Unmarshal(body, &req)
if err != nil {
resp := Response{Success: false, RecognizeResult: "解析请求数据失败"}
json.NewEncoder(w).Encode(resp)
log.Printf("解析请求数据失败: %v", err)
return
}
// 检查图片数据
if req.Image == "" {
resp := Response{Success: false, RecognizeResult: "图片数据不能为空"}
json.NewEncoder(w).Encode(resp)
return
}
// 创建保存图片的目录
//uploadDir := "uploads"
//err = os.MkdirAll(uploadDir, 0755)
//if err != nil {
// resp := Response{Success: false, Message: "创建目录失败"}
// json.NewEncoder(w).Encode(resp)
// log.Printf("创建目录失败: %v", err)
// return
//}
//// 生成文件名(如果未提供)
//filename := req.Filename
//if filename == "" {
// timestamp := time.Now().UnixNano()
// filename = fmt.Sprintf("image_%d.jpg", timestamp)
//}
// 解码Base64数据
//imageData, err := base64.StdEncoding.DecodeString(req.Image)
//if err != nil {
// resp := Response{Success: false, Message: "解码图片数据失败"}
// json.NewEncoder(w).Encode(resp)
// log.Printf("解码图片数据失败: %v", err)
// return
//}gap: 16px;
recognizeResult := qwenVlOcr(req.Image)
translateResult := textTranslateModel.Qwen_mt_plus(recognizeResult, req.SourceLanguage, req.TargetLanguage)
AudioData := ""
if req.IsPlayAudioIndex == 0 {
audioData := ttsModel.SpeechSynthesis(translateResult, req.TargetLanguage, req.AudioVoiceIndex)
AudioData = base64.StdEncoding.EncodeToString(audioData)
}
//// 保存图片到文件
//filePath := filepath.Join(uploadDir, filename)
//err = ioutil.WriteFile(filePath, imageData, 0644)
//if err != nil {
// resp := Response{Success: false, Message: "保存图片失败"}
// json.NewEncoder(w).Encode(resp)
// log.Printf("保存图片失败: %v", err)
// return
//}
// 返回成功响应
resp := Response{
Success: true,
RecognizeResult: recognizeResult,
TranslateResult: translateResult,
AudioDataBase64: AudioData,
}
err = json.NewEncoder(w).Encode(resp)
if err != nil {
return
}
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/ImageHandleModel/handleTranslatePhoto.go
|
Go
|
unknown
| 3,749
|
package Server
import (
"encoding/json"
"fmt"
"log"
"myproject/ImageHandleModel"
"myproject/asrModel"
"myproject/operateDB"
"myproject/textTranslateModel"
"net/http"
"time"
)
type registerRequest struct {
UserName string `json:"name"`
UserPassword string `json:"password"`
}
type loginRequest struct {
UserName string `json:"name"`
UserPassword string `json:"password"`
}
// 实时语音翻译
func realtimeTranslateHandler(w http.ResponseWriter, r *http.Request) {
asrModel.RealtimeTranslateHandler(w, r)
}
// 文本翻译
func textTranslateHandler(w http.ResponseWriter, r *http.Request) {
textTranslateModel.TextTranslateHandler(w, r)
}
// 拍照翻译
func photoTranslateHandler(w http.ResponseWriter, r *http.Request) {
ImageHandleModel.PhotoTranslateHandler(w, r)
}
func registerHandler(w http.ResponseWriter, r *http.Request) {
log.Println("收到注册请求")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
var req registerRequest
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
http.Error(w, "解析请求体失败: "+err.Error(), http.StatusBadRequest)
return
}
user := operateDB.User{
Username: req.UserName,
Userpassword: req.UserPassword,
Status: 1,
IsVip: 1,
RegisterDate: time.Now(),
LoginDate: time.Now(),
OfflineDate: time.Now(),
UseNum: 0,
TextTranslateNum: 0,
RealtimeTranslateNum: 0,
RealtimeTranslateTimes: 100,
TextTranslateTimes: 100,
}
lastInsertID, err := operateDB.InsertUser(user)
if err != nil {
log.Println(err)
}
fmt.Println(lastInsertID)
_, err = w.Write([]byte("OK"))
if err != nil {
return
}
return
}
func loginHandler(w http.ResponseWriter, r *http.Request) {
log.Println("收到登录请求")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
var req registerRequest
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
http.Error(w, "解析请求体失败: "+err.Error(), http.StatusBadRequest)
return
}
}
func InitMyServer() {
// 注册路由
http.HandleFunc("/textTranslate", textTranslateHandler)
http.HandleFunc("/realtimeTranslate", realtimeTranslateHandler)
http.HandleFunc("/photoTranslate", photoTranslateHandler)
http.HandleFunc("/register", registerHandler)
http.HandleFunc("/login", loginHandler)
// 启动服务器
log.Println("服务器启动在 :localhost:8081")
log.Fatal(http.ListenAndServe(":8081", nil))
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/Server/Server.go
|
Go
|
unknown
| 2,919
|
package asrModel
import (
"encoding/json"
"fmt"
"io"
"log"
"myproject/config"
"myproject/ttsModel"
"net/http"
"os"
"time"
"github.com/google/uuid"
"github.com/gordonklaus/portaudio"
"github.com/gorilla/websocket"
)
const (
wsURL = "wss://dashscope.aliyuncs.com/api-ws/v1/inference/" // WebSocket服务器地址
audioFile = "asr_example.wav" // 替换为您的音频文件路径
sampleRate = 44100
frameSize = 2048
recordTime = 20 * time.Second // 录制时间,可根据需要调
)
var dialer = websocket.DefaultDialer
// var voiceIndex int = 0
func StartGummy(connWx *websocket.Conn, sourceLanguage string, targetLanguage string, selectVoiceIndex int) {
// voiceIndex = selectVoiceIndex
connGummy, err := ConnectWebSocket(config.AppConfig.Gummy.ApiKey)
if err != nil {
log.Fatal("连接WebSocket失败:", err)
}
defer CloseConnection(connGummy)
// 启动一个goroutine来接收结果
taskStarted := make(chan bool)
taskDone := make(chan bool)
StartResultReceiver(connGummy, taskStarted, taskDone, connWx, selectVoiceIndex)
// 发送run-task指令
taskID, err := SendRunTaskCmd(connGummy, sourceLanguage, targetLanguage)
if err != nil {
log.Fatal("发送run-task指令失败:", err)
}
log.Println("发送run-task指令成功", taskID)
// 等待task-started事件
WaitForTaskStarted(taskStarted)
for {
messageType, message, err := connWx.ReadMessage()
if err != nil {
log.Println("客户端断开连接:", err)
break
}
//fmt.Println(message)
// 忽略非二进制消息
if messageType != websocket.BinaryMessage {
continue
}
// fmt.Println("向大模型发送数据")
if err := connGummy.WriteMessage(websocket.BinaryMessage, message); err != nil {
log.Printf("转发失败")
break
}
}
// 发送finish-task指令
if err := SendFinishTaskCmd(connGummy, taskID); err != nil {
log.Fatal("发送finish-task指令失败:", err)
}
// 等待任务完成或失败
<-taskDone
}
func Gummy() {
// 若没有将API Key配置到环境变量,可将下行替换为:apiKey := "your_api_key"。不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
//apiKey := "sk-0ad14d234ede4a8cad3d76e5e8136ff0"
err := portaudio.Initialize()
if err != nil {
log.Fatal("初始化PortAudio失败:", err)
}
defer portaudio.Terminate()
// 连接WebSocket服务
conn, err := ConnectWebSocket(config.AppConfig.Gummy.ApiKey)
if err != nil {
log.Fatal("连接WebSocket失败:", err)
}
defer CloseConnection(conn)
// 启动一个goroutine来接收结果
taskStarted := make(chan bool)
taskDone := make(chan bool)
StartResultReceiver(conn, taskStarted, taskDone, conn, 0)
// 发送run-task指令
taskID, err := SendRunTaskCmd(conn, "zh", "en")
if err != nil {
log.Fatal("发送run-task指令失败:", err)
}
// 等待task-started事件
WaitForTaskStarted(taskStarted)
// 发送待识别音频文件流
//if err := sendAudioData(conn); err != nil {
// log.Fatal("发送音频失败:", err)
//}
if err := recordAndSendAudio(conn); err != nil {
log.Fatal("发送音频失败:", err)
}
// 发送finish-task指令
if err := SendFinishTaskCmd(conn, taskID); err != nil {
log.Fatal("发送finish-task指令失败:", err)
}
// 等待任务完成或失败
<-taskDone
}
// 定义结构体来表示JSON数据
type Header struct {
Action string `json:"action"`
TaskID string `json:"task_id"`
Streaming string `json:"streaming"`
Event string `json:"event"`
ErrorCode string `json:"error_code,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
Attributes map[string]interface{} `json:"attributes"`
}
type Output struct {
Translations []Translation `json:"translations"`
Transcription Transcription `json:"transcription"`
}
type Translation struct {
SentenceID int `json:"sentence_id"`
BeginTime int64 `json:"begin_time"`
EndTime int64 `json:"end_time"`
Text string `json:"text"`
Lang string `json:"lang"`
PreEndFailed bool `json:"pre_end_failed"`
Words []Word `json:"words"`
SentenceEnd bool `json:"sentence_end"`
}
type Transcription struct {
SentenceID int `json:"sentence_id"`
BeginTime int64 `json:"begin_time"`
EndTime int64 `json:"end_time"`
Text string `json:"text"`
Words []Word `json:"words"`
SentenceEnd bool `json:"sentence_end"`
}
type Word struct {
BeginTime int64 `json:"begin_time"`
EndTime int64 `json:"end_time"`
Text string `json:"text"`
Punctuation string `json:"punctuation"`
Fixed bool `json:"fixed"`
SpeakerID *int `json:"speaker_id"`
}
type Payload struct {
TaskGroup string `json:"task_group"`
Task string `json:"task"`
Function string `json:"function"`
Model string `json:"model"`
Parameters Params `json:"parameters"`
Input Input `json:"input"`
Output *Output `json:"output,omitempty"`
}
type Params struct {
Format string `json:"format"`
SampleRate int `json:"sample_rate"`
VocabularyID string `json:"vocabulary_id,omitempty"`
SourceLanguage string `json:"source_language,omitempty"`
TranslationTargetLanguages []string `json:"translation_target_languages,omitempty"`
TranscriptionEnabled bool `json:"transcription_enabled,omitempty"`
TranslationEnabled bool `json:"translation_enabled,omitempty"`
}
type Input struct {
}
type Event struct {
Header Header `json:"header"`
Payload Payload `json:"payload"`
}
// 连接WebSocket服务
func ConnectWebSocket(apiKey string) (*websocket.Conn, error) {
header := make(http.Header)
header.Add("X-DashScope-DataInspection", "enable")
header.Add("Authorization", fmt.Sprintf("bearer %s", apiKey))
conn, _, err := dialer.Dial(wsURL, header)
return conn, err
}
// 启动一个goroutine异步接收WebSocket消息
func StartResultReceiver(connGummy *websocket.Conn, taskStarted chan<- bool, taskDone chan<- bool, connWx *websocket.Conn, selectVoiceIndex int) {
go func() {
for {
_, message, err := connGummy.ReadMessage()
if err != nil {
log.Println("解析服务器消息失败:", err)
return
}
var event Event
err = json.Unmarshal(message, &event)
if err != nil {
log.Println("解析事件失败:", err)
continue
}
if handleEvent(connGummy, event, taskStarted, taskDone, connWx, selectVoiceIndex) {
return
}
}
}()
}
// 发送run-task指令
func SendRunTaskCmd(conn *websocket.Conn, languageSource string, languageTarget string) (string, error) {
runTaskCmd, taskID, err := generateRunTaskCmd(languageSource, languageTarget)
if err != nil {
return "", err
}
err = conn.WriteMessage(websocket.TextMessage, []byte(runTaskCmd))
return taskID, err
}
// 生成run-task指令
func generateRunTaskCmd(languageSource string, languageTarget string) (string, string, error) {
taskID := uuid.New().String()
runTaskCmd := Event{
Header: Header{
Action: "run-task",
TaskID: taskID,
Streaming: "duplex",
},
Payload: Payload{
TaskGroup: "audio",
Task: "asr",
Function: "recognition",
Model: "gummy-realtime-v1",
Parameters: Params{
Format: "pcm",
SampleRate: 44100,
TranscriptionEnabled: true,
TranslationEnabled: true,
SourceLanguage: languageSource,
TranslationTargetLanguages: []string{languageTarget},
},
Input: Input{},
},
}
runTaskCmdJSON, err := json.Marshal(runTaskCmd)
return string(runTaskCmdJSON), taskID, err
}
// 等待task-started事件
func WaitForTaskStarted(taskStarted chan bool) {
select {
case <-taskStarted:
// fmt.Println("任务开启成功")
log.Println("收到task-started指令")
case <-time.After(10 * time.Second):
log.Fatal("等待task-started超时,任务开启失败")
}
}
// 发送音频数据
func sendAudioData(conn *websocket.Conn) error {
file, err := os.Open(audioFile)
if err != nil {
return err
}
defer file.Close()
buf := make([]byte, 1024) // 假设100ms的音频数据大约为1024字节
for {
n, err := file.Read(buf)
if n == 0 {
break
}
if err != nil && err != io.EOF {
return err
}
err = conn.WriteMessage(websocket.BinaryMessage, buf[:n])
if err != nil {
return err
}
time.Sleep(100 * time.Millisecond)
}
return nil
}
func recordAndSendAudio(conn *websocket.Conn) error {
input := make([]int16, frameSize)
stream, err := portaudio.OpenDefaultStream(1, 0, float64(sampleRate), frameSize, &input)
if err != nil {
return err
}
defer stream.Close()
err = stream.Start()
if err != nil {
return err
}
defer stream.Stop()
// 预分配字节缓冲区,避免重复分配内存
buf := make([]byte, len(input)*2)
endTime := time.Now().Add(recordTime)
for time.Now().Before(endTime) {
// 读取音频数据
//fmt.Println("................................")
if err := stream.Read(); err != nil {
return err
}
// 转换为字节切片
for i, v := range input {
buf[i*2] = byte(v)
buf[i*2+1] = byte(v >> 8)
}
//fmt.Println(buf)
// 发送数据
if err := conn.WriteMessage(websocket.BinaryMessage, buf); err != nil {
return err
}
//time.Sleep(100 * time.Millisecond)
}
return nil
}
// 发送finish-task指令
func SendFinishTaskCmd(conn *websocket.Conn, taskID string) error {
finishTaskCmd, err := generateFinishTaskCmd(taskID)
if err != nil {
return err
}
err = conn.WriteMessage(websocket.TextMessage, []byte(finishTaskCmd))
return err
}
// 生成finish-task指令
func generateFinishTaskCmd(taskID string) (string, error) {
finishTaskCmd := Event{
Header: Header{
Action: "finish-task",
TaskID: taskID,
Streaming: "duplex",
},
Payload: Payload{
Input: Input{},
},
}
finishTaskCmdJSON, err := json.Marshal(finishTaskCmd)
return string(finishTaskCmdJSON), err
}
type resultTextWx struct {
MessageType string `json:"message_type"`
TranscriptionWx string `json:"transcriptionWx"`
TranslationWx string `json:"translationWx"`
SentenceEnd bool `json:"sentenceEnd"`
}
type resultAudioWx struct {
// MessageType int `json:"message_type"`
AudioData []byte `json:"audio_data"`
}
// 处理事件
func handleEvent(connGummy *websocket.Conn, event Event, taskStarted chan<- bool, taskDone chan<- bool, connWx *websocket.Conn, voiceIndex int) bool {
switch event.Header.Event {
case "task-started":
// fmt.Println("收到task-started事件")
taskStarted <- true
case "result-generated":
// fmt.Println("服务器返回结果:")
if event.Payload.Output != nil {
if len(event.Payload.Output.Translations) == 0 {
return false
}
//fmt.Println(event.Payload.Output.Transcription.Text)
//fmt.Println(event.Payload.Output.Translations[0].Text)
// return false
resTextWx := resultTextWx{
MessageType: "translation",
TranscriptionWx: event.Payload.Output.Transcription.Text,
TranslationWx: event.Payload.Output.Translations[0].Text,
SentenceEnd: event.Payload.Output.Translations[0].SentenceEnd,
}
// return false
resWxJSON, err := json.Marshal(resTextWx)
if err != nil {
log.Printf("JSON序列化失败: %v", err)
return false
}
// return false
err = connWx.WriteMessage(websocket.TextMessage, resWxJSON)
if err != nil {
log.Println()
return false
}
if event.Payload.Output.Translations[0].SentenceEnd {
audioData := ttsModel.SpeechSynthesis(resTextWx.TranslationWx, event.Payload.Output.Translations[0].Lang, voiceIndex)
//resAudioWx := resultAudioWx{
// // MessageType: 2,
// AudioData: audioData,
//}
//resAudioWxJSON, err := json.Marshal(resAudioWx)
//if err != nil {
// log.Printf("JSON序列化失败: %v", err)
// return false
//}
// AudioData := base64.StdEncoding.EncodeToString(audioData)
err = connWx.WriteMessage(websocket.BinaryMessage, audioData)
if err != nil {
log.Println()
return false
}
}
// return false
// fmt.Println("已发送")
//if event.Payload.Output.Translations[0].SentenceEnd {
// audioData := ttsModel.SpeechSynthesis(resTextWx.TranslationWx, "en-US-JennyNeural")
// resAudioWx := resultAudioWx{
// MessageType: "audio",
// AudioData: audioData,
// }
// resAudioJSON, err := json.Marshal(resAudioWx)
// if err != nil {
// log.Printf("JSON序列化失败: %v", err)
// return false
// }
//
// // 发送二进制消息
// err = connWx.WriteMessage(websocket.BinaryMessage, resAudioJSON)
// if err != nil {
// log.Printf("WebSocket发送失败: %v", err)
// return false
// }
//
// log.Println("音频数据已发送")
//
//}
// 解析 Translations 和 Transcription
//for _, translation := range event.Payload.Output.Translations {
// fmt.Printf(" 翻译结果 - Sentence ID:%d, Text:%s\n", translation.SentenceID, translation.Text)
// for _, word := range translation.Words {
// fmt.Printf(" Word - Begin Time:%d, End Time:%d, Text:%s\n", word.BeginTime, word.EndTime, word.Text)
// }
//}
//
//transcription := event.Payload.Output.Transcription
//fmt.Printf(" 识别结果 - Sentence ID:%d, Text:%s\n", transcription.SentenceID, transcription.Text)
//for _, word := range transcription.Words {
// fmt.Printf(" Word - Begin Time:%d, End Time:%d, Text:%s\n", word.BeginTime, word.EndTime, word.Text)
//}
return false
}
case "task-finished":
fmt.Println("任务完成")
taskDone <- true
return true
case "task-failed":
handleTaskFailed(event, connGummy)
taskDone <- true
return true
default:
log.Printf("预料之外的事件:%v", event)
}
return false
}
// 处理任务失败事件
func handleTaskFailed(event Event, conn *websocket.Conn) {
if event.Header.ErrorMessage != "" {
log.Fatalf("任务失败:%s", event.Header.ErrorMessage)
} else {
log.Fatal("未知原因导致任务失败")
}
}
// 关闭连接
func CloseConnection(conn *websocket.Conn) {
if conn != nil {
conn.Close()
}
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/asrModel/Gummy.go
|
Go
|
unknown
| 14,355
|
package asrModel
import (
"encoding/json"
"github.com/gorilla/websocket"
"log"
"net/http"
)
type TranslationRequest struct {
From string `json:"from"`
To string `json:"to"`
AudioVoiceIndex int `json:"audioVoice"`
}
type resultWx struct {
MessageType string `json:"message_type"`
}
// 升级为webSocket
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true // 允许所有来源
},
}
func RealtimeTranslateHandler(w http.ResponseWriter, r *http.Request) {
log.Println("收到实时翻译请求")
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
log.Println("WebSocket升级失败:", err)
return
}
defer func(conn *websocket.Conn) {
err := conn.Close()
if err != nil {
}
}(conn)
_, message, err := conn.ReadMessage()
if err != nil {
log.Println("读取消息失败:", err)
}
// 解析JSON数据
var request TranslationRequest
if err := json.Unmarshal(message, &request); err != nil {
log.Println("解析JSON失败:", err)
}
sourceLanguage := request.From
targetLanguage := request.To
// isPlayAudioIndex := request.AudioVoiceIndex
voiceIndex := request.AudioVoiceIndex
//fmt.Println(sourceLanguage)
//fmt.Println(targetLanguage)
resWx := resultWx{
MessageType: "OK",
}
resWxJSON, err := json.Marshal(resWx)
if err != nil {
log.Printf("JSON序列化失败: %v", err)
return
}
err = conn.WriteMessage(websocket.TextMessage, resWxJSON)
if err != nil {
log.Println()
return
}
StartGummy(conn, sourceLanguage, targetLanguage, voiceIndex)
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/asrModel/realtimeTranslate.go
|
Go
|
unknown
| 1,580
|
package config
import (
"io/ioutil"
"log"
"gopkg.in/yaml.v2"
)
type Config struct {
Database struct {
Username string `yaml:"username"`
Password string `yaml:"password"`
DBName string `yaml:"dbname"`
Addr string `yaml:"addr"`
} `yaml:"database"`
AliyunTranslate struct {
KeyID string `yaml:"key_id"`
KeySecret string `yaml:"key_secret"`
} `yaml:"aliyun_translate"`
Gummy struct {
ApiKey string `yaml:"api_key"`
} `yaml:"gummy"`
}
var AppConfig Config
func LoadConfig(path string) {
data, err := ioutil.ReadFile(path)
if err != nil {
log.Fatalf("读取配置文件失败: %v", err)
}
err = yaml.Unmarshal(data, &AppConfig)
if err != nil {
log.Fatalf("解析配置文件失败: %v", err)
}
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/config/config.go
|
Go
|
unknown
| 738
|
package main
import (
"myproject/Server"
"myproject/config"
)
func main() {
config.LoadConfig("config.yaml")
Server.InitMyServer()
//ImageHandleModel.Test()
// asrModel.Gummy()
// operateDB.InitDB()
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/main.go
|
Go
|
unknown
| 210
|
package operateDB
import (
"database/sql"
"fmt"
"log"
"time"
"myproject/config"
_ "github.com/go-sql-driver/mysql" // 导入MySQL驱动
)
var db *sql.DB
var err error
func InitDB() {
username := config.AppConfig.Database.Username
password := config.AppConfig.Database.Password
dbName := config.AppConfig.Database.DBName
addr := config.AppConfig.Database.Addr
// 构建DSN (数据源名称)
dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True",
username, password, addr, dbName)
// 打开数据库连接
db, err = sql.Open("mysql", dsn)
if err != nil {
log.Fatalf("无法打开数据库连接: %v", err)
}
defer func(db *sql.DB) {
err := db.Close()
if err != nil {
log.Println(err)
}
}(db) // 程序退出时关闭连接
// 验证连接是否成功
if err := db.Ping(); err != nil {
log.Fatalf("无法连接到数据库: %v", err)
}
fmt.Println("成功连接到本地数据库!")
Register()
queryDB()
}
func queryDB() {
// 只查询需要的字段(避免*带来的字段顺序问题)
rows, err := db.Query("select id, username, status from users")
if err != nil {
log.Fatalf("查询失败: %v", err)
}
defer rows.Close() // 确保关闭结果集
// 循环读取每一行
for rows.Next() {
// 定义变量接收字段值(根据查询的字段顺序)
var id int
var username string
var status sql.NullInt32 // 用sql.Null类型处理可能为NULL的字段
// 扫描数据到变量
err := rows.Scan(&id, &username, &status)
if err != nil {
log.Printf("解析失败: %v", err)
continue
}
// 处理NULL值(status可能为NULL)
statusStr := "未设置"
if status.Valid {
statusStr = fmt.Sprintf("%d", status.Int32)
}
// 打印结果
fmt.Printf("ID: %d, 用户名: %s, 状态: %s\n", id, username, statusStr)
}
// 检查遍历过程中的错误
if err := rows.Err(); err != nil {
log.Fatalf("遍历出错: %v", err)
}
}
type User struct {
Username string
Userpassword string
Status uint8 // 指针类型支持NULL值
Online uint8
IsVip uint8
RegisterDate time.Time
LoginDate time.Time
OfflineDate time.Time
UseNum int
TextTranslateNum int
RealtimeTranslateNum int
RealtimeTranslateTimes int
TextTranslateTimes int
}
// InsertUser 向users表插入一条用户数据
func InsertUser(user User) (int64, error) {
// 构建插入SQL,id为自增字段不需要手动插入
sqlStr := `INSERT INTO users (
username, userpassword, status, online, isVip,
register_date, login_date, offline_date,
use_num, textTranslate_num, realtimeTranslate_num,
realtimeTranslateTimes, textTranslateTimes
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
// 执行插入操作
result, err := db.Exec(sqlStr,
user.Username,
user.Userpassword,
user.Status,
user.Online,
user.IsVip,
user.RegisterDate,
user.LoginDate,
user.OfflineDate,
user.UseNum,
user.TextTranslateNum,
user.RealtimeTranslateNum,
user.RealtimeTranslateTimes,
user.TextTranslateTimes,
)
if err != nil {
return 0, fmt.Errorf("插入数据失败: %v", err)
}
// 获取插入的自增ID
lastInsertID, err := result.LastInsertId()
if err != nil {
return 0, fmt.Errorf("获取插入ID失败: %v", err)
}
return lastInsertID, nil
}
func Register() {
user := User{
Username: "test",
Userpassword: "test",
Status: 0,
IsVip: 1,
RegisterDate: time.Now(),
LoginDate: time.Now(),
OfflineDate: time.Now(),
UseNum: 0,
TextTranslateNum: 0,
RealtimeTranslateNum: 0,
RealtimeTranslateTimes: 100,
TextTranslateTimes: 100,
}
i, err := InsertUser(user)
if err != nil {
}
fmt.Println(i)
fmt.Println("插入完成")
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/operateDB/operateDB.go
|
Go
|
unknown
| 3,925
|
package textTranslateModel
import (
"encoding/base64"
"encoding/json"
"fmt"
"log"
"myproject/ttsModel"
"net/http"
)
type TranslateRequest struct {
Text string `json:"text"`
From string `json:"from"`
To string `json:"to"`
IsPlayAudioIndex int `json:"isPlayAudio"`
AudioVoiceIndex int `json:"audioVoice"`
}
type TranslateResponse struct {
TranslatedText string `json:"translatedText"`
AudioData string `json:"audioData"` // 改为 Base64 字符串
Error string `json:"error,omitempty"`
}
func TextTranslateHandler(w http.ResponseWriter, r *http.Request) {
log.Println("收到文本翻译请求")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
// fmt.Println(r.Header["Content-Type"])
// fmt.Println(r.Body)
var req TranslateRequest
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
http.Error(w, "解析请求体失败: "+err.Error(), http.StatusBadRequest)
return
}
languageSource := req.From
languageTarget := req.To
selectVoiceIndex := req.AudioVoiceIndex
IsPlayAudioIndex := req.IsPlayAudioIndex
fmt.Println(selectVoiceIndex)
var res TranslateResponse
w.Header().Set("Content-Type", "application/json")
res.TranslatedText = Qwen_mt_plus(req.Text, languageSource, languageTarget)
res.AudioData = ""
if IsPlayAudioIndex == 0 {
audioData := ttsModel.SpeechSynthesis(res.TranslatedText, languageTarget, selectVoiceIndex)
res.AudioData = base64.StdEncoding.EncodeToString(audioData)
}
w.Header().Set("Content-Type", "application/json")
err = json.NewEncoder(w).Encode(res)
if err != nil {
return
}
log.Println("返回翻译结果")
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/textTranslateModel/textTranslate.go
|
Go
|
unknown
| 1,866
|
package textTranslateModel
import (
"bytes"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"log"
"myproject/config"
"net/http"
"net/url"
"sort"
"strings"
"time"
)
// 配置信息
const (
requestURL = "https://mt.cn-hangzhou.aliyuncs.com/"
// SourceLanguage = "en" // 源语言
// TargetLanguage = "zh" // 目标语言
FormatType = "text" // 文本格式
Scene = "general" // 翻译场景
)
// 需要翻译的文本(全局变量)
// var SourceText = "Hello, this is a test translation using Qwen-MT API."
func Qwen_mt_plus(SourceText string, SourceLanguage string, TargetLanguage string) string {
// 生成时间戳
log.Println("text:", SourceText, "from", SourceLanguage, "to", TargetLanguage)
timestamp := time.Now().UTC().Format("2006-01-02T15:04:05Z")
// 构建公共参数
params := map[string]string{
"Format": "JSON",
"Version": "2018-10-12",
"SignatureMethod": "HMAC-SHA1",
"SignatureVersion": "1.0",
"AccessKeyId": config.AppConfig.AliyunTranslate.KeyID,
"Timestamp": timestamp,
"SignatureNonce": fmt.Sprintf("%d", time.Now().UnixNano()),
"Action": "TranslateGeneral",
}
// 添加业务参数
params["FormatType"] = FormatType
params["SourceLanguage"] = SourceLanguage
params["TargetLanguage"] = TargetLanguage
params["SourceText"] = SourceText
params["Scene"] = Scene
// 生成签名并添加到参数中
params["Signature"] = generateSignature1(params, config.AppConfig.AliyunTranslate.KeySecret)
// 发送HTTP请求
resp, err := sendRequest1(params)
if err != nil {
fmt.Printf("请求失败: %v\n", err)
return "fail"
}
log.Println("生成翻译结果:", resp)
// 输出翻译结果
//fmt.Println("翻译结果:")
//fmt.Println(resp)
return resp
}
// 生成API签名
func generateSignature1(params map[string]string, secret string) string {
// 1. 按字典序排序参数名
keys := make([]string, 0, len(params))
for k := range params {
keys = append(keys, k)
}
sort.Strings(keys)
// 2. 构建规范化请求字符串
var paramStrs []string
for _, k := range keys {
// 使用阿里云要求的编码方式
encodedKey := encodeParameter1(k)
encodedValue := encodeParameter1(params[k])
paramStrs = append(paramStrs, fmt.Sprintf("%s=%s", encodedKey, encodedValue))
}
canonicalizedQueryString := strings.Join(paramStrs, "&")
// 3. 构建字符串ToSign
stringToSign := fmt.Sprintf("POST&%%2F&%s", encodeParameter1(canonicalizedQueryString))
// 4. 计算HMAC-SHA1签名
secretKey := secret + "&"
h := hmac.New(sha1.New, []byte(secretKey))
h.Write([]byte(stringToSign))
signatureBytes := h.Sum(nil)
// 5. Base64编码
return base64.StdEncoding.EncodeToString(signatureBytes)
}
// 阿里云要求的特殊编码函数
func encodeParameter1(s string) string {
// 使用RFC3986标准进行编码
result := url.QueryEscape(s)
// 替换特殊字符为阿里云要求的格式
result = strings.ReplaceAll(result, "+", "%20")
result = strings.ReplaceAll(result, "*", "%2A")
result = strings.ReplaceAll(result, "%7E", "~")
return result
}
// 发送HTTP请求
func sendRequest1(params map[string]string) (string, error) {
// 构建请求URL和表单数据
//requestURL := "https://mt.cn-hangzhou.aliyuncs.com/"
// 构建表单数据,使用正确的编码方式
var formData bytes.Buffer
for k, v := range params {
if formData.Len() > 0 {
formData.WriteByte('&')
}
formData.WriteString(encodeParameter1(k))
formData.WriteByte('=')
formData.WriteString(encodeParameter1(v))
}
// 创建HTTP POST请求
req, err := http.NewRequest("POST", requestURL, &formData)
if err != nil {
return "", err
}
// 设置请求头
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
// 发送请求
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
// 读取响应
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
// 处理响应
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("HTTP错误: %s, 响应: %s", resp.Status, string(body))
}
// 解析JSON响应
var result map[string]interface{}
if err := json.Unmarshal(body, &result); err != nil {
return string(body), nil // 返回原始响应
}
// 提取翻译结果
if data, ok := result["Data"].(map[string]interface{}); ok {
if transResult, ok := data["Translated"].(string); ok {
return transResult, nil
}
}
return string(body), nil
}
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/textTranslateModel/translate.go
|
Go
|
unknown
| 4,550
|
package ttsModel
import (
"bytes"
"log"
"os/exec"
)
// 文本内容(韩语示例)
//text := "안녕하세요, edge-tts 로 생성된 음성을 변수에 저장하는 예시입니다."
//voice := "ko-KR-SunHiNeural"
//text := "你好,这是使用 edge-tts 生成语音的中文示例。"
//voice := "zh-CN-XiaoxiaoNeural"
//text := "こんにちは、edge-tts で生成された音声の日本語の例です。"
//voice := "ja-JP-NanamiNeural"
//text := "Hello, this is an English example of generating voice using edge-tts."
//voice := "en-US-JennyNeural"
// 女声
var voiceWoman = map[string]string{
"zh": "zh-CN-XiaoxiaoNeural", // 中文
"en": "en-US-JennyNeural", // 英文
"ja": "ja-JP-NanamiNeural", // 日语
"ko": "ko-KR-SunHiNeural", // 韩语
"ru": "ru-RU-SvetlanaNeural", // 俄语
"de": "de-AT-IngridNeural", // 德语
"fr": "fr-BE-CharlineNeural", // 法语
"it": "it-IT-ElsaNeural", // 意大利语
}
// 男声
var voiceMan = map[string]string{
"zh": "zh-CN-YunjianNeural", // 中文
"en": "en-US-AndrewNeural", // 英文
"ja": "ja-JP-KeitaNeural", // 日语
"ko": "ko-KR-InJoonNeural", // 韩语
"ru": "ru-RU-DmitryNeural", // 俄语
"de": "de-DE-ConradNeural", // 德语
"fr": "fr-FR-HenriNeural", // 法语
"it": "it-IT-DiegoNeural", // 意大利语
}
var voice = map[int]map[string]string{
0: voiceWoman,
1: voiceMan,
}
func SpeechSynthesis(text string, language string, selectVoiceIndex int) []byte {
// 构建 edge-tts 命令:输出音频到标准输出(--write-media -)
cmd := exec.Command(
"edge-tts",
"--voice", voice[selectVoiceIndex][language],
"--text", text,
"--write-media", "-", // 关键:音频输出到标准输出
)
// 创建缓冲区捕获标准输出(音频数据)
var audioBuf bytes.Buffer
cmd.Stdout = &audioBuf
// 创建缓冲区捕获错误输出(用于调试)
var errBuf bytes.Buffer
cmd.Stderr = &errBuf
// 执行命令
err := cmd.Run()
if err != nil {
log.Fatalf("命令执行失败: %v\n错误输出: %s", err, errBuf.String())
}
// 将音频数据保存到变量([]byte 类型)
audioData := audioBuf.Bytes()
// 后续可使用 audioData 变量进行播放、传输等操作
// 例如:通过网络发送、写入内存缓存、或通过音频库直接播放
//filePath := "output.mp3"
//err = os.WriteFile(filePath, audioData, 0644)
//if err != nil {
// log.Fatalf("保存音频文件失败: %v", err)
//}
//
//fmt.Printf("音频已保存为 %s\n", filePath)
log.Println("生成语音数据:", len(audioData))
return audioData
}
/*
Name Gender ContentCategories VoicePersonalities
--------------------------------- -------- --------------------- --------------------------------------
af-ZA-AdriNeural Female General Friendly, Positive
af-ZA-WillemNeural Male General Friendly, Positive
am-ET-AmehaNeural Male General Friendly, Positive
am-ET-MekdesNeural Female General Friendly, Positive
ar-AE-FatimaNeural Female General Friendly, Positive
ar-AE-HamdanNeural Male General Friendly, Positive
ar-BH-AliNeural Male General Friendly, Positive
ar-BH-LailaNeural Female General Friendly, Positive
ar-DZ-AminaNeural Female General Friendly, Positive
ar-DZ-IsmaelNeural Male General Friendly, Positive
ar-EG-SalmaNeural Female General Friendly, Positive
ar-EG-ShakirNeural Male General Friendly, Positive
ar-IQ-BasselNeural Male General Friendly, Positive
ar-IQ-RanaNeural Female General Friendly, Positive
ar-JO-SanaNeural Female General Friendly, Positive
ar-JO-TaimNeural Male General Friendly, Positive
ar-KW-FahedNeural Male General Friendly, Positive
ar-KW-NouraNeural Female General Friendly, Positive
ar-LB-LaylaNeural Female General Friendly, Positive
ar-LB-RamiNeural Male General Friendly, Positive
ar-LY-ImanNeural Female General Friendly, Positive
ar-LY-OmarNeural Male General Friendly, Positive
ar-MA-JamalNeural Male General Friendly, Positive
ar-MA-MounaNeural Female General Friendly, Positive
ar-OM-AbdullahNeural Male General Friendly, Positive
ar-OM-AyshaNeural Female General Friendly, Positive
ar-QA-AmalNeural Female General Friendly, Positive
ar-QA-MoazNeural Male General Friendly, Positive
ar-SA-HamedNeural Male General Friendly, Positive
ar-SA-ZariyahNeural Female General Friendly, Positive
ar-SY-AmanyNeural Female General Friendly, Positive
ar-SY-LaithNeural Male General Friendly, Positive
ar-TN-HediNeural Male General Friendly, Positive
ar-TN-ReemNeural Female General Friendly, Positive
ar-YE-MaryamNeural Female General Friendly, Positive
ar-YE-SalehNeural Male General Friendly, Positive
az-AZ-BabekNeural Male General Friendly, Positive
az-AZ-BanuNeural Female General Friendly, Positive
bg-BG-BorislavNeural Male General Friendly, Positive
bg-BG-KalinaNeural Female General Friendly, Positive
bn-BD-NabanitaNeural Female General Friendly, Positive
bn-BD-PradeepNeural Male General Friendly, Positive
bn-IN-BashkarNeural Male General Friendly, Positive
bn-IN-TanishaaNeural Female General Friendly, Positive
bs-BA-GoranNeural Male General Friendly, Positive
bs-BA-VesnaNeural Female General Friendly, Positive
ca-ES-EnricNeural Male General Friendly, Positive
ca-ES-JoanaNeural Female General Friendly, Positive
cs-CZ-AntoninNeural Male General Friendly, Positive
cs-CZ-VlastaNeural Female General Friendly, Positive
cy-GB-AledNeural Male General Friendly, Positive
cy-GB-NiaNeural Female General Friendly, Positive
da-DK-ChristelNeural Female General Friendly, Positive
da-DK-JeppeNeural Male General Friendly, Positive
de-AT-IngridNeural Female General Friendly, Positive
de-AT-JonasNeural Male General Friendly, Positive
de-CH-JanNeural Male General Friendly, Positive
de-CH-LeniNeural Female General Friendly, Positive
de-DE-AmalaNeural Female General Friendly, Positive
de-DE-ConradNeural Male General Friendly, Positive
de-DE-FlorianMultilingualNeural Male General Friendly, Positive
de-DE-KatjaNeural Female General Friendly, Positive
de-DE-KillianNeural Male General Friendly, Positive
de-DE-SeraphinaMultilingualNeural Female General Friendly, Positive
el-GR-AthinaNeural Female General Friendly, Positive
el-GR-NestorasNeural Male General Friendly, Positive
en-AU-NatashaNeural Female General Friendly, Positive
en-AU-WilliamMultilingualNeural Male General Friendly, Positive
en-CA-ClaraNeural Female General Friendly, Positive
en-CA-LiamNeural Male General Friendly, Positive
en-GB-LibbyNeural Female General Friendly, Positive
en-GB-MaisieNeural Female General Friendly, Positive
en-GB-RyanNeural Male General Friendly, Positive
en-GB-SoniaNeural Female General Friendly, Positive
en-GB-ThomasNeural Male General Friendly, Positive
en-HK-SamNeural Male General Friendly, Positive
en-HK-YanNeural Female General Friendly, Positive
en-IE-ConnorNeural Male General Friendly, Positive
en-IE-EmilyNeural Female General Friendly, Positive
en-IN-NeerjaExpressiveNeural Female General Friendly, Positive
en-IN-NeerjaNeural Female General Friendly, Positive
en-IN-PrabhatNeural Male General Friendly, Positive
en-KE-AsiliaNeural Female General Friendly, Positive
en-KE-ChilembaNeural Male General Friendly, Positive
en-NG-AbeoNeural Male General Friendly, Positive
en-NG-EzinneNeural Female General Friendly, Positive
en-NZ-MitchellNeural Male General Friendly, Positive
en-NZ-MollyNeural Female General Friendly, Positive
en-PH-JamesNeural Male General Friendly, Positive
en-PH-RosaNeural Female General Friendly, Positive
en-SG-LunaNeural Female General Friendly, Positive
en-SG-WayneNeural Male General Friendly, Positive
en-TZ-ElimuNeural Male General Friendly, Positive
en-TZ-ImaniNeural Female General Friendly, Positive
en-US-AnaNeural Female Cartoon, Conversation Cute
en-US-AndrewMultilingualNeural Male Conversation, Copilot Warm, Confident, Authentic, Honest
en-US-AndrewNeural Male Conversation, Copilot Warm, Confident, Authentic, Honest
en-US-AriaNeural Female News, Novel Positive, Confident
en-US-AvaMultilingualNeural Female Conversation, Copilot Expressive, Caring, Pleasant, Friendly
en-US-AvaNeural Female Conversation, Copilot Expressive, Caring, Pleasant, Friendly
en-US-BrianMultilingualNeural Male Conversation, Copilot Approachable, Casual, Sincere
en-US-BrianNeural Male Conversation, Copilot Approachable, Casual, Sincere
en-US-ChristopherNeural Male News, Novel Reliable, Authority
en-US-EmmaMultilingualNeural Female Conversation, Copilot Cheerful, Clear, Conversational
en-US-EmmaNeural Female Conversation, Copilot Cheerful, Clear, Conversational
en-US-EricNeural Male News, Novel Rational
en-US-GuyNeural Male News, Novel Passion
en-US-JennyNeural Female General Friendly, Considerate, Comfort
en-US-MichelleNeural Female News, Novel Friendly, Pleasant
en-US-RogerNeural Male News, Novel Lively
en-US-SteffanNeural Male News, Novel Rational
en-ZA-LeahNeural Female General Friendly, Positive
en-ZA-LukeNeural Male General Friendly, Positive
es-AR-ElenaNeural Female General Friendly, Positive
es-AR-TomasNeural Male General Friendly, Positive
es-BO-MarceloNeural Male General Friendly, Positive
es-BO-SofiaNeural Female General Friendly, Positive
es-CL-CatalinaNeural Female General Friendly, Positive
es-CL-LorenzoNeural Male General Friendly, Positive
es-CO-GonzaloNeural Male General Friendly, Positive
es-CO-SalomeNeural Female General Friendly, Positive
es-CR-JuanNeural Male General Friendly, Positive
es-CR-MariaNeural Female General Friendly, Positive
es-CU-BelkysNeural Female General Friendly, Positive
es-CU-ManuelNeural Male General Friendly, Positive
es-DO-EmilioNeural Male General Friendly, Positive
es-DO-RamonaNeural Female General Friendly, Positive
es-EC-AndreaNeural Female General Friendly, Positive
es-EC-LuisNeural Male General Friendly, Positive
es-ES-AlvaroNeural Male General Friendly, Positive
es-ES-ElviraNeural Female General Friendly, Positive
es-ES-XimenaNeural Female General Friendly, Positive
es-GQ-JavierNeural Male General Friendly, Positive
es-GQ-TeresaNeural Female General Friendly, Positive
es-GT-AndresNeural Male General Friendly, Positive
es-GT-MartaNeural Female General Friendly, Positive
es-HN-CarlosNeural Male General Friendly, Positive
es-HN-KarlaNeural Female General Friendly, Positive
es-MX-DaliaNeural Female General Friendly, Positive
es-MX-JorgeNeural Male General Friendly, Positive
es-NI-FedericoNeural Male General Friendly, Positive
es-NI-YolandaNeural Female General Friendly, Positive
es-PA-MargaritaNeural Female General Friendly, Positive
es-PA-RobertoNeural Male General Friendly, Positive
es-PE-AlexNeural Male General Friendly, Positive
es-PE-CamilaNeural Female General Friendly, Positive
es-PR-KarinaNeural Female General Friendly, Positive
es-PR-VictorNeural Male General Friendly, Positive
es-PY-MarioNeural Male General Friendly, Positive
es-PY-TaniaNeural Female General Friendly, Positive
es-SV-LorenaNeural Female General Friendly, Positive
es-SV-RodrigoNeural Male General Friendly, Positive
es-US-AlonsoNeural Male General Friendly, Positive
es-US-PalomaNeural Female General Friendly, Positive
es-UY-MateoNeural Male General Friendly, Positive
es-UY-ValentinaNeural Female General Friendly, Positive
es-VE-PaolaNeural Female General Friendly, Positive
es-VE-SebastianNeural Male General Friendly, Positive
et-EE-AnuNeural Female General Friendly, Positive
et-EE-KertNeural Male General Friendly, Positive
fa-IR-DilaraNeural Female General Friendly, Positive
fa-IR-FaridNeural Male General Friendly, Positive
fi-FI-HarriNeural Male General Friendly, Positive
fi-FI-NooraNeural Female General Friendly, Positive
fil-PH-AngeloNeural Male General Friendly, Positive
fil-PH-BlessicaNeural Female General Friendly, Positive
fr-BE-CharlineNeural Female General Friendly, Positive
fr-BE-GerardNeural Male General Friendly, Positive
fr-CA-AntoineNeural Male General Friendly, Positive
fr-CA-JeanNeural Male General Friendly, Positive
fr-CA-SylvieNeural Female General Friendly, Positive
fr-CA-ThierryNeural Male General Friendly, Positive
fr-CH-ArianeNeural Female General Friendly, Positive
fr-CH-FabriceNeural Male General Friendly, Positive
fr-FR-DeniseNeural Female General Friendly, Positive
fr-FR-EloiseNeural Female General Friendly, Positive
fr-FR-HenriNeural Male General Friendly, Positive
fr-FR-RemyMultilingualNeural Male General Friendly, Positive
fr-FR-VivienneMultilingualNeural Female General Friendly, Positive
ga-IE-ColmNeural Male General Friendly, Positive
ga-IE-OrlaNeural Female General Friendly, Positive
gl-ES-RoiNeural Male General Friendly, Positive
gl-ES-SabelaNeural Female General Friendly, Positive
gu-IN-DhwaniNeural Female General Friendly, Positive
gu-IN-NiranjanNeural Male General Friendly, Positive
he-IL-AvriNeural Male General Friendly, Positive
he-IL-HilaNeural Female General Friendly, Positive
hi-IN-MadhurNeural Male General Friendly, Positive
hi-IN-SwaraNeural Female General Friendly, Positive
hr-HR-GabrijelaNeural Female General Friendly, Positive
hr-HR-SreckoNeural Male General Friendly, Positive
hu-HU-NoemiNeural Female General Friendly, Positive
hu-HU-TamasNeural Male General Friendly, Positive
id-ID-ArdiNeural Male General Friendly, Positive
id-ID-GadisNeural Female General Friendly, Positive
is-IS-GudrunNeural Female General Friendly, Positive
is-IS-GunnarNeural Male General Friendly, Positive
it-IT-DiegoNeural Male General Friendly, Positive
it-IT-ElsaNeural Female General Friendly, Positive
it-IT-GiuseppeMultilingualNeural Male General Friendly, Positive
it-IT-IsabellaNeural Female General Friendly, Positive
iu-Cans-CA-SiqiniqNeural Female General Friendly, Positive
iu-Cans-CA-TaqqiqNeural Male General Friendly, Positive
iu-Latn-CA-SiqiniqNeural Female General Friendly, Positive
iu-Latn-CA-TaqqiqNeural Male General Friendly, Positive
ja-JP-KeitaNeural Male General Friendly, Positive
ja-JP-NanamiNeural Female General Friendly, Positive
jv-ID-DimasNeural Male General Friendly, Positive
jv-ID-SitiNeural Female General Friendly, Positive
ka-GE-EkaNeural Female General Friendly, Positive
ka-GE-GiorgiNeural Male General Friendly, Positive
kk-KZ-AigulNeural Female General Friendly, Positive
kk-KZ-DauletNeural Male General Friendly, Positive
km-KH-PisethNeural Male General Friendly, Positive
km-KH-SreymomNeural Female General Friendly, Positive
kn-IN-GaganNeural Male General Friendly, Positive
kn-IN-SapnaNeural Female General Friendly, Positive
ko-KR-HyunsuMultilingualNeural Male General Friendly, Positive
ko-KR-InJoonNeural Male General Friendly, Positive
ko-KR-SunHiNeural Female General Friendly, Positive
lo-LA-ChanthavongNeural Male General Friendly, Positive
lo-LA-KeomanyNeural Female General Friendly, Positive
lt-LT-LeonasNeural Male General Friendly, Positive
lt-LT-OnaNeural Female General Friendly, Positive
lv-LV-EveritaNeural Female General Friendly, Positive
lv-LV-NilsNeural Male General Friendly, Positive
mk-MK-AleksandarNeural Male General Friendly, Positive
mk-MK-MarijaNeural Female General Friendly, Positive
ml-IN-MidhunNeural Male General Friendly, Positive
ml-IN-SobhanaNeural Female General Friendly, Positive
mn-MN-BataaNeural Male General Friendly, Positive
mn-MN-YesuiNeural Female General Friendly, Positive
mr-IN-AarohiNeural Female General Friendly, Positive
mr-IN-ManoharNeural Male General Friendly, Positive
ms-MY-OsmanNeural Male General Friendly, Positive
ms-MY-YasminNeural Female General Friendly, Positive
mt-MT-GraceNeural Female General Friendly, Positive
mt-MT-JosephNeural Male General Friendly, Positive
my-MM-NilarNeural Female General Friendly, Positive
my-MM-ThihaNeural Male General Friendly, Positive
nb-NO-FinnNeural Male General Friendly, Positive
nb-NO-PernilleNeural Female General Friendly, Positive
ne-NP-HemkalaNeural Female General Friendly, Positive
ne-NP-SagarNeural Male General Friendly, Positive
nl-BE-ArnaudNeural Male General Friendly, Positive
nl-BE-DenaNeural Female General Friendly, Positive
nl-NL-ColetteNeural Female General Friendly, Positive
nl-NL-FennaNeural Female General Friendly, Positive
nl-NL-MaartenNeural Male General Friendly, Positive
pl-PL-MarekNeural Male General Friendly, Positive
pl-PL-ZofiaNeural Female General Friendly, Positive
ps-AF-GulNawazNeural Male General Friendly, Positive
ps-AF-LatifaNeural Female General Friendly, Positive
pt-BR-AntonioNeural Male General Friendly, Positive
pt-BR-FranciscaNeural Female General Friendly, Positive
pt-BR-ThalitaMultilingualNeural Female General Friendly, Positive
pt-PT-DuarteNeural Male General Friendly, Positive
pt-PT-RaquelNeural Female General Friendly, Positive
ro-RO-AlinaNeural Female General Friendly, Positive
ro-RO-EmilNeural Male General Friendly, Positive
ru-RU-DmitryNeural Male General Friendly, Positive
ru-RU-SvetlanaNeural Female General Friendly, Positive
si-LK-SameeraNeural Male General Friendly, Positive
si-LK-ThiliniNeural Female General Friendly, Positive
sk-SK-LukasNeural Male General Friendly, Positive
sk-SK-ViktoriaNeural Female General Friendly, Positive
sl-SI-PetraNeural Female General Friendly, Positive
sl-SI-RokNeural Male General Friendly, Positive
so-SO-MuuseNeural Male General Friendly, Positive
so-SO-UbaxNeural Female General Friendly, Positive
sq-AL-AnilaNeural Female General Friendly, Positive
sq-AL-IlirNeural Male General Friendly, Positive
sr-RS-NicholasNeural Male General Friendly, Positive
sr-RS-SophieNeural Female General Friendly, Positive
su-ID-JajangNeural Male General Friendly, Positive
su-ID-TutiNeural Female General Friendly, Positive
sv-SE-MattiasNeural Male General Friendly, Positive
sv-SE-SofieNeural Female General Friendly, Positive
sw-KE-RafikiNeural Male General Friendly, Positive
sw-KE-ZuriNeural Female General Friendly, Positive
sw-TZ-DaudiNeural Male General Friendly, Positive
sw-TZ-RehemaNeural Female General Friendly, Positive
ta-IN-PallaviNeural Female General Friendly, Positive
ta-IN-ValluvarNeural Male General Friendly, Positive
ta-LK-KumarNeural Male General Friendly, Positive
ta-LK-SaranyaNeural Female General Friendly, Positive
ta-MY-KaniNeural Female General Friendly, Positive
ta-MY-SuryaNeural Male General Friendly, Positive
ta-SG-AnbuNeural Male General Friendly, Positive
ta-SG-VenbaNeural Female General Friendly, Positive
te-IN-MohanNeural Male General Friendly, Positive
te-IN-ShrutiNeural Female General Friendly, Positive
th-TH-NiwatNeural Male General Friendly, Positive
th-TH-PremwadeeNeural Female General Friendly, Positive
tr-TR-AhmetNeural Male General Friendly, Positive
tr-TR-EmelNeural Female General Friendly, Positive
uk-UA-OstapNeural Male General Friendly, Positive
uk-UA-PolinaNeural Female General Friendly, Positive
ur-IN-GulNeural Female General Friendly, Positive
ur-IN-SalmanNeural Male General Friendly, Positive
ur-PK-AsadNeural Male General Friendly, Positive
ur-PK-UzmaNeural Female General Friendly, Positive
uz-UZ-MadinaNeural Female General Friendly, Positive
uz-UZ-SardorNeural Male General Friendly, Positive
vi-VN-HoaiMyNeural Female General Friendly, Positive
vi-VN-NamMinhNeural Male General Friendly, Positive
zh-CN-XiaoxiaoNeural Female News, Novel Warm
zh-CN-XiaoyiNeural Female Cartoon, Novel Lively
zh-CN-YunjianNeural Male Sports, Novel Passion
zh-CN-YunxiNeural Male Novel Lively, Sunshine
zh-CN-YunxiaNeural Male Cartoon, Novel Cute
zh-CN-YunyangNeural Male News Professional, Reliable
zh-CN-liaoning-XiaobeiNeural Female Dialect Humorous
zh-CN-shaanxi-XiaoniNeural Female Dialect Bright
zh-HK-HiuGaaiNeural Female General Friendly, Positive
zh-HK-HiuMaanNeural Female General Friendly, Positive
zh-HK-WanLungNeural Male General Friendly, Positive
zh-TW-HsiaoChenNeural Female General Friendly, Positive
zh-TW-HsiaoYuNeural Female General Friendly, Positive
zh-TW-YunJheNeural Male General Friendly, Positive
zu-ZA-ThandoNeural Female General Friendly, Positive
zu-ZA-ThembaNeural Male General Friendly, Positive
*/
|
2201_75373101/AITranslationWeChatMiniProgram
|
Server/ttsModel/TTS.go
|
Go
|
unknown
| 30,816
|
package com.example.bestapp;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.bestapp", appContext.getPackageName());
}
}
|
2201_75403000/BestApp
|
app/src/androidTest/java/com/example/bestapp/ExampleInstrumentedTest.java
|
Java
|
unknown
| 752
|
package com.example.bestapp;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void toRecycleViewDemo(View view){
Intent intent =new Intent();
intent.setClass(this, RecycleViewDemo.class);
startActivity(intent);
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/MainActivity.java
|
Java
|
unknown
| 723
|
package com.example.bestapp;
import android.os.Bundle;
import android.util.JsonToken;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.bestapp.adapter.RecycleViewDemoAdapter;
import com.example.bestapp.bean.UserBean;
import com.example.bestapp.utils.LogUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
public class RecycleViewDemo extends AppCompatActivity {
private ArrayList<UserBean> datas;
private RecycleViewDemoAdapter adapter;
RecyclerView recyclerView;
private String json;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycle_view_demo);
Toolbar toolbar =findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
initdata();
initview();
UserBean.isShow=false;
}
private void initview() {
recyclerView=findViewById(R.id.recycleview);
TextView edit= findViewById(R.id.edit);
View footer=findViewById(R.id.footer);
TextView tv_delete=findViewById(R.id.tv_delete);
TextView tv_select_all=findViewById(R.id.tv_select_all);
LinearLayoutManager layoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
recyclerView.setLayoutManager(layoutManager);
adapter=new RecycleViewDemoAdapter(this,datas);
recyclerView.setAdapter(adapter);
edit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UserBean.isShow=!UserBean.isShow;
int show= footer.getVisibility()==View.GONE?View.VISIBLE:View.GONE;
footer.setVisibility(show);
if (UserBean.isShow){
edit.setText("取消");
} else {
edit.setText("编辑");
}
adapter.notifyDataSetChanged();
}
});
// ------------------------------------------------------------------------------
tv_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (int i = datas.size()-1; i >=0 ; i--) {
if (datas.get(i).getSelect()){
datas.remove(i);
adapter=new RecycleViewDemoAdapter(RecycleViewDemo.this,datas);
recyclerView.setAdapter(adapter);
}
}
}
});
tv_select_all.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (UserBean userBean:datas){
userBean.setSelect(!userBean.getSelect());
}
adapter.notifyDataSetChanged();
}
});
}
private void initdata() {
datas = new ArrayList<>();
datas.addAll(UserBean.loadData(RecycleViewDemo.this));
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId()==android.R.id.home){
finish();
}
return super.onOptionsItemSelected(item);
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/RecycleViewDemo.java
|
Java
|
unknown
| 4,022
|
package com.example.bestapp.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.bestapp.R;
import com.example.bestapp.RecycleViewDemo;
import com.example.bestapp.bean.UserBean;
import com.example.bestapp.utils.LogUtil;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
public class RecycleViewDemoAdapter extends RecyclerView.Adapter<RecycleViewDemoAdapter.MyViewHolde> {
private Context context;
private ArrayList<UserBean> datalist;
private boolean isSelect=false;
private Set<Integer> positionList=new HashSet<>();
public RecycleViewDemoAdapter(Context context, ArrayList<UserBean> datalist) {
this.context = context;
this.datalist = datalist;
}
@NonNull
@Override
public MyViewHolde onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
final View itemview= LayoutInflater.from(context).inflate(R.layout.recycleview_item,parent,false);
return new MyViewHolde(itemview);
}
@Override
public void onBindViewHolder(@NonNull MyViewHolde holder, int position) {
UserBean userBean=datalist.get(position);
holder.textView.setText(userBean.getName());
Glide.with(context)
.load(userBean.getImg())
.fitCenter()
.error(R.drawable.ic_launcher_background)
.into(holder.imageView);
// ---------------------------------------------------------------------------------
if (UserBean.isShow){
holder.iv_select.setVisibility(View.VISIBLE);
if (userBean.getSelect()){
holder.iv_select.setImageResource(R.drawable.select__1_);
}else {
holder.iv_select.setImageResource(R.drawable.select);
}
}
// ----------------------------------------------------------------------------------
}
public Set<Integer> getPosition(){
return positionList;
}
@Override
public int getItemCount() {
return datalist.size();
}
public class MyViewHolde extends RecyclerView.ViewHolder{
ImageView imageView;
TextView textView;
ImageView iv_select;
public MyViewHolde(@NonNull View itemView) {
super(itemView);
iv_select = itemView.findViewById(R.id.iv_select);
imageView = itemView.findViewById(R.id.imageView);
textView = itemView.findViewById(R.id.textView);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// if(!RecycleViewDemo.getIsSelect()) {
// isSelect = !isSelect;
// if (isSelect) {
// iv_select.setImageResource(R.drawable.select__1_);
// positionList.add(getAdapterPosition());
// } else {
// iv_select.setImageResource(R.drawable.select);
// }
// }
if (!UserBean.isShow)return;
final int currentPosition = getAdapterPosition();
final UserBean currentPerson = datalist.get(currentPosition);
currentPerson.setSelect(!currentPerson.getSelect());
LogUtil.d("www",currentPerson.toString());
notifyItemChanged(currentPosition);
}
});
}
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/adapter/RecycleViewDemoAdapter.java
|
Java
|
unknown
| 3,800
|
package com.example.bestapp.bean;
import android.content.Context;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class UserBean {
@SerializedName("url")
private String img;
@SerializedName("desc")
private String name;
private boolean isSelect=false;
public static boolean isShow=false;
public boolean getSelect(){
return isSelect;
}
public void setSelect(boolean select){
isSelect=select;
}
public UserBean(String img, String name) {
this.img = img;
this.name = name;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static ArrayList<UserBean> loadData(Context context) {
// 读取
String json = load(context);
// 解析
Gson gson = new Gson();
TypeToken<ArrayList<UserBean>> typeToken = new TypeToken<>() {};
ArrayList<UserBean> UserBeans = gson.fromJson(json, typeToken.getType());
return UserBeans;
}
private static String load(Context context) {
StringBuilder sb=new StringBuilder();
try {
InputStream inputStream=context.getAssets().open("defaultdatas.json");
InputStreamReader inputStreamReader=new InputStreamReader(inputStream);
BufferedReader bs=new BufferedReader(inputStreamReader);
String line;
while ((line=bs.readLine())!=null){
sb.append(line);
}
bs.close();
inputStream.close();
}catch (IOException e) {
e.printStackTrace();
}
return sb.toString();
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/bean/UserBean.java
|
Java
|
unknown
| 2,036
|
package com.example.bestapp.utils;
import android.util.Log;
public class LogUtil {
// 用于控制是否打印log
public static boolean isDebug = true;
public static void d(String tag, String msg) {
//
if (isDebug)
//打印log
Log.d(tag, msg);
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/utils/LogUtil.java
|
Java
|
unknown
| 301
|
package com.example.bestapp.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
/**
* 自定义环形百分比视图
* 功能:绘制一个白色圆环,并在圆环上叠加一个彩色圆弧,中间显示百分比文字
*/
public class RingPercentDemo extends View {
// 圆心坐标
private int mCircleX;
private int mCircleY;
// 圆环半径(默认80像素)
private int mRadius = 80;
// 绘制白色圆环的画笔
private Paint mCirclePaint;
// 圆弧的绘制区域(基于圆环的外接矩形)
private RectF mRecF;
// 圆弧起始角度(-90表示12点钟方向开始)
private float mStartAngle = -90f;
// 圆弧扫过的角度(负值表示逆时针方向)
private float mSweepAngle = -45f;
// 绘制彩色圆弧的画笔
private Paint mRingPaint;
// 文字绘制坐标
private int mTextx;
private int mTexty;
// 绘制百分比文字的画笔
private Paint mTextPaint;
// 显示的百分比文字
private String mTextStr;
// 简单构造器(用于代码创建视图)
public RingPercentDemo(Context context) {
super(context);
init();
}
// 带属性集的构造器(用于XML布局文件)
public RingPercentDemo(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
/**
* 初始化画笔和默认参数
*/
private void init() {
// 白色圆环画笔配置
mCirclePaint = new Paint();
mCirclePaint.setColor(Color.WHITE); // 白色
mCirclePaint.setStrokeWidth(15); // 圆环宽度25px
mCirclePaint.setStyle(Paint.Style.STROKE); // 只绘制轮廓
mCirclePaint.setAntiAlias(true); // 开启抗锯齿
// 彩色圆弧画笔配置
mRingPaint = new Paint();
mRingPaint.setColor(Color.parseColor("#859BFF")); // 浅蓝色
mRingPaint.setStrokeWidth(15); // 圆弧宽度25px
mRingPaint.setStyle(Paint.Style.STROKE); // 只绘制轮廓
mRingPaint.setAntiAlias(true); // 开启抗锯齿
// 文字画笔配置
mTextPaint = new Paint();
mTextPaint.setColor(Color.WHITE); // 白色文字
mTextPaint.setStyle(Paint.Style.FILL); // 实心文字
mTextPaint.setTextSize(40); // 文字大小40px
mTextPaint.setTextAlign(Paint.Align.CENTER); // 文字居中绘制
mTextPaint.setAntiAlias(true); // 开启抗锯齿
mTextStr = "86%"; // 默认显示文本
}
/**
* 当视图大小变化时调用
* @param w 新宽度
* @param h 新高度
* @param oldw 旧宽度
* @param oldh 旧高度
*/
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// 将圆心定位在视图水平居中、1/2高度处
mCircleX = w / 2;
mCircleY = h / 2;
// 文字绘制位置
mTextx = mCircleX;
mTexty = mCircleY+10;
// 计算圆弧的绘制区域(基于圆环的外接矩形)
mRecF = new RectF(
mCircleX - mRadius, // 左边界
mCircleY - mRadius, // 上边界
mCircleX + mRadius, // 右边界
mCircleY + mRadius // 下边界
);
}
/**
* 绘制视图内容
* @param canvas 画布对象
*/
@Override
protected void onDraw(@NonNull Canvas canvas) {
super.onDraw(canvas);
// 1. 绘制白色圆环
canvas.drawCircle(mCircleX, mCircleY, mRadius, mCirclePaint);
// 2. 绘制彩色进度圆弧
// 参数:绘制区域、起始角度、扫过角度、是否连接圆心、画笔
canvas.drawArc(mRecF, mStartAngle, mSweepAngle, false, mRingPaint);
// 3. 绘制居中百分比文字
// 参数:文字内容、x坐标、y坐标、画笔
canvas.drawText(mTextStr, mTextx, mTexty, mTextPaint);
}
// -------------------- 扩展方法(供外部调用)-------------------- //
/**
* 设置圆环半径
* @param radius 半径值(像素单位)
*/
public void setRadius(int radius) {
this.mRadius = radius;
updateRectF();
invalidate(); // 重绘视图
}
/**
* 设置进度百分比
* @param percent 百分比值(0-100)
*/
public void setPercent(int percent) {
this.mSweepAngle = -360 * percent / 100f; // 计算对应的角度
this.mTextStr = percent + "%"; // 更新显示文字
invalidate(); // 重绘视图
}
/**
* 更新圆弧绘制区域
*/
private void updateRectF() {
mRecF.set(
mCircleX - mRadius,
mCircleY - mRadius,
mCircleX + mRadius,
mCircleY + mRadius
);
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/view/RingPercentDemo.java
|
Java
|
unknown
| 5,212
|
package com.example.bestapp.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
public class RingPercentDemo2 extends View {
private int mCircleX;
private int mCircleY;
private int mRadius = 80;
private Paint mCirclePaint;
public RingPercentDemo2(Context context) {
super(context);
init();
}
public RingPercentDemo2(Context context, AttributeSet attrs){
super(context, attrs);
init();
}
private void init(){
mCirclePaint = new Paint();
mCirclePaint.setColor(Color.parseColor("#FCD365"));
mCirclePaint.setStrokeWidth(15);
mCirclePaint.setStyle(Paint.Style.STROKE);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mCircleX = w/2;
mCircleY = h/2;
}
@Override
protected void onDraw(@NonNull Canvas canvas) {
super.onDraw(canvas);
canvas.drawCircle(mCircleX,mCircleY,mRadius,mCirclePaint);
}
}
|
2201_75403000/BestApp
|
app/src/main/java/com/example/bestapp/view/RingPercentDemo2.java
|
Java
|
unknown
| 1,244
|
:root {
--primary: #5d4037;
--primary-light: #8d6e63;
--secondary: #4e342e;
--accent: #d7ccc8;
--light: #efebe9;
--dark: #3e2723;
--text: #4e342e;
--success: #2e7d32;
--internet: #5e35b1;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body {
background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
color: var(--text);
min-height: 100vh;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
}
.container {
max-width: 1200px;
width: 100%;
display: flex;
flex-direction: column;
gap: 20px;
}
header {
text-align: center;
padding: 15px;
}
.logo {
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
margin-bottom: 10px;
}
.logo-icon {
font-size: 36px;
color: var(--primary);
animation: pulse 2s infinite;
}
h1 {
font-size: 36px;
background: linear-gradient(to right, var(--primary), var(--dark));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 8px;
}
.subtitle {
font-size: 15px;
color: var(--primary-light);
max-width: 600px;
margin: 0 auto 20px;
}
.generator-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
@media (max-width: 900px) {
.generator-container {
grid-template-columns: 1fr;
}
}
.control-panel {
background: white;
border-radius: 16px;
padding: 20px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
border: 1px solid rgba(0, 0, 0, 0.05);
}
.result-panel {
background: white;
border-radius: 16px;
padding: 20px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
border: 1px solid rgba(0, 0, 0, 0.05);
display: flex;
flex-direction: column;
/* 新增以下样式 */
max-height: 600px; /* 设置最大高度,可根据需要调整 */
min-height: 400px; /* 设置最小高度,确保面板不会过小 */
}
.results-container {
flex-grow: 1;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 24px;
margin-bottom: 20px;
/* 新增以下样式 */
overflow-y: auto; /* 允许垂直滚动 */
padding-right: 8px; /* 预留滚动条空间,避免内容被遮挡 */
padding: 10px; /* 增加容器内边距,让边缘卡片也有足够空间 */
}
/* 美化滚动条(可选) */
.results-container::-webkit-scrollbar {
width: 6px;
}
.results-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
.results-container::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 10px;
}
.results-container::-webkit-scrollbar-thumb:hover {
background: #a1a1a1;
}
.panel-title {
font-size: 20px;
margin-bottom: 20px;
padding-bottom: 12px;
border-bottom: 2px solid var(--accent);
color: var(--primary);
display: flex;
align-items: center;
gap: 8px;
}
.form-group {
margin-bottom: 20px;
}
.form-label {
display: block;
margin-bottom: 8px;
font-weight: 500;
font-size: 15px;
color: var(--dark);
}
.select-wrapper {
position: relative;
}
.select-wrapper::after {
content: '\f078';
font-family: 'Font Awesome 5 Free';
font-weight: 900;
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--primary-light);
pointer-events: none;
font-size: 14px;
}
select {
width: 100%;
padding: 12px 12px;
border-radius: 10px;
border: 1px solid #ddd;
background: white;
font-size: 14px;
color: var(--text);
appearance: none;
transition: all 0.3s ease;
cursor: pointer;
}
select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(93, 64, 55, 0.1);
}
.checkbox-group {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 12px;
}
.checkbox-label {
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
padding: 8px 12px;
background: var(--light);
border-radius: 8px;
transition: all 0.3s ease;
font-size: 14px;
}
.checkbox-label:hover {
background: #e8e0dd;
}
input[type="checkbox"],
input[type="radio"] {
width: 16px;
height: 16px;
accent-color: var(--primary);
cursor: pointer;
}
.slider-container {
display: flex;
align-items: center;
gap: 12px;
}
input[type="range"] {
flex-grow: 1;
height: 5px;
appearance: none;
background: #e0e0e0;
border-radius: 8px;
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--primary);
cursor: pointer;
transition: all 0.3s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
transform: scale(1.2);
background: var(--dark);
}
.number-display {
min-width: 36px;
text-align: center;
font-weight: 600;
font-size: 16px;
color: var(--primary);
}
.action-buttons {
display: flex;
gap: 12px;
margin-top: 24px;
}
.btn {
flex: 1;
padding: 14px;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
border: none;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
}
.btn-primary {
background: linear-gradient(to right, var(--primary), var(--dark));
color: white;
box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);
}
.btn-primary:hover {
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(93, 64, 55, 0.4);
}
.btn-internet {
background: linear-gradient(to right, var(--internet), #4527a0);
color: white;
box-shadow: 0 4px 12px rgba(94, 53, 177, 0.3);
}
.btn-internet:hover {
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(94, 53, 177, 0.4);
}
.btn-secondary {
background: var(--light);
color: var(--dark);
}
.btn-secondary:hover {
background: #e8e0dd;
}
.results-container {
flex-grow: 1;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 16px;
margin-bottom: 20px;
}
.name-card {
background: var(--light);
border-radius: 10px;
padding: 20px 16px; /* 增加内边距,让内容不那么拥挤 */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
transition: all 0.3s ease;
cursor: pointer;
position: relative;
overflow: hidden;
min-height: 100px; /* 确保卡片有足够高度,保持一致性 */
}
.name-card.internet {
background: linear-gradient(135deg, #f3f0ff 0%, #e8e2ff 100%);
border: 1px solid rgba(94, 53, 177, 0.1);
}
.name-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}
.name-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: var(--primary);
}
.name-card.internet::before {
background: var(--internet);
}
.name {
font-size: 19px;
font-weight: 700;
margin-bottom: 6px;
color: var(--dark);
}
.name-card.internet .name {
color: var(--internet);
}
.origin {
font-size: 12px;
color: var(--primary-light);
font-style: italic;
}
.name-card.internet .origin {
color: #7e57c2;
}
.gender {
position: absolute;
top: 8px;
right: 8px;
font-size: 12px;
padding: 2px 6px;
border-radius: 12px;
background: rgba(0, 0, 0, 0.1);
}
.male {
color: #1976d2;
}
.female {
color: #c2185b;
}
.internet-tag {
background: rgba(94, 53, 177, 0.1);
color: var(--internet);
}
.actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15px;
padding: 10px;
}
.result-count {
font-size: 14px;
color: var(--primary-light);
display: flex;
align-items: center;
gap: 6px;
}
.export-btn {
padding: 8px 16px;
background: var(--light);
border-radius: 6px;
border: none;
font-weight: 500;
color: var(--dark);
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 6px;
font-size: 14px;
}
.export-btn:hover {
background: #e8e0dd;
}
.favorite-btn {
position: absolute;
bottom: 8px;
right: 8px;
background: none;
border: none;
color: #bdbdbd;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
}
.favorite-btn.active {
color: #f44336;
}
.favorite-btn:hover {
transform: scale(1.2);
}
.empty-state {
grid-column: 1 / -1;
text-align: center;
padding: 40px 16px;
color: var(--primary-light);
}
.empty-state i {
font-size: 50px;
margin-bottom: 16px;
opacity: 0.3;
}
.empty-state p {
font-size: 15px;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.name-card {
animation: fadeIn 0.5s ease forwards;
}
/* 名字详情面板样式 */
.name-details {
background: white;
border-radius: 12px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.details-title {
margin-top: 0;
color: var(--primary);
display: flex;
align-items: center;
gap: 10px;
}
.details-content {
padding: 15px 0;
min-height: 80px;
}
.name-detail-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.detail-name {
font-size: 24px;
font-weight: bold;
color: #333;
}
.detail-metadata {
display: flex;
gap: 15px;
margin-bottom: 15px;
color: #666;
}
.detail-meaning {
line-height: 1.6;
color: #444;
padding: 10px;
background-color: #f9f9f9;
border-radius: 8px;
}
.empty-details {
text-align: center;
padding: 20px;
color: #888;
}
.empty-details i {
font-size: 24px;
margin-bottom: 10px;
opacity: 0.5;
}
footer {
text-align: center;
padding: 16px;
color: var(--primary-light);
font-size: 12px;
margin-top: 16px;
}
.featured-names {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 12px;
margin-top: 8px;
}
.featured-name {
padding: 6px 12px;
background: rgba(93, 64, 55, 0.1);
border-radius: 16px;
font-size: 13px;
cursor: pointer;
transition: all 0.3s ease;
}
.featured-name:hover {
background: rgba(93, 64, 55, 0.2);
}
.highlight {
background: linear-gradient(120deg, rgba(93, 64, 55, 0.1), rgba(93, 64, 55, 0.05));
background-repeat: no-repeat;
background-size: 100% 40%;
background-position: 0 88%;
}
.type-selector {
display: flex;
border-radius: 12px;
overflow: hidden;
margin-bottom: 20px;
background: var(--light);
}
.type-option {
flex: 1;
text-align: center;
padding: 12px;
cursor: pointer;
transition: all 0.3s;
font-weight: 500;
}
.type-option.active {
background: var(--primary);
color: white;
}
.type-option.internet.active {
background: var(--internet);
}
|
2201_75876277/Open-Source-Debut
|
css/styles.css
|
CSS
|
unknown
| 12,164
|
<!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">
<link rel="stylesheet" href="css/styles.css">
<script src="js/data.js"></script>
<script src="js/utils.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div class="container">
<header>
<div class="logo">
<div class="logo-icon">
<i class="fas fa-signature"></i>
</div>
<h1>姓名生成器</h1>
</div>
<p class="subtitle">探索全球文化,生成个性化姓名或创意网名,适合小说角色、游戏人物或您的创意项目</p>
<div class="featured-names">
<div class="featured-name" data-origin="chinese">张明轩</div>
<div class="featured-name" data-origin="japanese">山田太郎</div>
<div class="featured-name" data-origin="english">Olivia Williams</div>
<div class="featured-name" data-origin="french">Sophie Dubois</div>
<div class="featured-name" data-origin="internet">暗夜星辰</div>
<div class="featured-name" data-origin="internet">SilentWalker</div>
</div>
</header>
<div class="type-selector">
<div class="type-option active" data-type="real">真实姓名</div>
<div class="type-option internet" data-type="internet">创意网名</div>
</div>
<div class="generator-container">
<div class="control-panel">
<h2 class="panel-title"><i class="fas fa-sliders-h"></i> 生成设置</h2>
<div class="form-group">
<label class="form-label">姓名文化</label>
<div class="select-wrapper">
<select id="culture">
<option value="random">随机文化</option>
<option value="chinese">中文姓名</option>
<option value="english">英文姓名</option>
<option value="japanese">日本姓名</option>
<option value="korean">韩国姓名</option>
<option value="french">法国姓名</option>
<option value="french">新加坡姓名</option>
<option value="french">美国姓名</option>
<option value="french">泰国姓名</option>
<option value="french">印度姓名</option>
</select>
</div>
</div>
<div class="form-group" id="gender-group">
<label class="form-label">性别</label>
<div class="checkbox-group">
<label class="checkbox-label">
<input type="radio" name="gender" value="any" checked>
任意性别
</label>
<label class="checkbox-label">
<input type="radio" name="gender" value="male">
男性
</label>
<label class="checkbox-label">
<input type="radio" name="gender" value="female">
女性
</label>
</div>
</div>
<div class="form-group">
<label class="form-label">生成数量</label>
<div class="slider-container">
<input type="range" id="quantity" min="1" max="21" value="12">
<div class="number-display" id="quantity-display">12</div>
</div>
</div>
<div class="form-group">
<label class="form-label">其他选项</label>
<div class="checkbox-group">
<label class="checkbox-label">
<input type="checkbox" id="show-meaning">
显示含义
</label>
<label class="checkbox-label">
<input type="checkbox" id="allow-unisex" checked>
允许中性名
</label>
</div>
</div>
<div class="action-buttons">
<button class="btn btn-primary" id="generate-btn">
<i class="fas fa-magic"></i> 生成姓名
</button>
<button class="btn btn-internet" id="generate-internet-btn">
<i class="fas fa-globe"></i> 生成网名
</button>
<button class="btn btn-secondary" id="reset-btn">
<i class="fas fa-redo"></i> 重置
</button>
</div>
</div>
<div class="result-panel">
<h2 class="panel-title"><i class="fas fa-list"></i> 生成结果 <span id="result-count">(0)</span></h2>
<div class="results-container" id="results-container">
<div class="empty-state">
<i class="fas fa-file-signature"></i>
<p>点击"生成姓名"按钮开始创建</p>
</div>
</div>
<div class="actions">
<div class="result-count">
<i class="fas fa-info-circle"></i>
<span>已生成 <span id="generated-count">0</span> 个姓名</span>
</div>
<button class="export-btn" id="export-btn">
<i class="fas fa-download"></i> 导出结果
</button>
</div>
</div>
</div>
<!-- 名字详情面板 -->
<div class="name-details">
<h2 class="details-title"><i class="fas fa-info-circle"></i> 名字详情</h2>
<div class="details-content">
<div class="empty-details">
<i class="fas fa-hand-pointer"></i>
<p>点击任意名字查看详细信息</p>
</div>
</div>
</div>
<footer>
<p>© 2023 姓名生成器 | 包含全球超过 15,000 个姓名数据 | 新增创意网名功能</p>
</footer>
</div>
</body>
</html>
|
2201_75876277/Open-Source-Debut
|
index.html
|
HTML
|
unknown
| 7,039
|
document.addEventListener('DOMContentLoaded', function() {
// 获取DOM元素
const cultureSelect = document.getElementById('culture');
const quantitySlider = document.getElementById('quantity');
const quantityDisplay = document.getElementById('quantity-display');
const generateBtn = document.getElementById('generate-btn');
const generateInternetBtn = document.getElementById('generate-internet-btn');
const resetBtn = document.getElementById('reset-btn');
const exportBtn = document.getElementById('export-btn');
const resultsContainer = document.getElementById('results-container');
const generatedCount = document.getElementById('generated-count');
const resultCount = document.getElementById('result-count');
const genderGroup = document.getElementById('gender-group');
const typeOptions = document.querySelectorAll('.type-option');
const showMeaningCheckbox = document.getElementById('show-meaning');
// 更新数量显示
quantitySlider.addEventListener('input', () => {
quantityDisplay.textContent = quantitySlider.value;
});
// 切换生成类型
typeOptions.forEach(option => {
option.addEventListener('click', function () {
typeOptions.forEach(opt => opt.classList.remove('active'));
this.classList.add('active');
if (this.dataset.type === 'internet') {
cultureSelect.value = 'internet';
genderGroup.style.display = 'none';
generateInternetBtn.style.display = 'flex';
generateBtn.style.display = 'none';
} else {
cultureSelect.value = 'random';
genderGroup.style.display = 'block';
generateInternetBtn.style.display = 'none';
generateBtn.style.display = 'flex';
}
});
});
// 生成姓名函数
function generateNames() {
const culture = cultureSelect.value;
const quantity = parseInt(quantitySlider.value);
const genderRadios = document.getElementsByName('gender');
let selectedGender = 'any';
for (const radio of genderRadios) {
if (radio.checked) {
selectedGender = radio.value;
break;
}
}
const allowUnisex = document.getElementById('allow-unisex').checked;
const showMeaning = showMeaningCheckbox.checked;
// 清空结果容器
resultsContainer.innerHTML = '';
// 如果选择随机文化,随机选择一种文化
const selectedCulture = culture === 'random' ?
getRandomCulture() : culture;
// 检查所选文化是否有数据
if (!nameDatabase[selectedCulture]) {
resultsContainer.innerHTML = `
<div class="empty-state">
<i class="fas fa-exclamation-circle"></i>
<p>所选文化暂无数据,请尝试其他文化</p>
</div>
`;
return;
}
// 生成姓名
const names = [];
for (let i = 0; i < quantity; i++) {
let genderPool;
// 根据选择的性别确定生成池
if (selectedGender === 'any') {
genderPool = ['male', 'female'];
if (allowUnisex) genderPool.push('unisex');
} else {
genderPool = [selectedGender];
if (allowUnisex && Math.random() > 0.7) {
genderPool.push('unisex');
}
}
// 随机选择性别
const gender = genderPool[Math.floor(Math.random() * genderPool.length)];
// 获取对应文化的姓名列表
const cultureNames = nameDatabase[selectedCulture];
if (cultureNames && cultureNames[gender] && cultureNames[gender].length > 0) {
const nameList = cultureNames[gender];
const randomName = nameList[Math.floor(Math.random() * nameList.length)];
names.push({
name: randomName.name,
meaning: randomName.meaning,
origin: selectedCulture,
gender: gender,
type: 'real'
});
} else {
// 如果所选性别没有数据,尝试其他性别
let fallbackGender = gender === 'male' ? 'female' : 'male';
if (cultureNames[fallbackGender] && cultureNames[fallbackGender].length > 0) {
const nameList = cultureNames[fallbackGender];
const randomName = nameList[Math.floor(Math.random() * nameList.length)];
names.push({
name: randomName.name,
meaning: randomName.meaning,
origin: selectedCulture,
gender: fallbackGender,
type: 'real'
});
} else if (cultureNames.unisex && cultureNames.unisex.length > 0) {
const nameList = cultureNames.unisex;
const randomName = nameList[Math.floor(Math.random() * nameList.length)];
names.push({
name: randomName.name,
meaning: randomName.meaning,
origin: selectedCulture,
gender: 'unisex',
type: 'real'
});
} else {
// 如果所有性别都没有数据
resultsContainer.innerHTML = `
<div class="empty-state">
<i class="fas fa-exclamation-circle"></i>
<p>所选文化暂无数据,请尝试其他文化</p>
</div>
`;
return;
}
}
}
// 显示姓名
displayNames(names, showMeaning);
}
// 生成网名函数
function generateInternetNames() {
const quantity = parseInt(quantitySlider.value);
const showMeaning = showMeaningCheckbox.checked;
// 清空结果容器
resultsContainer.innerHTML = '';
// 生成网名
const names = [];
const nameList = nameDatabase.internet.unisex;
for (let i = 0; i < quantity; i++) {
// 避免重复选择同一个名字
let randomIndex;
let randomName;
do {
randomIndex = Math.floor(Math.random() * nameList.length);
randomName = nameList[randomIndex];
} while (names.some(n => n.name === randomName.name) && names.length < nameList.length);
names.push({
name: randomName.name,
meaning: randomName.meaning,
origin: 'internet',
gender: 'unisex',
type: 'internet'
});
}
// 显示网名
displayNames(names, showMeaning);
}
// 显示姓名函数
function displayNames(names, showMeaning) {
// 获取详情面板元素
const detailsContent = document.querySelector('.details-content');
// 清空容器
resultsContainer.innerHTML = '';
names.forEach(name => {
const nameCard = document.createElement('div');
nameCard.className = `name-card ${name.type === 'internet' ? 'internet' : ''}`;
nameCard.innerHTML = `
<div class="name">${name.name}</div>
<div class="origin">${getCultureName(name.origin)}</div>
<div class="gender ${name.gender} ${name.type === 'internet' ? 'internet-tag' : ''}">${name.gender === 'male' ? '男' :
name.gender === 'female' ? '女' : '网名'
}</div>
<button class="favorite-btn"><i class="far fa-heart"></i></button>
${showMeaning ? `<div class="meaning">${name.meaning}</div>` : ''}
`;
// 添加点击事件以显示详情
nameCard.addEventListener('click', function () {
detailsContent.innerHTML = `
<div class="name-detail-header">
<div class="detail-name">${name.name}</div>
</div>
<div class="detail-metadata">
<span><i class="fas fa-globe"></i> ${getCultureName(name.origin)}</span>
<span><i class="fas fa-${name.gender === 'male' ? 'mars' : name.gender === 'female' ? 'venus' : 'user'}"></i> ${name.gender === 'male' ? '男性' : name.gender === 'female' ? '女性' : '中性'}</span>
</div>
<div class="detail-meaning">
<strong>含义:</strong>${name.meaning || '暂无含义信息'}
</div>
`;
});
resultsContainer.appendChild(nameCard);
});
// 更新计数
generatedCount.textContent = names.length;
resultCount.textContent = `(${names.length})`;
// 添加收藏功能
document.querySelectorAll('.favorite-btn').forEach(btn => {
btn.addEventListener('click', function (e) {
e.stopPropagation();
const icon = this.querySelector('i');
this.classList.toggle('active');
if (this.classList.contains('active')) {
icon.classList.remove('far');
icon.classList.add('fas');
} else {
icon.classList.remove('fas');
icon.classList.add('far');
}
});
});
}
// 重置表单
function resetForm() {
cultureSelect.value = 'random';
document.getElementsByName('gender')[0].checked = true;
quantitySlider.value = 10;
quantityDisplay.textContent = '10';
document.getElementById('allow-unisex').checked = true;
document.getElementById('show-meaning').checked = false;
resultsContainer.innerHTML = `
<div class="empty-state">
<i class="fas fa-file-signature"></i>
<p>点击"生成姓名"按钮开始创建</p>
</div>
`;
generatedCount.textContent = '0';
resultCount.textContent = '(0)';
// 重置类型选择
typeOptions.forEach(opt => opt.classList.remove('active'));
document.querySelector('.type-option[data-type="real"]').classList.add('active');
genderGroup.style.display = 'block';
generateInternetBtn.style.display = 'none';
generateBtn.style.display = 'flex';
// 重置详情面板
document.querySelector('.details-content').innerHTML = `
<div class="empty-details">
<i class="fas fa-hand-pointer"></i>
<p>点击任意名字查看详细信息</p>
</div>
`;
}
// 导出结果
function exportResults() {
const names = Array.from(document.querySelectorAll('.name'));
if (names.length === 0) {
alert('没有可导出的姓名');
return;
}
let content = "生成的姓名列表:\n\n";
names.forEach(nameEl => {
const name = nameEl.textContent;
const origin = nameEl.nextElementSibling.textContent;
const gender = nameEl.nextElementSibling.nextElementSibling.textContent;
content += `${name} | ${origin} | ${gender}\n`;
});
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = '姓名列表.txt';
document.body.appendChild(a);
a.click();
setTimeout(() => {
document.body.removeChild(a);
URL.revokeObjectURL(url);
}, 0);
}
// 特色姓名点击
document.querySelectorAll('.featured-name').forEach(name => {
name.addEventListener('click', function () {
const origin = this.getAttribute('data-origin');
cultureSelect.value = origin;
if (origin === 'internet') {
typeOptions.forEach(opt => opt.classList.remove('active'));
document.querySelector('.type-option[data-type="internet"]').classList.add('active');
genderGroup.style.display = 'none';
generateInternetBtn.style.display = 'flex';
generateBtn.style.display = 'none';
generateInternetNames();
} else {
typeOptions.forEach(opt => opt.classList.remove('active'));
document.querySelector('.type-option[data-type="real"]').classList.add('active');
genderGroup.style.display = 'block';
generateInternetBtn.style.display = 'none';
generateBtn.style.display = 'flex';
generateNames();
}
});
});
// 事件监听绑定
generateBtn.addEventListener('click', generateNames);
generateInternetBtn.addEventListener('click', generateInternetNames);
resetBtn.addEventListener('click', resetForm);
exportBtn.addEventListener('click', exportResults);
// 显示含义选项变化时更新显示
showMeaningCheckbox.addEventListener('change', () => {
const nameCards = document.querySelectorAll('.name-card');
if (nameCards.length > 0) {
const names = Array.from(nameCards).map(card => ({
name: card.querySelector('.name').textContent,
meaning: card.querySelector('.meaning')?.textContent || '',
origin: card.querySelector('.origin').textContent,
gender: card.querySelector('.gender').classList.contains('male') ? 'male' :
card.querySelector('.gender').classList.contains('female') ? 'female' : 'unisex',
type: card.classList.contains('internet') ? 'internet' : 'real'
}));
displayNames(names, showMeaningCheckbox.checked);
}
});
// 初始化按钮显示状态
generateInternetBtn.style.display = 'none';
generateBtn.style.display = 'flex';
genderGroup.style.display = 'block';
// 初始化生成一些姓名
generateNames();
});
|
2201_75876277/Open-Source-Debut
|
js/app.js
|
JavaScript
|
unknown
| 14,989
|
// 姓名数据库
const nameDatabase = {
chinese: {
male: [
{ name: "张明轩", meaning: "光明、气宇轩昂" },
{ name: "李浩然", meaning: "胸怀广阔、正气凛然" },
{ name: "王思远", meaning: "思维开阔、志向远大" },
{ name: "刘宇航", meaning: "宇宙航行、志向高远" },
{ name: "陈嘉豪", meaning: "美好、豪迈" },
{ name: "杨天宇", meaning: "天空、宇宙" },
{ name: "赵博文", meaning: "博学多才、文雅" },
{ name: "黄俊杰", meaning: "英俊、杰出" },
{ name: "周逸飞", meaning: "自在洒脱、展翅高飞" },
{ name: "吴梓轩", meaning: "生机勃勃、气宇轩昂" },
{ name: "徐睿渊", meaning: "聪明睿智、学识渊博" },
{ name: "马子昂", meaning: "谦谦君子、昂扬向上" },
{ name: "朱景澄", meaning: "前景光明、澄澈通透" },
{ name: "胡启铭", meaning: "启迪未来、铭记初心" },
{ name: "郭俊辉", meaning: "俊朗不凡、光辉闪耀" },
{ name: "林泽宇", meaning: "恩泽深厚、器宇轩昂" },
{ name: "何承宇", meaning: "承前启后、宇宙宽广" },
{ name: "罗思哲", meaning: "深思熟虑、富有哲理" },
{ name: "李浚荣", meaning: "李,浚深,榮耀" },
{ name: "南志鉉", meaning: "南,志向,鉉明" },
{ name: "贺擎苍", meaning: "力挽苍穹,擎天而立" },
{ name: "岑曜嵘", meaning: "山岑晚照,峥嵘不凡" },
{ name: "阮峻熙", meaning: "峻岭朝阳,光华万丈" },
{ name: "向瀚霆", meaning: "瀚海雷霆,声势浩然" },
{ name: "柯祺瑞", meaning: "祥祺安康,瑞气自来" },
{ name: "傅弈舟", meaning: "以弈为舟,渡世智慧" },
{ name: "季峤岳", meaning: "峤山巍巍,岳峙渊渟" },
{ name: "黎湛然", meaning: "湛然若神,澄澈通明" },
{ name: "阎夙夜", meaning: "夙兴夜寐,砥砺前行" },
{ name: "盛澈言", meaning: "澈底清明,言为心声" }
],
female: [
{ name: "王诗涵", meaning: "诗意、内涵" },
{ name: "李雨婷", meaning: "如雨般清新、亭亭玉立" },
{ name: "张雅静", meaning: "文雅、安静" },
{ name: "刘欣怡", meaning: "喜悦、愉快" },
{ name: "陈思琪", meaning: "思维敏捷、美玉" },
{ name: "杨梦瑶", meaning: "梦幻、美玉" },
{ name: "赵晓萱", meaning: "晨曦、忘忧草" },
{ name: "黄婉婷", meaning: "温柔、美好" },
{ name: "文佳煐", meaning: "文,佳麗,光明" },
{ name: "金所泫", meaning: "金,處所,水光" },
{ name: "裴秀智", meaning: "裴,秀麗,智慧" },
{ name: "韩佳人", meaning: "韩,佳美,仁人" },
{ name: "朴宝英", meaning: "朴,珍寶,英華" },
{ name: "顾芷汀", meaning: "芷香绕汀,清幽淡雅" },
{ name: "苏旎歌", meaning: "旖旎如歌,婉转悠扬" },
{ name: "楚绾青", meaning: "绾发青丝,温婉如画" },
{ name: "洛霁月", meaning: "霁月澄辉,洛水清泠" },
{ name: "江沅芷", meaning: "沅有芷兮,澧有兰" },
{ name: "简梨落", meaning: "梨花飘雪,落英无声" },
{ name: "沐晴岚", meaning: "晴光染岚,沐雨而生" },
{ name: "颜书瑶", meaning: "书香若瑶,气质天成" },
{ name: "虞星澜", meaning: "星辉潮汐,虞梦悠长" },
{ name: "蓝听雪", meaning: "雪落无声,静听寒音" }
],
unisex: [
{ name: "林子涵", meaning: "森林、包容" },
{ name: "周文博", meaning: "文雅、博学" },
{ name: "姜泰現", meaning: "姜,泰然,現實" },
{ name: "尹鍾信", meaning: "尹,鐘聲,信任" },
{ name: "柳海真", meaning: "柳,海洋,真摯" },
{ name: "安聖基", meaning: "安,神聖,根基" },
{ name: "池昌旭", meaning: "池,昌盛,旭日" },
{ name: "程未眠", meaning: "长夜未眠,心有微光" },
{ name: "陆逐溪", meaning: "逐水而居,溪水长东" },
{ name: "言叙白", meaning: "言之凿凿,留白三分" },
{ name: "乔溯洄", meaning: "溯洄从之,道阻且长" },
{ name: "纪栖迟", meaning: "栖于迟暮,静候晨曦" },
{ name: "闻归止", meaning: "闻声即归,止戈为武" }
]
},
english: {
male: [
{ name: "James Williams", meaning: "替代者,保护者" },
{ name: "John Smith", meaning: "上帝仁慈,铁匠" },
{ name: "Robert Johnson", meaning: "光辉的名声,约翰之子" },
{ name: "Michael Brown", meaning: "谁像上帝,棕色头发" },
{ name: "William Davis", meaning: "意志坚强,大卫之子" },
{ name: "利奥·卡拉汉", meaning: "狮心壮志,头脑聪明" },
{ name: "伊莱亚斯·沃恩", meaning: "上帝是我的信仰,谦逊低调" },
{ name: "诺克斯·斯特林", meaning: "圆丘之巅,品质卓越" },
{ name: "罗南·皮尔斯", meaning: "小海豹般坚韧,如岩石般可靠" },
{ name: "索伦·怀尔德", meaning: "严肃认真,不羁自由" },
{ name: "吉迪恩·诺斯", meaning: "勇猛战士,北向征途" },
{ name: "卡西安·弗罗斯特", meaning: "思想深邃,冷静果决" },
{ name: "多里安·黑尔", meaning: "天赐之恩,远山幽谷" }
],
female: [
{ name: "Mary Johnson", meaning: "海之星,约翰之子" },
{ name: "Patricia Williams", meaning: "贵族,保护者" },
{ name: "Jennifer Smith", meaning: "白色波浪,铁匠" },
{ name: "Linda Brown", meaning: "美丽,棕色头发" },
{ name: "Elizabeth Davis", meaning: "上帝的誓言,大卫之子" },
{ name: "艾拉·门罗", meaning: "月光皎洁,河口之滨" },
{ name: "埃拉拉·奎因", meaning: "明星闪耀,智慧顾问" },
{ name: "芙蕾雅·辛克莱", meaning: "贵族淑女,清澈明亮" },
{ name: "艾薇·卡利奥佩", meaning: "忠诚不渝,美妙嗓音" },
{ name: "凯雅·罗斯威尔", meaning: "纯洁无瑕,著名泉源" },
{ name: "莉薇娅·海耶斯", meaning: "生命之力,树篱环绕之地" },
{ name: "米拉·埃利森", meaning: "奇妙非凡,埃利斯之子" },
{ name: "扎拉·温斯洛", meaning: "公主殿下,胜利之丘" }
],
unisex: [
{ name: "Taylor Clark", meaning: "裁缝,学者" },
{ name: "Jordan Lee", meaning: "向下流动,草地" }
]
},
japanese: {
male: [
{ name: "山田太郎", meaning: "山、田,大儿子" },
{ name: "佐藤健", meaning: "帮助、藤蔓,健康" },
{ name: "鈴木一郎", meaning: "铃、木,长子" },
{ name: "高橋大輝", meaning: "高、桥,大放光明" },
{ name: "小林直人", meaning: "小、林,正直的人" },
{ name: "神谷苍真", meaning: "神之谷,苍色真实" },
{ name: "黑川凛", meaning: "黑水之川,凛冽如霜" },
{ name: "秋月莲司", meaning: "秋月清朗,莲之雅司" },
{ name: "雾岛耀", meaning: "雾中岛屿,光芒乍现" },
{ name: "千叶征", meaning: "千叶繁生,征途万里" },
{ name: "久远寺朔夜", meaning: "古寺长夜,朔月无声" }
],
female: [
{ name: "佐藤美咲", meaning: "帮助、藤蔓,美丽绽放" },
{ name: "山本花子", meaning: "山、本,花的孩子" },
{ name: "中村愛", meaning: "中、村,爱" },
{ name: "田中優子", meaning: "田、中,优秀的孩子" },
{ name: "小林由美", meaning: "小、林,理由美丽" },
{ name: "朝仓雪乃", meaning: "朝仓晨雪,纯净无暇" },
{ name: "琴音澪", meaning: "琴音悠扬,清流澪澪" },
{ name: "白濑樱子", meaning: "白濑水岸,樱落成诗" },
{ name: "结城霞", meaning: "结城为念,霞色漫天" },
{ name: "柊真昼", meaning: "柊叶护荫,真昼永明" },
{ name: "冬马夕凪", meaning: "冬马行空,夕凪静海" }
],
unisex: [
{ name: "石川翔", meaning: "石、河,飞翔" },
{ name: "清水遥", meaning: "清、水,遥远" },
{ name: "天峰望", meaning: "天穹峰顶,极目远望" },
{ name: "神乐汐", meaning: "神之乐舞,潮汐如歌" },
{ name: "结衣空", meaning: "结衣为翼,长空无垠" },
{ name: "透真", meaning: "透明如镜,真我如一" }
]
},
korean: {
male: [
{ name: "金民俊", meaning: "金,人民,英俊" },
{ name: "李相宇", meaning: "李,互相,宇宙" },
{ name: "朴志勋", meaning: "朴,意志,功勋" },
{ name: "崔胜贤", meaning: "崔,胜利,贤明" },
{ name: "郑允浩", meaning: "郑,允许,浩大" },
{ name: "尹玄彬", meaning: "尹,深邃,彬彬有礼" },
{ name: "具晙会", meaning: "具,明亮,群英荟萃" },
{ name: "李宰旭", meaning: "李,主宰,旭日初升" },
{ name: "金曜汉", meaning: "金,闪耀,浩瀚无垠" },
{ name: "朴叙俊", meaning: "朴,叙述,俊逸非凡" },
{ name: "崔宇植", meaning: "崔,宇宙,植根天地" }
],
female: [
{ name: "金智秀", meaning: "金,智慧,秀丽" },
{ name: "李惠利", meaning: "李,恩惠,利益" },
{ name: "朴信惠", meaning: "朴,信任,恩惠" },
{ name: "宋智孝", meaning: "宋,智慧,孝顺" },
{ name: "全智贤", meaning: "全,智慧,贤明" },
{ name: "裴珠泫", meaning: "裴,珠光,泫然欲滴" },
{ name: "林娜琏", meaning: "林,优雅,琏琏如玉" },
{ name: "金珉周", meaning: "金,珉玉,周全温婉" },
{ name: "申留真", meaning: "申,停留,真挚如初" },
{ name: "张员瑛", meaning: "张,圆满,瑛瑛若玉" },
{ name: "李瑞渊", meaning: "李,瑞兆,渊博如海" }
],
unisex: [
{ name: "申惠善", meaning: "申,恩惠,善良" },
{ name: "韩智旻", meaning: "韩,智慧,敏捷" },
{ name: "河成云", meaning: "河,成就,云端之上" },
{ name: "宋夏星", meaning: "宋,盛夏,星光熠熠" },
{ name: "李洙赫", meaning: "李,水泽,赫然有声" },
{ name: "安普贤", meaning: "安,普及,贤良方正" }
]
},
french: {
male: [
{ name: "Jean Dubois", meaning: "上帝仁慈,树林" },
{ name: "Pierre Martin", meaning: "石头,战神" },
{ name: "Thomas Bernard", meaning: "双生子,勇敢的熊" },
{ name: "Michel Petit", meaning: "谁像上帝,小" },
{ name: "Philippe Moreau", meaning: "爱马者,黑皮肤" }
],
female: [
{ name: "Marie Dupont", meaning: "海之星,桥" },
{ name: "Sophie Laurent", meaning: "智慧,月桂花环" },
{ name: "Isabelle Leroy", meaning: "上帝的誓言,国王" },
{ name: "Julie Michel", meaning: "年轻,谁像上帝" },
{ name: "Catherine Richard", meaning: "纯洁,强大的统治者" },
{ name: "埃朗·马雷", meaning: "一往无前,沼泽湿地" },
{ name: "索拉尔·迪弗雷斯内", meaning: "如日中天,源自灰烬" },
{ name: "坦吉·布兰维尔", meaning: "烈火忠犬,白色城镇" },
{ name: "罗米·卢瓦佐", meaning: "迷迭香般芬芳,小鸟依人" }
],
unisex: [
{ name: "Camille Rousseau", meaning: "完美,红发" },
{ name: "Dominique Lefevre", meaning: "属于主,铁匠" },
{ name: "Alex Martin", meaning: "保卫者,战神" },
{ name: "Charlie Dubois", meaning: "自由人,树林" },
{ name: "Sam Bernard", meaning: "上帝之名,勇敢的熊" },
{ name: "Jules Petit", meaning: "年轻,小" },
{ name: "Max Moreau", meaning: "最伟大的,黑皮肤" },
{ name: "Lou Leroy", meaning: "著名的战士,国王" },
{ name: "Yan Richard", meaning: "上帝是仁慈的,强大的统治者" },
{ name: "Noa Laurent", meaning: "平静,月桂花环" }
]
},
// 网名数据库
internet: {
unisex: [
{ name: "浮岚若梦", meaning: "山岚轻飘,似真似幻" },
{ name: "朽木生花", meaning: "枯朽之上开出奇迹之花" },
{ name: "星坠未晞", meaning: "星辰陨落,天光未明" },
{ name: "鲸落万川", meaning: "巨鲸沉落,万物得养" },
{ name: "羽化箴言", meaning: "轻羽飞升,真言传世" },
{ name: "听潮忘川", meaning: "潮声低语,忘却尘世" },
{ name: "青简旧墨", meaning: "竹简青苍,墨香犹存" },
{ name: "雾隐青灯", meaning: "雾色深处,青灯不灭" },
{ name: "空山凝雪", meaning: "空山幽寂,雪落无声" },
{ name: "云鲸旅者", meaning: "乘云之鲸,巡天遨游" },
{ name: "疏影横斜", meaning: "梅影横窗,水清浅斜" },
{ name: "长夜烛火", meaning: "漫漫长夜,独燃微烛" },
{ name: "最后一台收音机", meaning: "文明崩塌后,唯一传递外界信息的希望载体" },
{ name: "温室里的向日葵", meaning: "末世中,人类对自然与光明的执着守护" },
{ name: "编号73的记忆碎片", meaning: "在失忆的幸存者中,拼凑世界毁灭的真相" },
{ name: "暗夜星辰", meaning: "黑暗中的光明希望" },
{ name: "墨染流年", meaning: "岁月如墨般沉淀" },
{ name: "清风徐来", meaning: "缓缓而来的清新之风" },
{ name: "孤影随行", meaning: "孤独中前行的身影" },
{ name: "云端漫步", meaning: "在云端自由行走" },
{ name: "时光旅行者", meaning: "穿越时空的探险家" },
{ name: "星河长明", meaning: "永恒闪耀的星辰" },
{ name: "寂静之声", meaning: "宁静中的内心声音" },
{ name: "幻影刺客", meaning: "神秘而致命的影子" },
{ name: "雨落倾城", meaning: "如雨般倾城的美丽" },
{ name: "DarkKnight", meaning: "守护黑暗的骑士" },
{ name: "SilentWalker", meaning: "沉默的漫步者" },
{ name: "CosmicTraveler", meaning: "宇宙旅行者" },
{ name: "EternalFlame", meaning: "永恒不灭的火焰" },
{ name: "PhantomShadow", meaning: "幻影般的影子" },
{ name: "MidnightDreamer", meaning: "午夜的梦想家" },
{ name: "ElectricSoul", meaning: "充满活力的灵魂" },
{ name: "NeonGhost", meaning: "霓虹灯下的幽灵" },
{ name: "StellarVoyager", meaning: "星际航行者" },
{ name: "QuantumLeaper", meaning: "量子跳跃者" },
{ name: "星尘遗落的坐标", meaning: "星际文明消亡后留下的神秘定位信息" },
{ name: "时间褶皱里的信", meaning: "在时空扭曲处发现的跨越纪元的信件" },
{ name: "硅基纪元的乡愁", meaning: "人工智能产生自我意识后对碳基文明的眷恋" },
{ name: "雨天消失的指纹", meaning: "一场大雨后,关键证据离奇消失的悬案" },
{ name: "钟表匠的最后齿轮", meaning: "老钟表匠去世后,藏在机械中的秘密线索" },
{ name: "镜子里的第三个人", meaning: "镜像世界中出现的未知存在引发的谜团" },
{ name: "晚秋信箱的回信", meaning: "多年后收到年少时投递的匿名情书的回应" },
{ name: "地铁末班车的约定", meaning: "在城市深夜交通线上悄然萌芽的爱情承诺" },
{ name: "褪色邮票上的地址", meaning: "通过旧邮票追溯到的跨国爱恋往事" },
{ name: "未来的自己", meaning: "展望未来的自己,充满希望" },
{ name: "记忆中的过去", meaning: "回顾过去的记忆,充满回忆" },
{ name: "未知的未来", meaning: "展望未知的未来,充满未知" },
{ name: "情感的力量", meaning: "情感是力量的来源,是连接我们的桥梁" },
{ name: "长安街的最后灯笼", meaning: "王朝覆灭前夜,京城最后一盏未熄灭的灯火" },
{ name: "敦煌壁画里的驼铃", meaning: "从千年壁画中传出的、连接古今的商队铃声" },
{ name: "军机大臣的密折", meaning: "清代军机大臣留存的未完成密令背后的故事" },
{ name: "会流泪的琉璃城", meaning: "由有生命的琉璃建成、能感知情绪的奇幻都市" },
{ name: "风语者的遗忘诗", meaning: "掌握风之语言的族群逐渐失传的古老歌谣" },
{ name: "月光浇筑的钥匙", meaning: "用月光凝固而成、能打开异次元的神秘钥匙" },
{ name: "霁月孤光", meaning: "雨霁天青,孤轮清辉" },
{ name: "霜雪千年", meaning: "霜华似雪,跨越千年" },
{ name: "镜湖月影", meaning: "湖面如镜,月影横斜" },
{ name: "风掠寒灯", meaning: "长风忽至,寒灯摇曳" },
{ name: "潮汐旅人", meaning: "随潮汐往复的漂泊者" },
{ name: "雾散听风", meaning: "雾散云开,且听风吟" },
{ name: "EchoBreeze", meaning: "随风回响的低语" },
{ name: "LunaCircuit", meaning: "月之轨迹" },
{ name: "PixelNomad", meaning: "像素游牧者" },
{ name: "ZenithWanderer", meaning: "巅峰漫游者" },
{ name: "FrostEcho", meaning: "霜之回声" },
{ name: "CrimsonDrift", meaning: "深红漂移" },
{ name: "VelvetAbyss", meaning: "天鹅绒般柔软的深渊" },
{ name: "SolarFlareFox", meaning: "耀斑赤狐" },
{ name: "AzureSpecter", meaning: "蔚蓝幻影" },
{ name: "ObsidianWaltz", meaning: "黑曜圆舞" },
{ name: "蝉鸣不止的夏天", meaning: "关于夏日限定的少年心事与成长阵痛" },
{ name: "草稿本里的未寄信", meaning: "藏在字迹里的青涩暗恋与时光印记" },
{ name: "毕业照后的留白处", meaning: "青春散场后,各自奔赴的未知人生" },
{ name: "月之轨迹", meaning: "月之轨迹" },
{ name: "像素游牧者", meaning: "像素游牧者" },
{ name: "巅峰漫游者", meaning: "巅峰漫游者" },
{ name: "霜之回声", meaning: "霜之回声" },
{ name: "深红漂移", meaning: "深红漂移" },
{ name: "天鹅绒般柔软的深渊", meaning: "天鹅绒般柔软的深渊" },
{ name: "凌晨三点的菜市场", meaning: "聚焦城市凌晨的市井人生与生存百态" },
{ name: "写字楼里的绿萝日记", meaning: "以办公室绿植为视角,记录职场格子间里的职场故事" },
{ name: "拆迁区的最后一盏灯", meaning: "旧城改造中,坚守与变迁的人情冷暖" },
{ name: "断剑山庄的第三场雪", meaning: "江湖恩怨中,等待二十年的复仇与和解" },
{ name: "说书人未讲完的结局", meaning: "被刻意隐瞒的武林秘史与人物真相" },
{ name: "兵器谱外的锈刀客", meaning: "不被记载的平凡武者,藏着颠覆江湖的故事" }
]
}
};
|
2201_75876277/Open-Source-Debut
|
js/data.js
|
JavaScript
|
unknown
| 21,266
|
// 获取随机文化
function getRandomCulture() {
const cultures = Object.keys(nameDatabase).filter(c => c !== 'internet');
return cultures[Math.floor(Math.random() * cultures.length)];
}
// 获取文化名称
function getCultureName(cultureCode) {
const cultureNames = {
chinese: "中文",
english: "英文",
japanese: "日文",
korean: "韩文",
french: "法文",
internet: "创意网名"
};
return cultureNames[cultureCode] || cultureCode;
}
|
2201_75876277/Open-Source-Debut
|
js/utils.js
|
JavaScript
|
unknown
| 618
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title>wei | MC万岁!</title>
<meta name="generator" content="hexo-theme-ayer">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/dist/main.css">
<link rel="stylesheet" href="/css/fonts/remixicon.css">
<link rel="stylesheet" href="/css/custom.css">
<script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>
<!-- mermaid -->
<style>
.swal2-styled.swal2-confirm {
font-size: 1.6rem;
}
</style>
<link rel="alternate" href="/atom.xml" title="MC万岁!" type="application/atom+xml">
</head>
</html>
</html>
<body>
<div id="app">
<canvas width="1777" height="841"
style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
<main class="content on">
<section class="outer">
<article
id="post-wei"
class="article article-type-post"
itemscope
itemprop="blogPost"
data-scroll-reveal
>
<div class="article-inner">
<header class="article-header">
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
wei
</h1>
</header>
<div class="article-meta">
<a href="/2025/05/10/wei/" class="article-date">
<time datetime="2025-05-10T02:30:19.000Z" itemprop="datePublished">2025-05-10</time>
</a>
<div class="word_count">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="ri-quill-pen-line"></i>
<span class="post-meta-item-text"> Word count:</span>
<span class="post-count">425</span>
</span>
</span>
<span class="post-time">
|
<span class="post-meta-item-icon">
<i class="ri-book-open-line"></i>
<span class="post-meta-item-text"> Reading time≈</span>
<span class="post-count">1 min</span>
</span>
</span>
</div>
</div>
<div class="article-entry" itemprop="articleBody">
<p>作为开发,日常是离不开代码托管平台的。不然 git 代码往哪提交,代码万一丢了或电脑坏了怎么办?</p>
<p>今天给大家总结下5大免费代码托管平台:</p>
<p>CODING DevOps 是一站式软件研发管理协作平台</p>
<p><a target="_blank" rel="noopener" href="https://coding.net/">https://coding.net/</a></p>
<p>CODING DevOps 是一站式软件研发管理协作平台,提供 Git/SVN 代码托管、项目协同、测试管理、制品库、CI/CD 等一系列在线工具,帮助研发团队快速落地敏捷开发与 DevOps 开发方式,提升研发管理效率,实现研发效能升级。</p>
<p><a target="_blank" rel="noopener" href="http://gitee.com(码云)/">http://Gitee.com(码云)</a> 是 <a target="_blank" rel="noopener" href="http://oschina.net/">http://OSCHINA.NET</a> 推出的代码托管平台</p>
<p><a target="_blank" rel="noopener" href="https://gitee.com/">https://gitee.com/</a></p>
<p><a target="_blank" rel="noopener" href="http://gitee.com(码云)/">http://Gitee.com(码云)</a> 是 <a target="_blank" rel="noopener" href="http://oschina.net/">http://OSCHINA.NET</a> 推出的代码托管平台,支持 Git 和 SVN,提供免费的私有仓库托管。目前已有超过 800 万的开发者选择 Gitee。</p>
<p>GitCode——开源代码托管平台,独立第三方开源社区,Git/Github/Gitlab。</p>
<p><a target="_blank" rel="noopener" href="https://gitcode.net/">https://gitcode.net/</a></p>
<p>GitCode——开源代码托管平台,独立第三方开源社区,Git/Github/Gitlab。</p>
<p>github</p>
<p><a target="_blank" rel="noopener" href="https://github.com/">https://github.com/</a></p>
<p>这个就不用介绍了吧。</p>
<p>gitlab 开独立部署也可免费使用的代码托管平台。</p>
<p><a target="_blank" rel="noopener" href="https://about.gitlab.com/">https://about.gitlab.com/</a></p>
<p>开独立部署也可免费使用的代码托管平台。</p>
<p>Bitbucket 是面向专业团队的 Git 解决方案。Bitbucket Cloud 可供成员数量不超过 5 人的团队免费使用</p>
<p><a target="_blank" rel="noopener" href="https://www.atlassian.com/zh/software/bitbucket/pricing">https://www.atlassian.com/zh/software/bitbucket/pricing</a></p>
<p>atlassian 出品,也是一个老牌代码托管平台了。Bitbucket 是面向专业团队的 Git 解决方案。Bitbucket Cloud 可供成员数量不超过 5 人的团队免费使用。</p>
<!-- reward -->
</div>
<!-- copyright -->
<div class="declare">
<ul class="post-copyright">
<li>
<i class="ri-copyright-line"></i>
<strong>Copyright: </strong>
Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
</li>
</ul>
</div>
<footer class="article-footer">
<div class="share-btn">
<span class="share-sns share-outer">
<i class="ri-share-forward-line"></i>
分享
</span>
<div class="share-wrap">
<i class="arrow"></i>
<div class="share-icons">
<a class="weibo share-sns" href="javascript:;" data-type="weibo">
<i class="ri-weibo-fill"></i>
</a>
<a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
<i class="ri-wechat-fill"></i>
</a>
<a class="qq share-sns" href="javascript:;" data-type="qq">
<i class="ri-qq-fill"></i>
</a>
<a class="douban share-sns" href="javascript:;" data-type="douban">
<i class="ri-douban-line"></i>
</a>
<!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
<i class="icon icon-qzone"></i>
</a> -->
<a class="facebook share-sns" href="javascript:;" data-type="facebook">
<i class="ri-facebook-circle-fill"></i>
</a>
<a class="twitter share-sns" href="javascript:;" data-type="twitter">
<i class="ri-twitter-fill"></i>
</a>
<a class="google share-sns" href="javascript:;" data-type="google">
<i class="ri-google-fill"></i>
</a>
</div>
</div>
</div>
<div class="wx-share-modal">
<a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
<p>扫一扫,分享到微信</p>
<div class="wx-qrcode">
<img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://example.com/2025/05/10/wei/" alt="微信分享二维码">
</div>
</div>
<div id="share-mask"></div>
</footer>
</div>
<script src="https://cdn.staticfile.org/twikoo/1.4.18/twikoo.all.min.js"></script>
<div id="twikoo" class="twikoo"></div>
<script>
twikoo.init({
envId: ""
})
</script>
</article>
</section>
<footer class="footer">
<div class="outer">
<ul>
<li>
Copyrights ©
2015-2025
<i class="ri-heart-fill heart_icon"></i> John Doe
</li>
</ul>
<ul>
<li>
</li>
</ul>
<ul>
<li>
<span>
<span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
<span class="division">|</span>
<span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
</li>
</ul>
<ul>
</ul>
<ul>
</ul>
<ul>
<li>
<!-- cnzz统计 -->
<script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&web_id=1278069914'></script>
</li>
</ul>
</div>
</footer>
</main>
<div class="float_btns">
<div class="totop" id="totop">
<i class="ri-arrow-up-line"></i>
</div>
<div class="todark" id="todark">
<i class="ri-moon-line"></i>
</div>
</div>
<aside class="sidebar on">
<button class="navbar-toggle"></button>
<nav class="navbar">
<div class="logo">
<a href="/"><img src="/images/ayer-side.svg" alt="MC万岁!"></a>
</div>
<ul class="nav nav-main">
<li class="nav-item">
<a class="nav-item-link" href="/">主页</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/archives">归档</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/categories">分类</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags">标签</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1WxGizsEv5/?spm_id_from=333.1387.homepage.video_card.click&vd_source=4ed0b065e620133f260030c3bf3b5a3c">友链</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://space.bilibili.com/1592207972?spm_id_from=333.337.0.0">关于我</a>
</li>
</ul>
</nav>
<nav class="navbar navbar-bottom">
<ul class="nav">
<li class="nav-item">
<a class="nav-item-link nav-item-search" title="Search">
<i class="ri-search-line"></i>
</a>
<a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
<i class="ri-rss-line"></i>
</a>
</li>
</ul>
</nav>
<div class="search-form-wrap">
<div class="local-search local-search-plugin">
<input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
<div id="local-search-result" class="local-search-result"></div>
</div>
</div>
</aside>
<div id="mask"></div>
<!-- #reward -->
<div id="reward">
<span class="close"><i class="ri-close-line"></i></span>
<p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
<div class="reward-box">
<div class="reward-item">
<img class="reward-img" src="/images/alipay.jpg">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-item">
<img class="reward-img" src="/images/wechat.jpg">
<span class="reward-type">微信</span>
</div>
</div>
</div>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/lazyload.min.js"></script>
<!-- Tocbot -->
<script src="/js/tocbot.min.js"></script>
<script>
tocbot.init({
tocSelector: ".tocbot",
contentSelector: ".article-entry",
headingSelector: "h1, h2, h3, h4, h5, h6",
hasInnerContainers: true,
scrollSmooth: true,
scrollContainer: "main",
positionFixedSelector: ".tocbot",
positionFixedClass: "is-position-fixed",
fixedSidebarOffset: "auto",
});
</script>
<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>
<script src="/dist/main.js"></script>
<!-- ImageViewer -->
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
<script>
function viewer_init() {
let pswpElement = document.querySelectorAll('.pswp')[0];
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
$imgArr.forEach(($em, i) => {
$em.onclick = () => {
// slider展开状态
// todo: 这样不好,后面改成状态
if (document.querySelector('.left-col.show')) return
let items = []
$imgArr.forEach(($em2, i2) => {
let img = $em2.getAttribute('data-idx', i2)
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
let title = $em2.getAttribute('alt')
// 获得原图尺寸
const image = new Image()
image.src = src
items.push({
src: src,
w: image.width || $em2.width,
h: image.height || $em2.height,
title: title
})
})
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
index: parseInt(i)
});
gallery.init()
}
})
}
viewer_init()
</script>
<!-- MathJax -->
<!-- Katex -->
<!-- busuanzi -->
<script src="/js/busuanzi-2.3.pure.min.js"></script>
<!-- ClickLove -->
<!-- ClickBoom1 -->
<!-- ClickBoom2 -->
<script src="/js/clickBoom2.js"></script>
<!-- CodeCopy -->
<link rel="stylesheet" href="/css/clipboard.css">
<script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
function wait(callback, seconds) {
var timelag = null;
timelag = window.setTimeout(callback, seconds);
}
!function (e, t, a) {
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
$(".article pre code").before(copyHtml);
var clipboard = new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
clipboard.on('success', function(e) {
let $btn = $(e.trigger);
$btn.addClass('copied');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-checkbox-circle-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPIED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-checkbox-circle-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
clipboard.on('error', function(e) {
e.clearSelection();
let $btn = $(e.trigger);
$btn.addClass('copy-failed');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-time-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPY FAILED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-time-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
}
initCopyCode();
}(window, document);
</script>
<!-- CanvasBackground -->
<script src="/js/dz.js"></script>
<script>
if (window.mermaid) {
mermaid.initialize({ theme: "forest" });
}
</script>
<div id="music">
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
src="//music.163.com/outchain/player?type=2&id=22707008&auto=0&height=32"></iframe>
</div>
<style>
#music {
position: fixed;
right: 15px;
bottom: 0;
z-index: 998;
}
</style>
</div>
</body>
</html>
|
2201_75607095/blog
|
2025/05/10/wei/index.html
|
HTML
|
unknown
| 19,113
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>404</title>
<meta name="keywords" content="Hexo,Ayer,404,Design" />
<meta name="description" content="hexo theme ayer page 404." />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<style>
html,
figure {
margin: 0;
padding: 0;
overflow-x: hidden;
}
body {
margin: 20px;
overflow: hidden;
}
h1,
h3 {
width: 100%;
text-align: center;
color: #403e3e;
}
h3 a {
color: #0681d0;
}
.forrestgump img {
width: 52rem;
margin-left: 50%;
transform: translateX(-50%);
border-radius: 5%;
opacity: 0.8;
}
@media screen and (max-width: 768px) {
.forrestgump img {
width: 100%;
}
}
</style>
</head>
<body>
<div class="notfound">
<a class="notfound-link" href="/">
<img
width="40"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAGq0lEQVR4Xu1bXahUVRT+1pnxvRexNIT8iYz+SBOuzt6zx5uaWQ9FJulDSillaUpaUUZK2Q9ZaZYlSWmUVjeKyjAFnX32GTRSIaISMqVIr0gP+X5nzop9nXM583/m3Jmr3HHDvMxZ+1trfWf/rL32OoQOb9Th/uMyAZdHwBAyMGPatPH5ZHK8wzwOROMB2J9tJ8F80ic6lcznTx48dOjkUJnV1inQLcRNBaJZBMxkYFaTTn1HRHsKzJ4x5niTfSOLt5wApdQt8P1FALoB3BDZknqCRMfA7MFxdmqtf24JZhGkZQRIKSc6wDIAjwEY0chIAnqZ6CwzEwGjAVzZqA+APgDv+sBWY8yJCPINRQZNwIyurjGFZHIZEVnnr6ih0WPmHof5UJ6o1/O8s+Vy8+bNS/zX2zumL5kcA99XRHQ3gK4aeOeZeWsin9968PDhMw29rCMwKAKUUlPg+x8DmFShg/kHBvYXmL/J5XKn4hiplJrAzHOIeQ4A+ytvJ4h5edbz9sXBt31iEzBDSukDBwAky5QfIWBT1phdcY2q1i8j5QIGVgK4rex5AcBD2pidcfTFIiAjxFwm2lOm8DSATSNHjdrU09NjjWp5s9Pk33PnLAn2d3WZgpXamM3NKm2aACXlCwDWlSgi+jJRKDx9IOZQb9ZopdR1xalXPhrWa2NKbWsA3hQBSson7Fsuw1yrjdnQrBOtkFdSHgSQCWMR811Zz/s+Kn5kApSUDwLYUaIMmJ815ouoytohlxHiQyZaHMZ2gPRBY0wUfZEIyAgxm4ksq4kBUObF2vNKCImisB0yaSFeI6KnQth5OE6X1vpoI30NCbD7vD9iRBbAxACMmHdnPW9BI/ChfK6k3G53g5DO405f38xGcUJDAtJCbCCiZ0NvXmvPK5l3Q+loPV1KSrszzQ1kmPll1/Oeq9enLgHF8PanUIR3OuH73QdyuT8uFafDdtjACb5vR2uwRZ73gan1wua6BCgp3yruuYGe1dqYNy5F5wOblJRPAtgYsnGTNmZVLZtrElA81dm3HxxsjowcNaqrXUFOq0gtBkuHQxFjHxxnaq1TZG0Cyt4+AQtbEd4qKdcRsISBvXCcV7XWf7bK+QCnGDZ/GsLdrI2x0WNFq01AOn0UzJOLPfZqY+4crKFKyrUAXhxYpIhWuK67ZbC41forIfaC6I7is1+1MTdGJkBKOckBfg8Zusx13fcGY6iS8hkAr5Rg+H5G53J6MLi1+iopVwN4PXieYL75gOf9Ui5fdQRk0umlzLwtEPaBscaYf+IaWm5MEed5bcxLcTEb9esW4voC0W8huTXamPDi2P+oKgFKym8B2IQE7JneNWZ2I4U134QQK0Fkd5Nwq2pMXB21+qWlPEbArUVH92er+FGLAB4AZX5Ue977cYxTQjwOotI5zrxce947cfCa7WMXXAD29NrftDEV/lb8YVPXfjI5sDKT70/J5nLHmlYuxCMgKlk3mGip67ofNIsVVz6dTncR86Ggv5PPTyhPuVcQIKWc5QADKaYC8+hqObx6RikhHgZRuaOL4mZt4hJw+/TpY/OJxN9Bfx+YbYzZH8arIECVvblqw6aB84tA9FFYhokWuK67O64jcfsVg6J8velcSYCUduuwW4hdIXuzxoyJaoCSciGAT0rkmVu7zRHtg+//GHX7VFLaDHSQct+ojVlTfwRI+RWAe/qFiI5p150ShQAl5XwAn0WRHbQM0Xbtukui4IR3AgBfa2Pu7SgCVGlEG4mAYTUFMlKe4Qs3T7ZFmALDaBG0Hisp68Y0w3obFEJclSDqbWobHE6BUCaVmsyOM5AYjRQIRRk2UVbffpyLHAqnhVhORG8H9kYKhYsEDIvDkJLS3g2IYkwT/TA0HI7DqVRqXNJxwqU20Y/DwyEhkhZiFRG9GQz/phIi/dOgk1NixXWgJCXeeUnRC8VOnZsWrzYK7CmxYy5GLAHVrsbgOJl25PKjxhb15LpTqXEFx3FbdjVmlVVcjgItuSNohcPlGCqd7gHzfcH/g74ctUA1rse3ZD1vRTuciIuppLS3wOE0e2uux61B1Qok4iZL4zpYr19GyvsZ+Dwk07oCiQC0WokMHOcarfVf7XAqKqYSoiIH2fISmRAJlUVSF7FUJiPELiZ6IExW24qkQiRUK5PbAaL1QzUaulOpawtE20CkykZKe8vkAmUdXSgZkNDRpbID06GTi6UHRkInl8uHF6CO/WCiIhzt1E9mqgUuHfnRVL0IruM+m4sazl5MuYa1whfTuKHQfZmAoWD5UtbxPw6Pum6CDZJRAAAAAElFTkSuQmCC"
/>
</a>
<figure class="forrestgump">
<figcaption>
<h1>404<br />Not Found!</h1>
<h3>
Please check it, Maybe you should read
<a href="https://hexo.io/docs/">Hexo</a> and
<a href="https://github.com/Shen-Yu/hexo-theme-ayer">Ayer</a> Docs
carefully.
</h3>
<h3>
亲,获取不到该路径的页面呢,请检查一下哦,可能你还需要仔细阅读
<a href="https://hexo.io/docs/">Hexo</a> 和
<a href="https://shen-yu.gitee.io/2019/ayer/">Ayer</a> 的说明文档~
</h3>
</figcaption>
<img src="https://tvax4.sinaimg.cn/large/9156bd04ly1gzofhomcm4j20zk0p5jrw.jpg" />
</figure>
</div>
</body>
</html>
|
2201_75607095/blog
|
404.html
|
HTML
|
unknown
| 4,264
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title>Archives: 2025/5 | MC万岁!</title>
<meta name="generator" content="hexo-theme-ayer">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/dist/main.css">
<link rel="stylesheet" href="/css/fonts/remixicon.css">
<link rel="stylesheet" href="/css/custom.css">
<script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>
<!-- mermaid -->
<style>
.swal2-styled.swal2-confirm {
font-size: 1.6rem;
}
</style>
<link rel="alternate" href="/atom.xml" title="MC万岁!" type="application/atom+xml">
</head>
</html>
</html>
<body>
<div id="app">
<canvas width="1777" height="841"
style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
<main class="content on">
<section class="outer">
<article class="articles">
<h1 class="page-type-title">2025/5</h1>
<div class="archives-wrap">
<div class="archive-year-wrap">
<a href="/archives/2025" class="archive-year">2025</a>
</div>
<div class="archives">
<article class="archive-article archive-type-post">
<div class="archive-article-inner">
<header class="archive-article-header">
<a href="/2025/05/10/wei/" class="archive-article-date">
<time datetime="2025-05-10T02:30:19.000Z" itemprop="datePublished">05/10</time>
</a>
<h2 itemprop="name">
<a class="archive-article-title" href="/2025/05/10/wei/"
>wei</a>
</h2>
</header>
</div>
</article>
</div>
</div>
</section>
<footer class="footer">
<div class="outer">
<ul>
<li>
Copyrights ©
2015-2025
<i class="ri-heart-fill heart_icon"></i> John Doe
</li>
</ul>
<ul>
<li>
</li>
</ul>
<ul>
<li>
<span>
<span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
<span class="division">|</span>
<span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
</li>
</ul>
<ul>
</ul>
<ul>
</ul>
<ul>
<li>
<!-- cnzz统计 -->
<script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&web_id=1278069914'></script>
</li>
</ul>
</div>
</footer>
</main>
<div class="float_btns">
<div class="totop" id="totop">
<i class="ri-arrow-up-line"></i>
</div>
<div class="todark" id="todark">
<i class="ri-moon-line"></i>
</div>
</div>
<aside class="sidebar on">
<button class="navbar-toggle"></button>
<nav class="navbar">
<div class="logo">
<a href="/"><img src="/images/ayer-side.svg" alt="MC万岁!"></a>
</div>
<ul class="nav nav-main">
<li class="nav-item">
<a class="nav-item-link" href="/">主页</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/archives">归档</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/categories">分类</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags">标签</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1WxGizsEv5/?spm_id_from=333.1387.homepage.video_card.click&vd_source=4ed0b065e620133f260030c3bf3b5a3c">友链</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://space.bilibili.com/1592207972?spm_id_from=333.337.0.0">关于我</a>
</li>
</ul>
</nav>
<nav class="navbar navbar-bottom">
<ul class="nav">
<li class="nav-item">
<a class="nav-item-link nav-item-search" title="Search">
<i class="ri-search-line"></i>
</a>
<a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
<i class="ri-rss-line"></i>
</a>
</li>
</ul>
</nav>
<div class="search-form-wrap">
<div class="local-search local-search-plugin">
<input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
<div id="local-search-result" class="local-search-result"></div>
</div>
</div>
</aside>
<div id="mask"></div>
<!-- #reward -->
<div id="reward">
<span class="close"><i class="ri-close-line"></i></span>
<p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
<div class="reward-box">
<div class="reward-item">
<img class="reward-img" src="/images/alipay.jpg">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-item">
<img class="reward-img" src="/images/wechat.jpg">
<span class="reward-type">微信</span>
</div>
</div>
</div>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/lazyload.min.js"></script>
<!-- Tocbot -->
<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>
<script src="/dist/main.js"></script>
<!-- ImageViewer -->
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
<script>
function viewer_init() {
let pswpElement = document.querySelectorAll('.pswp')[0];
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
$imgArr.forEach(($em, i) => {
$em.onclick = () => {
// slider展开状态
// todo: 这样不好,后面改成状态
if (document.querySelector('.left-col.show')) return
let items = []
$imgArr.forEach(($em2, i2) => {
let img = $em2.getAttribute('data-idx', i2)
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
let title = $em2.getAttribute('alt')
// 获得原图尺寸
const image = new Image()
image.src = src
items.push({
src: src,
w: image.width || $em2.width,
h: image.height || $em2.height,
title: title
})
})
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
index: parseInt(i)
});
gallery.init()
}
})
}
viewer_init()
</script>
<!-- MathJax -->
<!-- Katex -->
<!-- busuanzi -->
<script src="/js/busuanzi-2.3.pure.min.js"></script>
<!-- ClickLove -->
<!-- ClickBoom1 -->
<!-- ClickBoom2 -->
<script src="/js/clickBoom2.js"></script>
<!-- CodeCopy -->
<link rel="stylesheet" href="/css/clipboard.css">
<script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
function wait(callback, seconds) {
var timelag = null;
timelag = window.setTimeout(callback, seconds);
}
!function (e, t, a) {
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
$(".article pre code").before(copyHtml);
var clipboard = new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
clipboard.on('success', function(e) {
let $btn = $(e.trigger);
$btn.addClass('copied');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-checkbox-circle-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPIED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-checkbox-circle-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
clipboard.on('error', function(e) {
e.clearSelection();
let $btn = $(e.trigger);
$btn.addClass('copy-failed');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-time-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPY FAILED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-time-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
}
initCopyCode();
}(window, document);
</script>
<!-- CanvasBackground -->
<script src="/js/dz.js"></script>
<script>
if (window.mermaid) {
mermaid.initialize({ theme: "forest" });
}
</script>
<div id="music">
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
src="//music.163.com/outchain/player?type=2&id=22707008&auto=0&height=32"></iframe>
</div>
<style>
#music {
position: fixed;
right: 15px;
bottom: 0;
z-index: 998;
}
</style>
</div>
</body>
</html>
|
2201_75607095/blog
|
archives/2025/05/index.html
|
HTML
|
unknown
| 13,284
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title>Archives: 2025 | MC万岁!</title>
<meta name="generator" content="hexo-theme-ayer">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/dist/main.css">
<link rel="stylesheet" href="/css/fonts/remixicon.css">
<link rel="stylesheet" href="/css/custom.css">
<script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>
<!-- mermaid -->
<style>
.swal2-styled.swal2-confirm {
font-size: 1.6rem;
}
</style>
<link rel="alternate" href="/atom.xml" title="MC万岁!" type="application/atom+xml">
</head>
</html>
</html>
<body>
<div id="app">
<canvas width="1777" height="841"
style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
<main class="content on">
<section class="outer">
<article class="articles">
<h1 class="page-type-title">2025</h1>
<div class="archives-wrap">
<div class="archive-year-wrap">
<a href="/archives/2025" class="archive-year">2025</a>
</div>
<div class="archives">
<article class="archive-article archive-type-post">
<div class="archive-article-inner">
<header class="archive-article-header">
<a href="/2025/05/10/wei/" class="archive-article-date">
<time datetime="2025-05-10T02:30:19.000Z" itemprop="datePublished">05/10</time>
</a>
<h2 itemprop="name">
<a class="archive-article-title" href="/2025/05/10/wei/"
>wei</a>
</h2>
</header>
</div>
</article>
</div>
</div>
</section>
<footer class="footer">
<div class="outer">
<ul>
<li>
Copyrights ©
2015-2025
<i class="ri-heart-fill heart_icon"></i> John Doe
</li>
</ul>
<ul>
<li>
</li>
</ul>
<ul>
<li>
<span>
<span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
<span class="division">|</span>
<span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
</li>
</ul>
<ul>
</ul>
<ul>
</ul>
<ul>
<li>
<!-- cnzz统计 -->
<script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&web_id=1278069914'></script>
</li>
</ul>
</div>
</footer>
</main>
<div class="float_btns">
<div class="totop" id="totop">
<i class="ri-arrow-up-line"></i>
</div>
<div class="todark" id="todark">
<i class="ri-moon-line"></i>
</div>
</div>
<aside class="sidebar on">
<button class="navbar-toggle"></button>
<nav class="navbar">
<div class="logo">
<a href="/"><img src="/images/ayer-side.svg" alt="MC万岁!"></a>
</div>
<ul class="nav nav-main">
<li class="nav-item">
<a class="nav-item-link" href="/">主页</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/archives">归档</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/categories">分类</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags">标签</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1WxGizsEv5/?spm_id_from=333.1387.homepage.video_card.click&vd_source=4ed0b065e620133f260030c3bf3b5a3c">友链</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://space.bilibili.com/1592207972?spm_id_from=333.337.0.0">关于我</a>
</li>
</ul>
</nav>
<nav class="navbar navbar-bottom">
<ul class="nav">
<li class="nav-item">
<a class="nav-item-link nav-item-search" title="Search">
<i class="ri-search-line"></i>
</a>
<a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
<i class="ri-rss-line"></i>
</a>
</li>
</ul>
</nav>
<div class="search-form-wrap">
<div class="local-search local-search-plugin">
<input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
<div id="local-search-result" class="local-search-result"></div>
</div>
</div>
</aside>
<div id="mask"></div>
<!-- #reward -->
<div id="reward">
<span class="close"><i class="ri-close-line"></i></span>
<p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
<div class="reward-box">
<div class="reward-item">
<img class="reward-img" src="/images/alipay.jpg">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-item">
<img class="reward-img" src="/images/wechat.jpg">
<span class="reward-type">微信</span>
</div>
</div>
</div>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/lazyload.min.js"></script>
<!-- Tocbot -->
<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>
<script src="/dist/main.js"></script>
<!-- ImageViewer -->
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
<script>
function viewer_init() {
let pswpElement = document.querySelectorAll('.pswp')[0];
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
$imgArr.forEach(($em, i) => {
$em.onclick = () => {
// slider展开状态
// todo: 这样不好,后面改成状态
if (document.querySelector('.left-col.show')) return
let items = []
$imgArr.forEach(($em2, i2) => {
let img = $em2.getAttribute('data-idx', i2)
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
let title = $em2.getAttribute('alt')
// 获得原图尺寸
const image = new Image()
image.src = src
items.push({
src: src,
w: image.width || $em2.width,
h: image.height || $em2.height,
title: title
})
})
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
index: parseInt(i)
});
gallery.init()
}
})
}
viewer_init()
</script>
<!-- MathJax -->
<!-- Katex -->
<!-- busuanzi -->
<script src="/js/busuanzi-2.3.pure.min.js"></script>
<!-- ClickLove -->
<!-- ClickBoom1 -->
<!-- ClickBoom2 -->
<script src="/js/clickBoom2.js"></script>
<!-- CodeCopy -->
<link rel="stylesheet" href="/css/clipboard.css">
<script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
function wait(callback, seconds) {
var timelag = null;
timelag = window.setTimeout(callback, seconds);
}
!function (e, t, a) {
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
$(".article pre code").before(copyHtml);
var clipboard = new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
clipboard.on('success', function(e) {
let $btn = $(e.trigger);
$btn.addClass('copied');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-checkbox-circle-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPIED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-checkbox-circle-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
clipboard.on('error', function(e) {
e.clearSelection();
let $btn = $(e.trigger);
$btn.addClass('copy-failed');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-time-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPY FAILED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-time-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
}
initCopyCode();
}(window, document);
</script>
<!-- CanvasBackground -->
<script src="/js/dz.js"></script>
<script>
if (window.mermaid) {
mermaid.initialize({ theme: "forest" });
}
</script>
<div id="music">
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
src="//music.163.com/outchain/player?type=2&id=22707008&auto=0&height=32"></iframe>
</div>
<style>
#music {
position: fixed;
right: 15px;
bottom: 0;
z-index: 998;
}
</style>
</div>
</body>
</html>
|
2201_75607095/blog
|
archives/2025/index.html
|
HTML
|
unknown
| 13,280
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title>Archives | MC万岁!</title>
<meta name="generator" content="hexo-theme-ayer">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/dist/main.css">
<link rel="stylesheet" href="/css/fonts/remixicon.css">
<link rel="stylesheet" href="/css/custom.css">
<script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>
<!-- mermaid -->
<style>
.swal2-styled.swal2-confirm {
font-size: 1.6rem;
}
</style>
<link rel="alternate" href="/atom.xml" title="MC万岁!" type="application/atom+xml">
</head>
</html>
</html>
<body>
<div id="app">
<canvas width="1777" height="841"
style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
<main class="content on">
<section class="outer">
<article class="articles">
<h1 class="page-type-title">Archives</h1>
<div class="archives-wrap">
<div class="archive-year-wrap">
<a href="/archives/2025" class="archive-year">2025</a>
</div>
<div class="archives">
<article class="archive-article archive-type-post">
<div class="archive-article-inner">
<header class="archive-article-header">
<a href="/2025/05/10/wei/" class="archive-article-date">
<time datetime="2025-05-10T02:30:19.000Z" itemprop="datePublished">05/10</time>
</a>
<h2 itemprop="name">
<a class="archive-article-title" href="/2025/05/10/wei/"
>wei</a>
</h2>
</header>
</div>
</article>
</div>
</div>
</section>
<footer class="footer">
<div class="outer">
<ul>
<li>
Copyrights ©
2015-2025
<i class="ri-heart-fill heart_icon"></i> John Doe
</li>
</ul>
<ul>
<li>
</li>
</ul>
<ul>
<li>
<span>
<span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
<span class="division">|</span>
<span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
</li>
</ul>
<ul>
</ul>
<ul>
</ul>
<ul>
<li>
<!-- cnzz统计 -->
<script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&web_id=1278069914'></script>
</li>
</ul>
</div>
</footer>
</main>
<div class="float_btns">
<div class="totop" id="totop">
<i class="ri-arrow-up-line"></i>
</div>
<div class="todark" id="todark">
<i class="ri-moon-line"></i>
</div>
</div>
<aside class="sidebar on">
<button class="navbar-toggle"></button>
<nav class="navbar">
<div class="logo">
<a href="/"><img src="/images/ayer-side.svg" alt="MC万岁!"></a>
</div>
<ul class="nav nav-main">
<li class="nav-item">
<a class="nav-item-link" href="/">主页</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/archives">归档</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/categories">分类</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags">标签</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1WxGizsEv5/?spm_id_from=333.1387.homepage.video_card.click&vd_source=4ed0b065e620133f260030c3bf3b5a3c">友链</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://space.bilibili.com/1592207972?spm_id_from=333.337.0.0">关于我</a>
</li>
</ul>
</nav>
<nav class="navbar navbar-bottom">
<ul class="nav">
<li class="nav-item">
<a class="nav-item-link nav-item-search" title="Search">
<i class="ri-search-line"></i>
</a>
<a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
<i class="ri-rss-line"></i>
</a>
</li>
</ul>
</nav>
<div class="search-form-wrap">
<div class="local-search local-search-plugin">
<input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
<div id="local-search-result" class="local-search-result"></div>
</div>
</div>
</aside>
<div id="mask"></div>
<!-- #reward -->
<div id="reward">
<span class="close"><i class="ri-close-line"></i></span>
<p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
<div class="reward-box">
<div class="reward-item">
<img class="reward-img" src="/images/alipay.jpg">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-item">
<img class="reward-img" src="/images/wechat.jpg">
<span class="reward-type">微信</span>
</div>
</div>
</div>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/lazyload.min.js"></script>
<!-- Tocbot -->
<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>
<script src="/dist/main.js"></script>
<!-- ImageViewer -->
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
<script>
function viewer_init() {
let pswpElement = document.querySelectorAll('.pswp')[0];
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
$imgArr.forEach(($em, i) => {
$em.onclick = () => {
// slider展开状态
// todo: 这样不好,后面改成状态
if (document.querySelector('.left-col.show')) return
let items = []
$imgArr.forEach(($em2, i2) => {
let img = $em2.getAttribute('data-idx', i2)
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
let title = $em2.getAttribute('alt')
// 获得原图尺寸
const image = new Image()
image.src = src
items.push({
src: src,
w: image.width || $em2.width,
h: image.height || $em2.height,
title: title
})
})
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
index: parseInt(i)
});
gallery.init()
}
})
}
viewer_init()
</script>
<!-- MathJax -->
<!-- Katex -->
<!-- busuanzi -->
<script src="/js/busuanzi-2.3.pure.min.js"></script>
<!-- ClickLove -->
<!-- ClickBoom1 -->
<!-- ClickBoom2 -->
<script src="/js/clickBoom2.js"></script>
<!-- CodeCopy -->
<link rel="stylesheet" href="/css/clipboard.css">
<script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
function wait(callback, seconds) {
var timelag = null;
timelag = window.setTimeout(callback, seconds);
}
!function (e, t, a) {
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
$(".article pre code").before(copyHtml);
var clipboard = new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
clipboard.on('success', function(e) {
let $btn = $(e.trigger);
$btn.addClass('copied');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-checkbox-circle-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPIED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-checkbox-circle-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
clipboard.on('error', function(e) {
e.clearSelection();
let $btn = $(e.trigger);
$btn.addClass('copy-failed');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-time-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPY FAILED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-time-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
}
initCopyCode();
}(window, document);
</script>
<!-- CanvasBackground -->
<script src="/js/dz.js"></script>
<script>
if (window.mermaid) {
mermaid.initialize({ theme: "forest" });
}
</script>
<div id="music">
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
src="//music.163.com/outchain/player?type=2&id=22707008&auto=0&height=32"></iframe>
</div>
<style>
#music {
position: fixed;
right: 15px;
bottom: 0;
z-index: 998;
}
</style>
</div>
</body>
</html>
|
2201_75607095/blog
|
archives/index.html
|
HTML
|
unknown
| 13,278
|
.highlight {
position: relative;
}
.btn-copy {
z-index: 1;
display: inline-block;
cursor: pointer;
border: none;
-webkit-appearance: none;
font-size: 12px;
font-weight: bold;
padding: 3px 6px;
color: #333;
background: rgba(255,255,255,0.8);
border-radius: 2px;
position: absolute;
top: 0;
right: 0;
opacity: 0;
transition: all linear 0.2s;
}
.btn-copy >i {
margin-right: 4px;
font-size: 10px;
transform: translateY(1px);
}
.btn-copy:hover {
background: rgba(255,255,255,0.7);
}
.highlight:hover .btn-copy {
opacity: 1;
}
.article pre:hover .btn-copy {
opacity: 1;
}
|
2201_75607095/blog
|
css/clipboard.css
|
CSS
|
unknown
| 612
|
body {
cursor: url("/images/mouse.cur"), auto;
}
.sidebar {
left: -8rem;
width: 8rem;
}
.sidebar.on {
left: 0;
}
.content.on {
margin-left: 0 !important;
}
.navbar-toggle {
left: 9.5rem;
}
.search-form-wrap {
right: 8rem;
}
@media (min-width: 768px) {
.outer,
.wrap {
width: 80rem !important;
}
}
@media (max-width: 768px) {
.tocbot {
display: none !important;
}
.sidebar {
left: 0;
}
.sidebar.on {
left: -8rem;
}
.content {
transform: translateX(8rem);
}
.content.on {
transform: translateX(0);
}
}
|
2201_75607095/blog
|
css/custom.css
|
CSS
|
unknown
| 564
|
/*
* Remix Icon v2.1.0
* https://remixicon.com
* https://github.com/Remix-Design/RemixIcon
*
* Copyright RemixIcon.com
* Released under the Apache License Version 2.0
*
* Date: 2019-11-03
*/
@font-face {
font-family: "remixicon";
src: url('remixicon.eot?t=1572787439022'); /* IE9*/
src: url('remixicon.eot?t=1572787439022#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("remixicon.woff2?t=1572787439022") format("woff2"),
url("remixicon.woff?t=1572787439022") format("woff"),
url('remixicon.ttf?t=1572787439022') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('remixicon.svg?t=1572787439022#remixicon') format('svg'); /* iOS 4.1- */
font-display: swap;
}
[class^="ri-"], [class*=" ri-"] {
display: inline-block;
font-family: 'remixicon' !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ri-lg { font-size: 1.3333em; line-height: 0.75em; vertical-align: -.0667em; }
.ri-xl { font-size: 1.5em; line-height: 0.6666em; vertical-align: -.075em; }
.ri-xxs { font-size: .5em; }
.ri-xs { font-size: .75em; }
.ri-sm { font-size: .875em }
.ri-1x { font-size: 1em; }
.ri-2x { font-size: 2em; }
.ri-3x { font-size: 3em; }
.ri-4x { font-size: 4em; }
.ri-5x { font-size: 5em; }
.ri-6x { font-size: 6em; }
.ri-7x { font-size: 7em; }
.ri-8x { font-size: 8em; }
.ri-9x { font-size: 9em; }
.ri-10x { font-size: 10em; }
.ri-fw { text-align: center; width: 1.25em; }
.ri-4k-fill:before { content: "\ea01"; }
.ri-4k-line:before { content: "\ea02"; }
.ri-account-box-fill:before { content: "\ea03"; }
.ri-account-box-line:before { content: "\ea04"; }
.ri-account-circle-fill:before { content: "\ea05"; }
.ri-account-circle-line:before { content: "\ea06"; }
.ri-account-pin-box-fill:before { content: "\ea07"; }
.ri-account-pin-box-line:before { content: "\ea08"; }
.ri-account-pin-circle-fill:before { content: "\ea09"; }
.ri-account-pin-circle-line:before { content: "\ea0a"; }
.ri-add-box-fill:before { content: "\ea0b"; }
.ri-add-box-line:before { content: "\ea0c"; }
.ri-add-circle-fill:before { content: "\ea0d"; }
.ri-add-circle-line:before { content: "\ea0e"; }
.ri-add-fill:before { content: "\ea0f"; }
.ri-add-line:before { content: "\ea10"; }
.ri-admin-fill:before { content: "\ea11"; }
.ri-admin-line:before { content: "\ea12"; }
.ri-airplay-fill:before { content: "\ea13"; }
.ri-airplay-line:before { content: "\ea14"; }
.ri-alarm-fill:before { content: "\ea15"; }
.ri-alarm-line:before { content: "\ea16"; }
.ri-alarm-warning-fill:before { content: "\ea17"; }
.ri-alarm-warning-line:before { content: "\ea18"; }
.ri-album-fill:before { content: "\ea19"; }
.ri-album-line:before { content: "\ea1a"; }
.ri-alert-fill:before { content: "\ea1b"; }
.ri-alert-line:before { content: "\ea1c"; }
.ri-align-bottom:before { content: "\ea1d"; }
.ri-align-center:before { content: "\ea1e"; }
.ri-align-justify:before { content: "\ea1f"; }
.ri-align-left:before { content: "\ea20"; }
.ri-align-right:before { content: "\ea21"; }
.ri-align-top:before { content: "\ea22"; }
.ri-align-vertically:before { content: "\ea23"; }
.ri-alipay-fill:before { content: "\ea24"; }
.ri-alipay-line:before { content: "\ea25"; }
.ri-amazon-fill:before { content: "\ea26"; }
.ri-amazon-line:before { content: "\ea27"; }
.ri-anchor-fill:before { content: "\ea28"; }
.ri-anchor-line:before { content: "\ea29"; }
.ri-android-fill:before { content: "\ea2a"; }
.ri-android-line:before { content: "\ea2b"; }
.ri-angularjs-fill:before { content: "\ea2c"; }
.ri-angularjs-line:before { content: "\ea2d"; }
.ri-anticlockwise-2-fill:before { content: "\ea2e"; }
.ri-anticlockwise-2-line:before { content: "\ea2f"; }
.ri-anticlockwise-fill:before { content: "\ea30"; }
.ri-anticlockwise-line:before { content: "\ea31"; }
.ri-apple-fill:before { content: "\ea32"; }
.ri-apple-line:before { content: "\ea33"; }
.ri-apps-2-fill:before { content: "\ea34"; }
.ri-apps-2-line:before { content: "\ea35"; }
.ri-apps-fill:before { content: "\ea36"; }
.ri-apps-line:before { content: "\ea37"; }
.ri-archive-drawer-fill:before { content: "\ea38"; }
.ri-archive-drawer-line:before { content: "\ea39"; }
.ri-archive-fill:before { content: "\ea3a"; }
.ri-archive-line:before { content: "\ea3b"; }
.ri-arrow-down-circle-fill:before { content: "\ea3c"; }
.ri-arrow-down-circle-line:before { content: "\ea3d"; }
.ri-arrow-down-fill:before { content: "\ea3e"; }
.ri-arrow-down-line:before { content: "\ea3f"; }
.ri-arrow-down-s-fill:before { content: "\ea40"; }
.ri-arrow-down-s-line:before { content: "\ea41"; }
.ri-arrow-drop-down-fill:before { content: "\ea42"; }
.ri-arrow-drop-down-line:before { content: "\ea43"; }
.ri-arrow-drop-left-fill:before { content: "\ea44"; }
.ri-arrow-drop-left-line:before { content: "\ea45"; }
.ri-arrow-drop-right-fill:before { content: "\ea46"; }
.ri-arrow-drop-right-line:before { content: "\ea47"; }
.ri-arrow-drop-up-fill:before { content: "\ea48"; }
.ri-arrow-drop-up-line:before { content: "\ea49"; }
.ri-arrow-go-back-fill:before { content: "\ea4a"; }
.ri-arrow-go-back-line:before { content: "\ea4b"; }
.ri-arrow-go-forward-fill:before { content: "\ea4c"; }
.ri-arrow-go-forward-line:before { content: "\ea4d"; }
.ri-arrow-left-circle-fill:before { content: "\ea4e"; }
.ri-arrow-left-circle-line:before { content: "\ea4f"; }
.ri-arrow-left-down-fill:before { content: "\ea50"; }
.ri-arrow-left-down-line:before { content: "\ea51"; }
.ri-arrow-left-fill:before { content: "\ea52"; }
.ri-arrow-left-line:before { content: "\ea53"; }
.ri-arrow-left-s-fill:before { content: "\ea54"; }
.ri-arrow-left-s-line:before { content: "\ea55"; }
.ri-arrow-left-up-fill:before { content: "\ea56"; }
.ri-arrow-left-up-line:before { content: "\ea57"; }
.ri-arrow-right-circle-fill:before { content: "\ea58"; }
.ri-arrow-right-circle-line:before { content: "\ea59"; }
.ri-arrow-right-down-fill:before { content: "\ea5a"; }
.ri-arrow-right-down-line:before { content: "\ea5b"; }
.ri-arrow-right-fill:before { content: "\ea5c"; }
.ri-arrow-right-line:before { content: "\ea5d"; }
.ri-arrow-right-s-fill:before { content: "\ea5e"; }
.ri-arrow-right-s-line:before { content: "\ea5f"; }
.ri-arrow-right-up-fill:before { content: "\ea60"; }
.ri-arrow-right-up-line:before { content: "\ea61"; }
.ri-arrow-up-circle-fill:before { content: "\ea62"; }
.ri-arrow-up-circle-line:before { content: "\ea63"; }
.ri-arrow-up-fill:before { content: "\ea64"; }
.ri-arrow-up-line:before { content: "\ea65"; }
.ri-arrow-up-s-fill:before { content: "\ea66"; }
.ri-arrow-up-s-line:before { content: "\ea67"; }
.ri-artboard-2-fill:before { content: "\ea68"; }
.ri-artboard-2-line:before { content: "\ea69"; }
.ri-artboard-fill:before { content: "\ea6a"; }
.ri-artboard-line:before { content: "\ea6b"; }
.ri-article-fill:before { content: "\ea6c"; }
.ri-article-line:before { content: "\ea6d"; }
.ri-asterisk:before { content: "\ea6e"; }
.ri-at-fill:before { content: "\ea6f"; }
.ri-at-line:before { content: "\ea70"; }
.ri-attachment-2:before { content: "\ea71"; }
.ri-attachment-fill:before { content: "\ea72"; }
.ri-attachment-line:before { content: "\ea73"; }
.ri-auction-fill:before { content: "\ea74"; }
.ri-auction-line:before { content: "\ea75"; }
.ri-award-fill:before { content: "\ea76"; }
.ri-award-line:before { content: "\ea77"; }
.ri-baidu-fill:before { content: "\ea78"; }
.ri-baidu-line:before { content: "\ea79"; }
.ri-ball-pen-fill:before { content: "\ea7a"; }
.ri-ball-pen-line:before { content: "\ea7b"; }
.ri-bank-card-2-fill:before { content: "\ea7c"; }
.ri-bank-card-2-line:before { content: "\ea7d"; }
.ri-bank-card-fill:before { content: "\ea7e"; }
.ri-bank-card-line:before { content: "\ea7f"; }
.ri-bank-fill:before { content: "\ea80"; }
.ri-bank-line:before { content: "\ea81"; }
.ri-bar-chart-2-fill:before { content: "\ea82"; }
.ri-bar-chart-2-line:before { content: "\ea83"; }
.ri-bar-chart-box-fill:before { content: "\ea84"; }
.ri-bar-chart-box-line:before { content: "\ea85"; }
.ri-bar-chart-fill:before { content: "\ea86"; }
.ri-bar-chart-grouped-fill:before { content: "\ea87"; }
.ri-bar-chart-grouped-line:before { content: "\ea88"; }
.ri-bar-chart-horizontal-fill:before { content: "\ea89"; }
.ri-bar-chart-horizontal-line:before { content: "\ea8a"; }
.ri-bar-chart-line:before { content: "\ea8b"; }
.ri-barcode-box-fill:before { content: "\ea8c"; }
.ri-barcode-box-line:before { content: "\ea8d"; }
.ri-barcode-fill:before { content: "\ea8e"; }
.ri-barcode-line:before { content: "\ea8f"; }
.ri-barricade-fill:before { content: "\ea90"; }
.ri-barricade-line:before { content: "\ea91"; }
.ri-base-station-fill:before { content: "\ea92"; }
.ri-base-station-line:before { content: "\ea93"; }
.ri-battery-2-charge-fill:before { content: "\ea94"; }
.ri-battery-2-charge-line:before { content: "\ea95"; }
.ri-battery-2-fill:before { content: "\ea96"; }
.ri-battery-2-line:before { content: "\ea97"; }
.ri-battery-charge-fill:before { content: "\ea98"; }
.ri-battery-charge-line:before { content: "\ea99"; }
.ri-battery-fill:before { content: "\ea9a"; }
.ri-battery-line:before { content: "\ea9b"; }
.ri-battery-low-fill:before { content: "\ea9c"; }
.ri-battery-low-line:before { content: "\ea9d"; }
.ri-behance-fill:before { content: "\ea9e"; }
.ri-behance-line:before { content: "\ea9f"; }
.ri-bike-fill:before { content: "\eaa0"; }
.ri-bike-line:before { content: "\eaa1"; }
.ri-bilibili-fill:before { content: "\eaa2"; }
.ri-bilibili-line:before { content: "\eaa3"; }
.ri-bill-fill:before { content: "\eaa4"; }
.ri-bill-line:before { content: "\eaa5"; }
.ri-bit-coin-fill:before { content: "\eaa6"; }
.ri-bit-coin-line:before { content: "\eaa7"; }
.ri-bluetooth-connect-fill:before { content: "\eaa8"; }
.ri-bluetooth-connect-line:before { content: "\eaa9"; }
.ri-bluetooth-fill:before { content: "\eaaa"; }
.ri-bluetooth-line:before { content: "\eaab"; }
.ri-blur-off-fill:before { content: "\eaac"; }
.ri-blur-off-line:before { content: "\eaad"; }
.ri-bold:before { content: "\eaae"; }
.ri-book-2-fill:before { content: "\eaaf"; }
.ri-book-2-line:before { content: "\eab0"; }
.ri-book-3-fill:before { content: "\eab1"; }
.ri-book-3-line:before { content: "\eab2"; }
.ri-book-fill:before { content: "\eab3"; }
.ri-book-line:before { content: "\eab4"; }
.ri-book-mark-fill:before { content: "\eab5"; }
.ri-book-mark-line:before { content: "\eab6"; }
.ri-book-open-fill:before { content: "\eab7"; }
.ri-book-open-line:before { content: "\eab8"; }
.ri-book-read-fill:before { content: "\eab9"; }
.ri-book-read-line:before { content: "\eaba"; }
.ri-bookmark-2-fill:before { content: "\eabb"; }
.ri-bookmark-2-line:before { content: "\eabc"; }
.ri-bookmark-3-fill:before { content: "\eabd"; }
.ri-bookmark-3-line:before { content: "\eabe"; }
.ri-bookmark-fill:before { content: "\eabf"; }
.ri-bookmark-line:before { content: "\eac0"; }
.ri-braces-fill:before { content: "\eac1"; }
.ri-braces-line:before { content: "\eac2"; }
.ri-brackets-fill:before { content: "\eac3"; }
.ri-brackets-line:before { content: "\eac4"; }
.ri-briefcase-2-fill:before { content: "\eac5"; }
.ri-briefcase-2-line:before { content: "\eac6"; }
.ri-briefcase-3-fill:before { content: "\eac7"; }
.ri-briefcase-3-line:before { content: "\eac8"; }
.ri-briefcase-4-fill:before { content: "\eac9"; }
.ri-briefcase-4-line:before { content: "\eaca"; }
.ri-briefcase-5-fill:before { content: "\eacb"; }
.ri-briefcase-5-line:before { content: "\eacc"; }
.ri-briefcase-fill:before { content: "\eacd"; }
.ri-briefcase-line:before { content: "\eace"; }
.ri-broadcast-fill:before { content: "\eacf"; }
.ri-broadcast-line:before { content: "\ead0"; }
.ri-brush-2-fill:before { content: "\ead1"; }
.ri-brush-2-line:before { content: "\ead2"; }
.ri-brush-3-fill:before { content: "\ead3"; }
.ri-brush-3-line:before { content: "\ead4"; }
.ri-brush-4-fill:before { content: "\ead5"; }
.ri-brush-4-line:before { content: "\ead6"; }
.ri-brush-fill:before { content: "\ead7"; }
.ri-brush-line:before { content: "\ead8"; }
.ri-bug-2-fill:before { content: "\ead9"; }
.ri-bug-2-line:before { content: "\eada"; }
.ri-bug-fill:before { content: "\eadb"; }
.ri-bug-line:before { content: "\eadc"; }
.ri-building-2-fill:before { content: "\eadd"; }
.ri-building-2-line:before { content: "\eade"; }
.ri-building-3-fill:before { content: "\eadf"; }
.ri-building-3-line:before { content: "\eae0"; }
.ri-building-4-fill:before { content: "\eae1"; }
.ri-building-4-line:before { content: "\eae2"; }
.ri-building-fill:before { content: "\eae3"; }
.ri-building-line:before { content: "\eae4"; }
.ri-bus-2-fill:before { content: "\eae5"; }
.ri-bus-2-line:before { content: "\eae6"; }
.ri-bus-fill:before { content: "\eae7"; }
.ri-bus-line:before { content: "\eae8"; }
.ri-calculator-fill:before { content: "\eae9"; }
.ri-calculator-line:before { content: "\eaea"; }
.ri-calendar-2-fill:before { content: "\eaeb"; }
.ri-calendar-2-line:before { content: "\eaec"; }
.ri-calendar-check-fill:before { content: "\eaed"; }
.ri-calendar-check-line:before { content: "\eaee"; }
.ri-calendar-event-fill:before { content: "\eaef"; }
.ri-calendar-event-line:before { content: "\eaf0"; }
.ri-calendar-fill:before { content: "\eaf1"; }
.ri-calendar-line:before { content: "\eaf2"; }
.ri-calendar-todo-fill:before { content: "\eaf3"; }
.ri-calendar-todo-line:before { content: "\eaf4"; }
.ri-camera-2-fill:before { content: "\eaf5"; }
.ri-camera-2-line:before { content: "\eaf6"; }
.ri-camera-3-fill:before { content: "\eaf7"; }
.ri-camera-3-line:before { content: "\eaf8"; }
.ri-camera-fill:before { content: "\eaf9"; }
.ri-camera-lens-fill:before { content: "\eafa"; }
.ri-camera-lens-line:before { content: "\eafb"; }
.ri-camera-line:before { content: "\eafc"; }
.ri-camera-off-fill:before { content: "\eafd"; }
.ri-camera-off-line:before { content: "\eafe"; }
.ri-camera-switch-fill:before { content: "\eaff"; }
.ri-camera-switch-line:before { content: "\eb00"; }
.ri-car-fill:before { content: "\eb01"; }
.ri-car-line:before { content: "\eb02"; }
.ri-car-washing-fill:before { content: "\eb03"; }
.ri-car-washing-line:before { content: "\eb04"; }
.ri-cast-fill:before { content: "\eb05"; }
.ri-cast-line:before { content: "\eb06"; }
.ri-cellphone-fill:before { content: "\eb07"; }
.ri-cellphone-line:before { content: "\eb08"; }
.ri-celsius-fill:before { content: "\eb09"; }
.ri-celsius-line:before { content: "\eb0a"; }
.ri-charging-pile-2-fill:before { content: "\eb0b"; }
.ri-charging-pile-2-line:before { content: "\eb0c"; }
.ri-charging-pile-fill:before { content: "\eb0d"; }
.ri-charging-pile-line:before { content: "\eb0e"; }
.ri-chat-1-fill:before { content: "\eb0f"; }
.ri-chat-1-line:before { content: "\eb10"; }
.ri-chat-2-fill:before { content: "\eb11"; }
.ri-chat-2-line:before { content: "\eb12"; }
.ri-chat-3-fill:before { content: "\eb13"; }
.ri-chat-3-line:before { content: "\eb14"; }
.ri-chat-4-fill:before { content: "\eb15"; }
.ri-chat-4-line:before { content: "\eb16"; }
.ri-chat-check-fill:before { content: "\eb17"; }
.ri-chat-check-line:before { content: "\eb18"; }
.ri-chat-delete-fill:before { content: "\eb19"; }
.ri-chat-delete-line:before { content: "\eb1a"; }
.ri-chat-download-fill:before { content: "\eb1b"; }
.ri-chat-download-line:before { content: "\eb1c"; }
.ri-chat-forward-fill:before { content: "\eb1d"; }
.ri-chat-forward-line:before { content: "\eb1e"; }
.ri-chat-heart-fill:before { content: "\eb1f"; }
.ri-chat-heart-line:before { content: "\eb20"; }
.ri-chat-new-fill:before { content: "\eb21"; }
.ri-chat-new-line:before { content: "\eb22"; }
.ri-chat-off-fill:before { content: "\eb23"; }
.ri-chat-off-line:before { content: "\eb24"; }
.ri-chat-settings-fill:before { content: "\eb25"; }
.ri-chat-settings-line:before { content: "\eb26"; }
.ri-chat-smile-2-fill:before { content: "\eb27"; }
.ri-chat-smile-2-line:before { content: "\eb28"; }
.ri-chat-smile-3-fill:before { content: "\eb29"; }
.ri-chat-smile-3-line:before { content: "\eb2a"; }
.ri-chat-smile-fill:before { content: "\eb2b"; }
.ri-chat-smile-line:before { content: "\eb2c"; }
.ri-chat-upload-fill:before { content: "\eb2d"; }
.ri-chat-upload-line:before { content: "\eb2e"; }
.ri-chat-voice-fill:before { content: "\eb2f"; }
.ri-chat-voice-line:before { content: "\eb30"; }
.ri-check-double-fill:before { content: "\eb31"; }
.ri-check-double-line:before { content: "\eb32"; }
.ri-check-fill:before { content: "\eb33"; }
.ri-check-line:before { content: "\eb34"; }
.ri-checkbox-blank-circle-fill:before { content: "\eb35"; }
.ri-checkbox-blank-circle-line:before { content: "\eb36"; }
.ri-checkbox-blank-fill:before { content: "\eb37"; }
.ri-checkbox-blank-line:before { content: "\eb38"; }
.ri-checkbox-circle-fill:before { content: "\eb39"; }
.ri-checkbox-circle-line:before { content: "\eb3a"; }
.ri-checkbox-fill:before { content: "\eb3b"; }
.ri-checkbox-indeterminate-fill:before { content: "\eb3c"; }
.ri-checkbox-indeterminate-line:before { content: "\eb3d"; }
.ri-checkbox-line:before { content: "\eb3e"; }
.ri-checkbox-multiple-blank-fill:before { content: "\eb3f"; }
.ri-checkbox-multiple-blank-line:before { content: "\eb40"; }
.ri-checkbox-multiple-fill:before { content: "\eb41"; }
.ri-checkbox-multiple-line:before { content: "\eb42"; }
.ri-china-railway-fill:before { content: "\eb43"; }
.ri-china-railway-line:before { content: "\eb44"; }
.ri-chrome-fill:before { content: "\eb45"; }
.ri-chrome-line:before { content: "\eb46"; }
.ri-clapperboard-fill:before { content: "\eb47"; }
.ri-clapperboard-line:before { content: "\eb48"; }
.ri-clipboard-fill:before { content: "\eb49"; }
.ri-clipboard-line:before { content: "\eb4a"; }
.ri-clockwise-2-fill:before { content: "\eb4b"; }
.ri-clockwise-2-line:before { content: "\eb4c"; }
.ri-clockwise-fill:before { content: "\eb4d"; }
.ri-clockwise-line:before { content: "\eb4e"; }
.ri-close-circle-fill:before { content: "\eb4f"; }
.ri-close-circle-line:before { content: "\eb50"; }
.ri-close-fill:before { content: "\eb51"; }
.ri-close-line:before { content: "\eb52"; }
.ri-cloud-fill:before { content: "\eb53"; }
.ri-cloud-line:before { content: "\eb54"; }
.ri-cloud-off-fill:before { content: "\eb55"; }
.ri-cloud-off-line:before { content: "\eb56"; }
.ri-cloud-windy-fill:before { content: "\eb57"; }
.ri-cloud-windy-line:before { content: "\eb58"; }
.ri-cloudy-2-fill:before { content: "\eb59"; }
.ri-cloudy-2-line:before { content: "\eb5a"; }
.ri-cloudy-fill:before { content: "\eb5b"; }
.ri-cloudy-line:before { content: "\eb5c"; }
.ri-code-box-fill:before { content: "\eb5d"; }
.ri-code-box-line:before { content: "\eb5e"; }
.ri-code-fill:before { content: "\eb5f"; }
.ri-code-line:before { content: "\eb60"; }
.ri-code-s-fill:before { content: "\eb61"; }
.ri-code-s-line:before { content: "\eb62"; }
.ri-code-s-slash-fill:before { content: "\eb63"; }
.ri-code-s-slash-line:before { content: "\eb64"; }
.ri-code-view:before { content: "\eb65"; }
.ri-codepen-fill:before { content: "\eb66"; }
.ri-codepen-line:before { content: "\eb67"; }
.ri-command-fill:before { content: "\eb68"; }
.ri-command-line:before { content: "\eb69"; }
.ri-community-fill:before { content: "\eb6a"; }
.ri-community-line:before { content: "\eb6b"; }
.ri-compass-2-fill:before { content: "\eb6c"; }
.ri-compass-2-line:before { content: "\eb6d"; }
.ri-compass-3-fill:before { content: "\eb6e"; }
.ri-compass-3-line:before { content: "\eb6f"; }
.ri-compass-4-fill:before { content: "\eb70"; }
.ri-compass-4-line:before { content: "\eb71"; }
.ri-compass-discover-fill:before { content: "\eb72"; }
.ri-compass-discover-line:before { content: "\eb73"; }
.ri-compass-fill:before { content: "\eb74"; }
.ri-compass-line:before { content: "\eb75"; }
.ri-compasses-2-fill:before { content: "\eb76"; }
.ri-compasses-2-line:before { content: "\eb77"; }
.ri-compasses-fill:before { content: "\eb78"; }
.ri-compasses-line:before { content: "\eb79"; }
.ri-computer-fill:before { content: "\eb7a"; }
.ri-computer-line:before { content: "\eb7b"; }
.ri-contacts-book-2-fill:before { content: "\eb7c"; }
.ri-contacts-book-2-line:before { content: "\eb7d"; }
.ri-contacts-book-fill:before { content: "\eb7e"; }
.ri-contacts-book-line:before { content: "\eb7f"; }
.ri-contacts-fill:before { content: "\eb80"; }
.ri-contacts-line:before { content: "\eb81"; }
.ri-contrast-2-fill:before { content: "\eb82"; }
.ri-contrast-2-line:before { content: "\eb83"; }
.ri-contrast-drop-2-fill:before { content: "\eb84"; }
.ri-contrast-drop-2-line:before { content: "\eb85"; }
.ri-contrast-drop-fill:before { content: "\eb86"; }
.ri-contrast-drop-line:before { content: "\eb87"; }
.ri-contrast-fill:before { content: "\eb88"; }
.ri-contrast-line:before { content: "\eb89"; }
.ri-copper-coin-fill:before { content: "\eb8a"; }
.ri-copper-coin-line:before { content: "\eb8b"; }
.ri-copper-diamond-fill:before { content: "\eb8c"; }
.ri-copper-diamond-line:before { content: "\eb8d"; }
.ri-copyright-fill:before { content: "\eb8e"; }
.ri-copyright-line:before { content: "\eb8f"; }
.ri-coreos-fill:before { content: "\eb90"; }
.ri-coreos-line:before { content: "\eb91"; }
.ri-coupon-2-fill:before { content: "\eb92"; }
.ri-coupon-2-line:before { content: "\eb93"; }
.ri-coupon-3-fill:before { content: "\eb94"; }
.ri-coupon-3-line:before { content: "\eb95"; }
.ri-coupon-4-fill:before { content: "\eb96"; }
.ri-coupon-4-line:before { content: "\eb97"; }
.ri-coupon-5-fill:before { content: "\eb98"; }
.ri-coupon-5-line:before { content: "\eb99"; }
.ri-coupon-fill:before { content: "\eb9a"; }
.ri-coupon-line:before { content: "\eb9b"; }
.ri-cpu-fill:before { content: "\eb9c"; }
.ri-cpu-line:before { content: "\eb9d"; }
.ri-crop-2-fill:before { content: "\eb9e"; }
.ri-crop-2-line:before { content: "\eb9f"; }
.ri-crop-fill:before { content: "\eba0"; }
.ri-crop-line:before { content: "\eba1"; }
.ri-css3-fill:before { content: "\eba2"; }
.ri-css3-line:before { content: "\eba3"; }
.ri-cup-fill:before { content: "\eba4"; }
.ri-cup-line:before { content: "\eba5"; }
.ri-currency-fill:before { content: "\eba6"; }
.ri-currency-line:before { content: "\eba7"; }
.ri-cursor-fill:before { content: "\eba8"; }
.ri-cursor-line:before { content: "\eba9"; }
.ri-customer-service-2-fill:before { content: "\ebaa"; }
.ri-customer-service-2-line:before { content: "\ebab"; }
.ri-customer-service-fill:before { content: "\ebac"; }
.ri-customer-service-line:before { content: "\ebad"; }
.ri-dashboard-fill:before { content: "\ebae"; }
.ri-dashboard-line:before { content: "\ebaf"; }
.ri-database-2-fill:before { content: "\ebb0"; }
.ri-database-2-line:before { content: "\ebb1"; }
.ri-database-fill:before { content: "\ebb2"; }
.ri-database-line:before { content: "\ebb3"; }
.ri-delete-back-2-fill:before { content: "\ebb4"; }
.ri-delete-back-2-line:before { content: "\ebb5"; }
.ri-delete-back-fill:before { content: "\ebb6"; }
.ri-delete-back-line:before { content: "\ebb7"; }
.ri-delete-bin-2-fill:before { content: "\ebb8"; }
.ri-delete-bin-2-line:before { content: "\ebb9"; }
.ri-delete-bin-3-fill:before { content: "\ebba"; }
.ri-delete-bin-3-line:before { content: "\ebbb"; }
.ri-delete-bin-4-fill:before { content: "\ebbc"; }
.ri-delete-bin-4-line:before { content: "\ebbd"; }
.ri-delete-bin-5-fill:before { content: "\ebbe"; }
.ri-delete-bin-5-line:before { content: "\ebbf"; }
.ri-delete-bin-6-fill:before { content: "\ebc0"; }
.ri-delete-bin-6-line:before { content: "\ebc1"; }
.ri-delete-bin-7-fill:before { content: "\ebc2"; }
.ri-delete-bin-7-line:before { content: "\ebc3"; }
.ri-delete-bin-fill:before { content: "\ebc4"; }
.ri-delete-bin-line:before { content: "\ebc5"; }
.ri-device-fill:before { content: "\ebc6"; }
.ri-device-line:before { content: "\ebc7"; }
.ri-dingding-fill:before { content: "\ebc8"; }
.ri-dingding-line:before { content: "\ebc9"; }
.ri-direction-fill:before { content: "\ebca"; }
.ri-direction-line:before { content: "\ebcb"; }
.ri-disc-fill:before { content: "\ebcc"; }
.ri-disc-line:before { content: "\ebcd"; }
.ri-discord-fill:before { content: "\ebce"; }
.ri-discord-line:before { content: "\ebcf"; }
.ri-discuss-fill:before { content: "\ebd0"; }
.ri-discuss-line:before { content: "\ebd1"; }
.ri-divide-fill:before { content: "\ebd2"; }
.ri-divide-line:before { content: "\ebd3"; }
.ri-door-lock-box-fill:before { content: "\ebd4"; }
.ri-door-lock-box-line:before { content: "\ebd5"; }
.ri-door-lock-fill:before { content: "\ebd6"; }
.ri-door-lock-line:before { content: "\ebd7"; }
.ri-douban-fill:before { content: "\ebd8"; }
.ri-douban-line:before { content: "\ebd9"; }
.ri-double-quotes-l:before { content: "\ebda"; }
.ri-double-quotes-r:before { content: "\ebdb"; }
.ri-download-2-fill:before { content: "\ebdc"; }
.ri-download-2-line:before { content: "\ebdd"; }
.ri-download-cloud-2-fill:before { content: "\ebde"; }
.ri-download-cloud-2-line:before { content: "\ebdf"; }
.ri-download-cloud-fill:before { content: "\ebe0"; }
.ri-download-cloud-line:before { content: "\ebe1"; }
.ri-download-fill:before { content: "\ebe2"; }
.ri-download-line:before { content: "\ebe3"; }
.ri-drag-move-2-fill:before { content: "\ebe4"; }
.ri-drag-move-2-line:before { content: "\ebe5"; }
.ri-drag-move-fill:before { content: "\ebe6"; }
.ri-drag-move-line:before { content: "\ebe7"; }
.ri-dribbble-fill:before { content: "\ebe8"; }
.ri-dribbble-line:before { content: "\ebe9"; }
.ri-drive-fill:before { content: "\ebea"; }
.ri-drive-line:before { content: "\ebeb"; }
.ri-drizzle-fill:before { content: "\ebec"; }
.ri-drizzle-line:before { content: "\ebed"; }
.ri-drop-fill:before { content: "\ebee"; }
.ri-drop-line:before { content: "\ebef"; }
.ri-dropbox-fill:before { content: "\ebf0"; }
.ri-dropbox-line:before { content: "\ebf1"; }
.ri-dv-fill:before { content: "\ebf2"; }
.ri-dv-line:before { content: "\ebf3"; }
.ri-dvd-fill:before { content: "\ebf4"; }
.ri-dvd-line:before { content: "\ebf5"; }
.ri-e-bike-2-fill:before { content: "\ebf6"; }
.ri-e-bike-2-line:before { content: "\ebf7"; }
.ri-e-bike-fill:before { content: "\ebf8"; }
.ri-e-bike-line:before { content: "\ebf9"; }
.ri-earth-fill:before { content: "\ebfa"; }
.ri-earth-line:before { content: "\ebfb"; }
.ri-edge-fill:before { content: "\ebfc"; }
.ri-edge-line:before { content: "\ebfd"; }
.ri-edit-2-fill:before { content: "\ebfe"; }
.ri-edit-2-line:before { content: "\ebff"; }
.ri-edit-box-fill:before { content: "\ec00"; }
.ri-edit-box-line:before { content: "\ec01"; }
.ri-edit-circle-fill:before { content: "\ec02"; }
.ri-edit-circle-line:before { content: "\ec03"; }
.ri-edit-fill:before { content: "\ec04"; }
.ri-edit-line:before { content: "\ec05"; }
.ri-eject-fill:before { content: "\ec06"; }
.ri-eject-line:before { content: "\ec07"; }
.ri-emotion-2-fill:before { content: "\ec08"; }
.ri-emotion-2-line:before { content: "\ec09"; }
.ri-emotion-fill:before { content: "\ec0a"; }
.ri-emotion-happy-fill:before { content: "\ec0b"; }
.ri-emotion-happy-line:before { content: "\ec0c"; }
.ri-emotion-line:before { content: "\ec0d"; }
.ri-emotion-normal-fill:before { content: "\ec0e"; }
.ri-emotion-normal-line:before { content: "\ec0f"; }
.ri-emotion-unhappy-fill:before { content: "\ec10"; }
.ri-emotion-unhappy-line:before { content: "\ec11"; }
.ri-emphasis:before { content: "\ec12"; }
.ri-equalizer-fill:before { content: "\ec13"; }
.ri-equalizer-line:before { content: "\ec14"; }
.ri-eraser-fill:before { content: "\ec15"; }
.ri-eraser-line:before { content: "\ec16"; }
.ri-error-warning-fill:before { content: "\ec17"; }
.ri-error-warning-line:before { content: "\ec18"; }
.ri-evernote-fill:before { content: "\ec19"; }
.ri-evernote-line:before { content: "\ec1a"; }
.ri-exchange-box-fill:before { content: "\ec1b"; }
.ri-exchange-box-line:before { content: "\ec1c"; }
.ri-exchange-cny-fill:before { content: "\ec1d"; }
.ri-exchange-cny-line:before { content: "\ec1e"; }
.ri-exchange-dollar-fill:before { content: "\ec1f"; }
.ri-exchange-dollar-line:before { content: "\ec20"; }
.ri-exchange-fill:before { content: "\ec21"; }
.ri-exchange-funds-fill:before { content: "\ec22"; }
.ri-exchange-funds-line:before { content: "\ec23"; }
.ri-exchange-line:before { content: "\ec24"; }
.ri-external-link-fill:before { content: "\ec25"; }
.ri-external-link-line:before { content: "\ec26"; }
.ri-eye-close-fill:before { content: "\ec27"; }
.ri-eye-close-line:before { content: "\ec28"; }
.ri-eye-fill:before { content: "\ec29"; }
.ri-eye-line:before { content: "\ec2a"; }
.ri-eye-off-fill:before { content: "\ec2b"; }
.ri-eye-off-line:before { content: "\ec2c"; }
.ri-facebook-box-fill:before { content: "\ec2d"; }
.ri-facebook-box-line:before { content: "\ec2e"; }
.ri-facebook-circle-fill:before { content: "\ec2f"; }
.ri-facebook-circle-line:before { content: "\ec30"; }
.ri-facebook-fill:before { content: "\ec31"; }
.ri-facebook-line:before { content: "\ec32"; }
.ri-fahrenheit-fill:before { content: "\ec33"; }
.ri-fahrenheit-line:before { content: "\ec34"; }
.ri-feedback-fill:before { content: "\ec35"; }
.ri-feedback-line:before { content: "\ec36"; }
.ri-file-2-fill:before { content: "\ec37"; }
.ri-file-2-line:before { content: "\ec38"; }
.ri-file-3-fill:before { content: "\ec39"; }
.ri-file-3-line:before { content: "\ec3a"; }
.ri-file-4-fill:before { content: "\ec3b"; }
.ri-file-4-line:before { content: "\ec3c"; }
.ri-file-add-fill:before { content: "\ec3d"; }
.ri-file-add-line:before { content: "\ec3e"; }
.ri-file-chart-2-fill:before { content: "\ec3f"; }
.ri-file-chart-2-line:before { content: "\ec40"; }
.ri-file-chart-fill:before { content: "\ec41"; }
.ri-file-chart-line:before { content: "\ec42"; }
.ri-file-code-fill:before { content: "\ec43"; }
.ri-file-code-line:before { content: "\ec44"; }
.ri-file-copy-2-fill:before { content: "\ec45"; }
.ri-file-copy-2-line:before { content: "\ec46"; }
.ri-file-copy-fill:before { content: "\ec47"; }
.ri-file-copy-line:before { content: "\ec48"; }
.ri-file-damage-fill:before { content: "\ec49"; }
.ri-file-damage-line:before { content: "\ec4a"; }
.ri-file-download-fill:before { content: "\ec4b"; }
.ri-file-download-line:before { content: "\ec4c"; }
.ri-file-edit-fill:before { content: "\ec4d"; }
.ri-file-edit-line:before { content: "\ec4e"; }
.ri-file-excel-2-fill:before { content: "\ec4f"; }
.ri-file-excel-2-line:before { content: "\ec50"; }
.ri-file-excel-fill:before { content: "\ec51"; }
.ri-file-excel-line:before { content: "\ec52"; }
.ri-file-fill:before { content: "\ec53"; }
.ri-file-forbid-fill:before { content: "\ec54"; }
.ri-file-forbid-line:before { content: "\ec55"; }
.ri-file-info-fill:before { content: "\ec56"; }
.ri-file-info-line:before { content: "\ec57"; }
.ri-file-line:before { content: "\ec58"; }
.ri-file-list-2-fill:before { content: "\ec59"; }
.ri-file-list-2-line:before { content: "\ec5a"; }
.ri-file-list-3-fill:before { content: "\ec5b"; }
.ri-file-list-3-line:before { content: "\ec5c"; }
.ri-file-list-fill:before { content: "\ec5d"; }
.ri-file-list-line:before { content: "\ec5e"; }
.ri-file-lock-fill:before { content: "\ec5f"; }
.ri-file-lock-line:before { content: "\ec60"; }
.ri-file-mark-fill:before { content: "\ec61"; }
.ri-file-mark-line:before { content: "\ec62"; }
.ri-file-music-fill:before { content: "\ec63"; }
.ri-file-music-line:before { content: "\ec64"; }
.ri-file-paper-fill:before { content: "\ec65"; }
.ri-file-paper-line:before { content: "\ec66"; }
.ri-file-pdf-fill:before { content: "\ec67"; }
.ri-file-pdf-line:before { content: "\ec68"; }
.ri-file-ppt-2-fill:before { content: "\ec69"; }
.ri-file-ppt-2-line:before { content: "\ec6a"; }
.ri-file-ppt-fill:before { content: "\ec6b"; }
.ri-file-ppt-line:before { content: "\ec6c"; }
.ri-file-reduce-fill:before { content: "\ec6d"; }
.ri-file-reduce-line:before { content: "\ec6e"; }
.ri-file-search-fill:before { content: "\ec6f"; }
.ri-file-search-line:before { content: "\ec70"; }
.ri-file-settings-fill:before { content: "\ec71"; }
.ri-file-settings-line:before { content: "\ec72"; }
.ri-file-shield-2-fill:before { content: "\ec73"; }
.ri-file-shield-2-line:before { content: "\ec74"; }
.ri-file-shield-fill:before { content: "\ec75"; }
.ri-file-shield-line:before { content: "\ec76"; }
.ri-file-shred-fill:before { content: "\ec77"; }
.ri-file-shred-line:before { content: "\ec78"; }
.ri-file-text-fill:before { content: "\ec79"; }
.ri-file-text-line:before { content: "\ec7a"; }
.ri-file-transfer-fill:before { content: "\ec7b"; }
.ri-file-transfer-line:before { content: "\ec7c"; }
.ri-file-unknow-fill:before { content: "\ec7d"; }
.ri-file-unknow-line:before { content: "\ec7e"; }
.ri-file-upload-fill:before { content: "\ec7f"; }
.ri-file-upload-line:before { content: "\ec80"; }
.ri-file-user-fill:before { content: "\ec81"; }
.ri-file-user-line:before { content: "\ec82"; }
.ri-file-warning-fill:before { content: "\ec83"; }
.ri-file-warning-line:before { content: "\ec84"; }
.ri-file-word-2-fill:before { content: "\ec85"; }
.ri-file-word-2-line:before { content: "\ec86"; }
.ri-file-word-fill:before { content: "\ec87"; }
.ri-file-word-line:before { content: "\ec88"; }
.ri-file-zip-fill:before { content: "\ec89"; }
.ri-file-zip-line:before { content: "\ec8a"; }
.ri-film-fill:before { content: "\ec8b"; }
.ri-film-line:before { content: "\ec8c"; }
.ri-filter-2-fill:before { content: "\ec8d"; }
.ri-filter-2-line:before { content: "\ec8e"; }
.ri-filter-3-fill:before { content: "\ec8f"; }
.ri-filter-3-line:before { content: "\ec90"; }
.ri-filter-fill:before { content: "\ec91"; }
.ri-filter-line:before { content: "\ec92"; }
.ri-find-replace-fill:before { content: "\ec93"; }
.ri-find-replace-line:before { content: "\ec94"; }
.ri-fingerprint-2-fill:before { content: "\ec95"; }
.ri-fingerprint-2-line:before { content: "\ec96"; }
.ri-fingerprint-fill:before { content: "\ec97"; }
.ri-fingerprint-line:before { content: "\ec98"; }
.ri-fire-fill:before { content: "\ec99"; }
.ri-fire-line:before { content: "\ec9a"; }
.ri-firefox-fill:before { content: "\ec9b"; }
.ri-firefox-line:before { content: "\ec9c"; }
.ri-flag-2-fill:before { content: "\ec9d"; }
.ri-flag-2-line:before { content: "\ec9e"; }
.ri-flag-fill:before { content: "\ec9f"; }
.ri-flag-line:before { content: "\eca0"; }
.ri-flashlight-fill:before { content: "\eca1"; }
.ri-flashlight-line:before { content: "\eca2"; }
.ri-flight-land-fill:before { content: "\eca3"; }
.ri-flight-land-line:before { content: "\eca4"; }
.ri-flight-takeoff-fill:before { content: "\eca5"; }
.ri-flight-takeoff-line:before { content: "\eca6"; }
.ri-focus-2-fill:before { content: "\eca7"; }
.ri-focus-2-line:before { content: "\eca8"; }
.ri-focus-fill:before { content: "\eca9"; }
.ri-focus-line:before { content: "\ecaa"; }
.ri-foggy-fill:before { content: "\ecab"; }
.ri-foggy-line:before { content: "\ecac"; }
.ri-folder-2-fill:before { content: "\ecad"; }
.ri-folder-2-line:before { content: "\ecae"; }
.ri-folder-3-fill:before { content: "\ecaf"; }
.ri-folder-3-line:before { content: "\ecb0"; }
.ri-folder-4-fill:before { content: "\ecb1"; }
.ri-folder-4-line:before { content: "\ecb2"; }
.ri-folder-5-fill:before { content: "\ecb3"; }
.ri-folder-5-line:before { content: "\ecb4"; }
.ri-folder-add-fill:before { content: "\ecb5"; }
.ri-folder-add-line:before { content: "\ecb6"; }
.ri-folder-chart-2-fill:before { content: "\ecb7"; }
.ri-folder-chart-2-line:before { content: "\ecb8"; }
.ri-folder-chart-fill:before { content: "\ecb9"; }
.ri-folder-chart-line:before { content: "\ecba"; }
.ri-folder-download-fill:before { content: "\ecbb"; }
.ri-folder-download-line:before { content: "\ecbc"; }
.ri-folder-fill:before { content: "\ecbd"; }
.ri-folder-forbid-fill:before { content: "\ecbe"; }
.ri-folder-forbid-line:before { content: "\ecbf"; }
.ri-folder-info-fill:before { content: "\ecc0"; }
.ri-folder-info-line:before { content: "\ecc1"; }
.ri-folder-line:before { content: "\ecc2"; }
.ri-folder-lock-fill:before { content: "\ecc3"; }
.ri-folder-lock-line:before { content: "\ecc4"; }
.ri-folder-music-fill:before { content: "\ecc5"; }
.ri-folder-music-line:before { content: "\ecc6"; }
.ri-folder-open-fill:before { content: "\ecc7"; }
.ri-folder-open-line:before { content: "\ecc8"; }
.ri-folder-received-fill:before { content: "\ecc9"; }
.ri-folder-received-line:before { content: "\ecca"; }
.ri-folder-reduce-fill:before { content: "\eccb"; }
.ri-folder-reduce-line:before { content: "\eccc"; }
.ri-folder-settings-fill:before { content: "\eccd"; }
.ri-folder-settings-line:before { content: "\ecce"; }
.ri-folder-shared-fill:before { content: "\eccf"; }
.ri-folder-shared-line:before { content: "\ecd0"; }
.ri-folder-shield-2-fill:before { content: "\ecd1"; }
.ri-folder-shield-2-line:before { content: "\ecd2"; }
.ri-folder-shield-fill:before { content: "\ecd3"; }
.ri-folder-shield-line:before { content: "\ecd4"; }
.ri-folder-transfer-fill:before { content: "\ecd5"; }
.ri-folder-transfer-line:before { content: "\ecd6"; }
.ri-folder-unknow-fill:before { content: "\ecd7"; }
.ri-folder-unknow-line:before { content: "\ecd8"; }
.ri-folder-upload-fill:before { content: "\ecd9"; }
.ri-folder-upload-line:before { content: "\ecda"; }
.ri-folder-user-fill:before { content: "\ecdb"; }
.ri-folder-user-line:before { content: "\ecdc"; }
.ri-folder-warning-fill:before { content: "\ecdd"; }
.ri-folder-warning-line:before { content: "\ecde"; }
.ri-folders-fill:before { content: "\ecdf"; }
.ri-folders-line:before { content: "\ece0"; }
.ri-font-color:before { content: "\ece1"; }
.ri-font-size-2:before { content: "\ece2"; }
.ri-font-size:before { content: "\ece3"; }
.ri-footprint-fill:before { content: "\ece4"; }
.ri-footprint-line:before { content: "\ece5"; }
.ri-forbid-2-fill:before { content: "\ece6"; }
.ri-forbid-2-line:before { content: "\ece7"; }
.ri-forbid-fill:before { content: "\ece8"; }
.ri-forbid-line:before { content: "\ece9"; }
.ri-format-clear:before { content: "\ecea"; }
.ri-fullscreen-exit-fill:before { content: "\eceb"; }
.ri-fullscreen-exit-line:before { content: "\ecec"; }
.ri-fullscreen-fill:before { content: "\eced"; }
.ri-fullscreen-line:before { content: "\ecee"; }
.ri-function-fill:before { content: "\ecef"; }
.ri-function-line:before { content: "\ecf0"; }
.ri-functions:before { content: "\ecf1"; }
.ri-funds-box-fill:before { content: "\ecf2"; }
.ri-funds-box-line:before { content: "\ecf3"; }
.ri-funds-fill:before { content: "\ecf4"; }
.ri-funds-line:before { content: "\ecf5"; }
.ri-gallery-fill:before { content: "\ecf6"; }
.ri-gallery-line:before { content: "\ecf7"; }
.ri-gas-station-fill:before { content: "\ecf8"; }
.ri-gas-station-line:before { content: "\ecf9"; }
.ri-genderless-fill:before { content: "\ecfa"; }
.ri-genderless-line:before { content: "\ecfb"; }
.ri-git-branch-fill:before { content: "\ecfc"; }
.ri-git-branch-line:before { content: "\ecfd"; }
.ri-git-commit-fill:before { content: "\ecfe"; }
.ri-git-commit-line:before { content: "\ecff"; }
.ri-git-merge-fill:before { content: "\ed00"; }
.ri-git-merge-line:before { content: "\ed01"; }
.ri-git-pull-request-fill:before { content: "\ed02"; }
.ri-git-pull-request-line:before { content: "\ed03"; }
.ri-git-repository-commits-fill:before { content: "\ed04"; }
.ri-git-repository-commits-line:before { content: "\ed05"; }
.ri-git-repository-fill:before { content: "\ed06"; }
.ri-git-repository-line:before { content: "\ed07"; }
.ri-git-repository-private-fill:before { content: "\ed08"; }
.ri-git-repository-private-line:before { content: "\ed09"; }
.ri-github-fill:before { content: "\ed0a"; }
.ri-github-line:before { content: "\ed0b"; }
.ri-gitlab-fill:before { content: "\ed0c"; }
.ri-gitlab-line:before { content: "\ed0d"; }
.ri-global-fill:before { content: "\ed0e"; }
.ri-global-line:before { content: "\ed0f"; }
.ri-globe-fill:before { content: "\ed10"; }
.ri-globe-line:before { content: "\ed11"; }
.ri-goblet-fill:before { content: "\ed12"; }
.ri-goblet-line:before { content: "\ed13"; }
.ri-google-fill:before { content: "\ed14"; }
.ri-google-line:before { content: "\ed15"; }
.ri-government-fill:before { content: "\ed16"; }
.ri-government-line:before { content: "\ed17"; }
.ri-gps-fill:before { content: "\ed18"; }
.ri-gps-line:before { content: "\ed19"; }
.ri-gradienter-fill:before { content: "\ed1a"; }
.ri-gradienter-line:before { content: "\ed1b"; }
.ri-grid-fill:before { content: "\ed1c"; }
.ri-grid-line:before { content: "\ed1d"; }
.ri-group-2-fill:before { content: "\ed1e"; }
.ri-group-2-line:before { content: "\ed1f"; }
.ri-group-fill:before { content: "\ed20"; }
.ri-group-line:before { content: "\ed21"; }
.ri-guide-fill:before { content: "\ed22"; }
.ri-guide-line:before { content: "\ed23"; }
.ri-hail-fill:before { content: "\ed24"; }
.ri-hail-line:before { content: "\ed25"; }
.ri-hammer-fill:before { content: "\ed26"; }
.ri-hammer-line:before { content: "\ed27"; }
.ri-hard-drive-2-fill:before { content: "\ed28"; }
.ri-hard-drive-2-line:before { content: "\ed29"; }
.ri-hard-drive-fill:before { content: "\ed2a"; }
.ri-hard-drive-line:before { content: "\ed2b"; }
.ri-hashtag:before { content: "\ed2c"; }
.ri-haze-fill:before { content: "\ed2d"; }
.ri-haze-line:before { content: "\ed2e"; }
.ri-hd-fill:before { content: "\ed2f"; }
.ri-hd-line:before { content: "\ed30"; }
.ri-heading:before { content: "\ed31"; }
.ri-headphone-fill:before { content: "\ed32"; }
.ri-headphone-line:before { content: "\ed33"; }
.ri-heart-2-fill:before { content: "\ed34"; }
.ri-heart-2-line:before { content: "\ed35"; }
.ri-heart-fill:before { content: "\ed36"; }
.ri-heart-line:before { content: "\ed37"; }
.ri-heavy-showers-fill:before { content: "\ed38"; }
.ri-heavy-showers-line:before { content: "\ed39"; }
.ri-home-2-fill:before { content: "\ed3a"; }
.ri-home-2-line:before { content: "\ed3b"; }
.ri-home-3-fill:before { content: "\ed3c"; }
.ri-home-3-line:before { content: "\ed3d"; }
.ri-home-4-fill:before { content: "\ed3e"; }
.ri-home-4-line:before { content: "\ed3f"; }
.ri-home-5-fill:before { content: "\ed40"; }
.ri-home-5-line:before { content: "\ed41"; }
.ri-home-6-fill:before { content: "\ed42"; }
.ri-home-6-line:before { content: "\ed43"; }
.ri-home-7-fill:before { content: "\ed44"; }
.ri-home-7-line:before { content: "\ed45"; }
.ri-home-8-fill:before { content: "\ed46"; }
.ri-home-8-line:before { content: "\ed47"; }
.ri-home-fill:before { content: "\ed48"; }
.ri-home-gear-fill:before { content: "\ed49"; }
.ri-home-gear-line:before { content: "\ed4a"; }
.ri-home-heart-fill:before { content: "\ed4b"; }
.ri-home-heart-line:before { content: "\ed4c"; }
.ri-home-line:before { content: "\ed4d"; }
.ri-home-smile-2-fill:before { content: "\ed4e"; }
.ri-home-smile-2-line:before { content: "\ed4f"; }
.ri-home-smile-fill:before { content: "\ed50"; }
.ri-home-smile-line:before { content: "\ed51"; }
.ri-home-wifi-fill:before { content: "\ed52"; }
.ri-home-wifi-line:before { content: "\ed53"; }
.ri-honour-fill:before { content: "\ed54"; }
.ri-honour-line:before { content: "\ed55"; }
.ri-hospital-fill:before { content: "\ed56"; }
.ri-hospital-line:before { content: "\ed57"; }
.ri-hotel-bed-fill:before { content: "\ed58"; }
.ri-hotel-bed-line:before { content: "\ed59"; }
.ri-hotel-fill:before { content: "\ed5a"; }
.ri-hotel-line:before { content: "\ed5b"; }
.ri-hq-fill:before { content: "\ed5c"; }
.ri-hq-line:before { content: "\ed5d"; }
.ri-html5-fill:before { content: "\ed5e"; }
.ri-html5-line:before { content: "\ed5f"; }
.ri-ie-fill:before { content: "\ed60"; }
.ri-ie-line:before { content: "\ed61"; }
.ri-image-2-fill:before { content: "\ed62"; }
.ri-image-2-line:before { content: "\ed63"; }
.ri-image-fill:before { content: "\ed64"; }
.ri-image-line:before { content: "\ed65"; }
.ri-inbox-archive-fill:before { content: "\ed66"; }
.ri-inbox-archive-line:before { content: "\ed67"; }
.ri-inbox-fill:before { content: "\ed68"; }
.ri-inbox-line:before { content: "\ed69"; }
.ri-increase-decrease-fill:before { content: "\ed6a"; }
.ri-increase-decrease-line:before { content: "\ed6b"; }
.ri-indent-decrease:before { content: "\ed6c"; }
.ri-indent-increase:before { content: "\ed6d"; }
.ri-indeterminate-circle-fill:before { content: "\ed6e"; }
.ri-indeterminate-circle-line:before { content: "\ed6f"; }
.ri-information-fill:before { content: "\ed70"; }
.ri-information-line:before { content: "\ed71"; }
.ri-input-method-fill:before { content: "\ed72"; }
.ri-input-method-line:before { content: "\ed73"; }
.ri-instagram-fill:before { content: "\ed74"; }
.ri-instagram-line:before { content: "\ed75"; }
.ri-invision-fill:before { content: "\ed76"; }
.ri-invision-line:before { content: "\ed77"; }
.ri-italic:before { content: "\ed78"; }
.ri-kakao-talk-fill:before { content: "\ed79"; }
.ri-kakao-talk-line:before { content: "\ed7a"; }
.ri-key-2-fill:before { content: "\ed7b"; }
.ri-key-2-line:before { content: "\ed7c"; }
.ri-key-fill:before { content: "\ed7d"; }
.ri-key-line:before { content: "\ed7e"; }
.ri-keyboard-box-fill:before { content: "\ed7f"; }
.ri-keyboard-box-line:before { content: "\ed80"; }
.ri-keyboard-fill:before { content: "\ed81"; }
.ri-keyboard-line:before { content: "\ed82"; }
.ri-keynote-fill:before { content: "\ed83"; }
.ri-keynote-line:before { content: "\ed84"; }
.ri-landscape-fill:before { content: "\ed85"; }
.ri-landscape-line:before { content: "\ed86"; }
.ri-layout-column-fill:before { content: "\ed87"; }
.ri-layout-column-line:before { content: "\ed88"; }
.ri-layout-fill:before { content: "\ed89"; }
.ri-layout-line:before { content: "\ed8a"; }
.ri-layout-row-fill:before { content: "\ed8b"; }
.ri-layout-row-line:before { content: "\ed8c"; }
.ri-lightbulb-fill:before { content: "\ed8d"; }
.ri-lightbulb-flash-fill:before { content: "\ed8e"; }
.ri-lightbulb-flash-line:before { content: "\ed8f"; }
.ri-lightbulb-line:before { content: "\ed90"; }
.ri-line-fill:before { content: "\ed91"; }
.ri-line-height:before { content: "\ed92"; }
.ri-line-line:before { content: "\ed93"; }
.ri-link-m:before { content: "\ed94"; }
.ri-link-unlink-m:before { content: "\ed95"; }
.ri-link-unlink:before { content: "\ed96"; }
.ri-link:before { content: "\ed97"; }
.ri-linkedin-box-fill:before { content: "\ed98"; }
.ri-linkedin-box-line:before { content: "\ed99"; }
.ri-linkedin-fill:before { content: "\ed9a"; }
.ri-linkedin-line:before { content: "\ed9b"; }
.ri-links-fill:before { content: "\ed9c"; }
.ri-links-line:before { content: "\ed9d"; }
.ri-list-check-2:before { content: "\ed9e"; }
.ri-list-check:before { content: "\ed9f"; }
.ri-list-ordered:before { content: "\eda0"; }
.ri-list-settings-fill:before { content: "\eda1"; }
.ri-list-settings-line:before { content: "\eda2"; }
.ri-list-unordered:before { content: "\eda3"; }
.ri-loader-2-fill:before { content: "\eda4"; }
.ri-loader-2-line:before { content: "\eda5"; }
.ri-loader-3-fill:before { content: "\eda6"; }
.ri-loader-3-line:before { content: "\eda7"; }
.ri-loader-4-fill:before { content: "\eda8"; }
.ri-loader-4-line:before { content: "\eda9"; }
.ri-loader-5-fill:before { content: "\edaa"; }
.ri-loader-5-line:before { content: "\edab"; }
.ri-loader-fill:before { content: "\edac"; }
.ri-loader-line:before { content: "\edad"; }
.ri-lock-2-fill:before { content: "\edae"; }
.ri-lock-2-line:before { content: "\edaf"; }
.ri-lock-fill:before { content: "\edb0"; }
.ri-lock-line:before { content: "\edb1"; }
.ri-lock-password-fill:before { content: "\edb2"; }
.ri-lock-password-line:before { content: "\edb3"; }
.ri-lock-unlock-fill:before { content: "\edb4"; }
.ri-lock-unlock-line:before { content: "\edb5"; }
.ri-login-box-fill:before { content: "\edb6"; }
.ri-login-box-line:before { content: "\edb7"; }
.ri-login-circle-fill:before { content: "\edb8"; }
.ri-login-circle-line:before { content: "\edb9"; }
.ri-logout-box-fill:before { content: "\edba"; }
.ri-logout-box-line:before { content: "\edbb"; }
.ri-logout-box-r-fill:before { content: "\edbc"; }
.ri-logout-box-r-line:before { content: "\edbd"; }
.ri-logout-circle-fill:before { content: "\edbe"; }
.ri-logout-circle-line:before { content: "\edbf"; }
.ri-logout-circle-r-fill:before { content: "\edc0"; }
.ri-logout-circle-r-line:before { content: "\edc1"; }
.ri-mac-fill:before { content: "\edc2"; }
.ri-mac-line:before { content: "\edc3"; }
.ri-macbook-fill:before { content: "\edc4"; }
.ri-macbook-line:before { content: "\edc5"; }
.ri-magic-fill:before { content: "\edc6"; }
.ri-magic-line:before { content: "\edc7"; }
.ri-mail-add-fill:before { content: "\edc8"; }
.ri-mail-add-line:before { content: "\edc9"; }
.ri-mail-check-fill:before { content: "\edca"; }
.ri-mail-check-line:before { content: "\edcb"; }
.ri-mail-close-fill:before { content: "\edcc"; }
.ri-mail-close-line:before { content: "\edcd"; }
.ri-mail-download-fill:before { content: "\edce"; }
.ri-mail-download-line:before { content: "\edcf"; }
.ri-mail-fill:before { content: "\edd0"; }
.ri-mail-forbid-fill:before { content: "\edd1"; }
.ri-mail-forbid-line:before { content: "\edd2"; }
.ri-mail-line:before { content: "\edd3"; }
.ri-mail-lock-fill:before { content: "\edd4"; }
.ri-mail-lock-line:before { content: "\edd5"; }
.ri-mail-open-fill:before { content: "\edd6"; }
.ri-mail-open-line:before { content: "\edd7"; }
.ri-mail-send-fill:before { content: "\edd8"; }
.ri-mail-send-line:before { content: "\edd9"; }
.ri-mail-settings-fill:before { content: "\edda"; }
.ri-mail-settings-line:before { content: "\eddb"; }
.ri-mail-star-fill:before { content: "\eddc"; }
.ri-mail-star-line:before { content: "\eddd"; }
.ri-mail-unread-fill:before { content: "\edde"; }
.ri-mail-unread-line:before { content: "\eddf"; }
.ri-map-2-fill:before { content: "\ede0"; }
.ri-map-2-line:before { content: "\ede1"; }
.ri-map-fill:before { content: "\ede2"; }
.ri-map-line:before { content: "\ede3"; }
.ri-map-pin-2-fill:before { content: "\ede4"; }
.ri-map-pin-2-line:before { content: "\ede5"; }
.ri-map-pin-3-fill:before { content: "\ede6"; }
.ri-map-pin-3-line:before { content: "\ede7"; }
.ri-map-pin-4-fill:before { content: "\ede8"; }
.ri-map-pin-4-line:before { content: "\ede9"; }
.ri-map-pin-5-fill:before { content: "\edea"; }
.ri-map-pin-5-line:before { content: "\edeb"; }
.ri-map-pin-add-fill:before { content: "\edec"; }
.ri-map-pin-add-line:before { content: "\eded"; }
.ri-map-pin-fill:before { content: "\edee"; }
.ri-map-pin-line:before { content: "\edef"; }
.ri-map-pin-range-fill:before { content: "\edf0"; }
.ri-map-pin-range-line:before { content: "\edf1"; }
.ri-map-pin-time-fill:before { content: "\edf2"; }
.ri-map-pin-time-line:before { content: "\edf3"; }
.ri-map-pin-user-fill:before { content: "\edf4"; }
.ri-map-pin-user-line:before { content: "\edf5"; }
.ri-mark-pen-fill:before { content: "\edf6"; }
.ri-mark-pen-line:before { content: "\edf7"; }
.ri-markdown-fill:before { content: "\edf8"; }
.ri-markdown-line:before { content: "\edf9"; }
.ri-markup-fill:before { content: "\edfa"; }
.ri-markup-line:before { content: "\edfb"; }
.ri-mastercard-fill:before { content: "\edfc"; }
.ri-mastercard-line:before { content: "\edfd"; }
.ri-mastodon-fill:before { content: "\edfe"; }
.ri-mastodon-line:before { content: "\edff"; }
.ri-medium-fill:before { content: "\ee00"; }
.ri-medium-line:before { content: "\ee01"; }
.ri-men-fill:before { content: "\ee02"; }
.ri-men-line:before { content: "\ee03"; }
.ri-menu-2-fill:before { content: "\ee04"; }
.ri-menu-2-line:before { content: "\ee05"; }
.ri-menu-3-fill:before { content: "\ee06"; }
.ri-menu-3-line:before { content: "\ee07"; }
.ri-menu-fill:before { content: "\ee08"; }
.ri-menu-line:before { content: "\ee09"; }
.ri-message-2-fill:before { content: "\ee0a"; }
.ri-message-2-line:before { content: "\ee0b"; }
.ri-message-3-fill:before { content: "\ee0c"; }
.ri-message-3-line:before { content: "\ee0d"; }
.ri-message-fill:before { content: "\ee0e"; }
.ri-message-line:before { content: "\ee0f"; }
.ri-messenger-fill:before { content: "\ee10"; }
.ri-messenger-line:before { content: "\ee11"; }
.ri-mic-2-fill:before { content: "\ee12"; }
.ri-mic-2-line:before { content: "\ee13"; }
.ri-mic-fill:before { content: "\ee14"; }
.ri-mic-line:before { content: "\ee15"; }
.ri-mic-off-fill:before { content: "\ee16"; }
.ri-mic-off-line:before { content: "\ee17"; }
.ri-mini-program-fill:before { content: "\ee18"; }
.ri-mini-program-line:before { content: "\ee19"; }
.ri-mist-fill:before { content: "\ee1a"; }
.ri-mist-line:before { content: "\ee1b"; }
.ri-money-cny-box-fill:before { content: "\ee1c"; }
.ri-money-cny-box-line:before { content: "\ee1d"; }
.ri-money-cny-circle-fill:before { content: "\ee1e"; }
.ri-money-cny-circle-line:before { content: "\ee1f"; }
.ri-money-dollar-box-fill:before { content: "\ee20"; }
.ri-money-dollar-box-line:before { content: "\ee21"; }
.ri-money-dollar-circle-fill:before { content: "\ee22"; }
.ri-money-dollar-circle-line:before { content: "\ee23"; }
.ri-money-euro-box-fill:before { content: "\ee24"; }
.ri-money-euro-box-line:before { content: "\ee25"; }
.ri-money-euro-circle-fill:before { content: "\ee26"; }
.ri-money-euro-circle-line:before { content: "\ee27"; }
.ri-money-pound-box-fill:before { content: "\ee28"; }
.ri-money-pound-box-line:before { content: "\ee29"; }
.ri-money-pound-circle-fill:before { content: "\ee2a"; }
.ri-money-pound-circle-line:before { content: "\ee2b"; }
.ri-moon-clear-fill:before { content: "\ee2c"; }
.ri-moon-clear-line:before { content: "\ee2d"; }
.ri-moon-cloudy-fill:before { content: "\ee2e"; }
.ri-moon-cloudy-line:before { content: "\ee2f"; }
.ri-moon-fill:before { content: "\ee30"; }
.ri-moon-foggy-fill:before { content: "\ee31"; }
.ri-moon-foggy-line:before { content: "\ee32"; }
.ri-moon-line:before { content: "\ee33"; }
.ri-more-2-fill:before { content: "\ee34"; }
.ri-more-2-line:before { content: "\ee35"; }
.ri-more-fill:before { content: "\ee36"; }
.ri-more-line:before { content: "\ee37"; }
.ri-motorbike-fill:before { content: "\ee38"; }
.ri-motorbike-line:before { content: "\ee39"; }
.ri-mouse-fill:before { content: "\ee3a"; }
.ri-mouse-line:before { content: "\ee3b"; }
.ri-movie-2-fill:before { content: "\ee3c"; }
.ri-movie-2-line:before { content: "\ee3d"; }
.ri-movie-fill:before { content: "\ee3e"; }
.ri-movie-line:before { content: "\ee3f"; }
.ri-music-2-fill:before { content: "\ee40"; }
.ri-music-2-line:before { content: "\ee41"; }
.ri-music-fill:before { content: "\ee42"; }
.ri-music-line:before { content: "\ee43"; }
.ri-mv-fill:before { content: "\ee44"; }
.ri-mv-line:before { content: "\ee45"; }
.ri-navigation-fill:before { content: "\ee46"; }
.ri-navigation-line:before { content: "\ee47"; }
.ri-netease-cloud-music-fill:before { content: "\ee48"; }
.ri-netease-cloud-music-line:before { content: "\ee49"; }
.ri-netflix-fill:before { content: "\ee4a"; }
.ri-netflix-line:before { content: "\ee4b"; }
.ri-newspaper-fill:before { content: "\ee4c"; }
.ri-newspaper-line:before { content: "\ee4d"; }
.ri-notification-2-fill:before { content: "\ee4e"; }
.ri-notification-2-line:before { content: "\ee4f"; }
.ri-notification-3-fill:before { content: "\ee50"; }
.ri-notification-3-line:before { content: "\ee51"; }
.ri-notification-4-fill:before { content: "\ee52"; }
.ri-notification-4-line:before { content: "\ee53"; }
.ri-notification-badge-fill:before { content: "\ee54"; }
.ri-notification-badge-line:before { content: "\ee55"; }
.ri-notification-fill:before { content: "\ee56"; }
.ri-notification-line:before { content: "\ee57"; }
.ri-notification-off-fill:before { content: "\ee58"; }
.ri-notification-off-line:before { content: "\ee59"; }
.ri-number-0:before { content: "\ee5a"; }
.ri-number-1:before { content: "\ee5b"; }
.ri-number-2:before { content: "\ee5c"; }
.ri-number-3:before { content: "\ee5d"; }
.ri-number-4:before { content: "\ee5e"; }
.ri-number-5:before { content: "\ee5f"; }
.ri-number-6:before { content: "\ee60"; }
.ri-number-7:before { content: "\ee61"; }
.ri-number-8:before { content: "\ee62"; }
.ri-number-9:before { content: "\ee63"; }
.ri-numbers-fill:before { content: "\ee64"; }
.ri-numbers-line:before { content: "\ee65"; }
.ri-oil-fill:before { content: "\ee66"; }
.ri-oil-line:before { content: "\ee67"; }
.ri-omega:before { content: "\ee68"; }
.ri-open-arm-fill:before { content: "\ee69"; }
.ri-open-arm-line:before { content: "\ee6a"; }
.ri-opera-fill:before { content: "\ee6b"; }
.ri-opera-line:before { content: "\ee6c"; }
.ri-order-play-fill:before { content: "\ee6d"; }
.ri-order-play-line:before { content: "\ee6e"; }
.ri-outlet-2-fill:before { content: "\ee6f"; }
.ri-outlet-2-line:before { content: "\ee70"; }
.ri-outlet-fill:before { content: "\ee71"; }
.ri-outlet-line:before { content: "\ee72"; }
.ri-page-separator:before { content: "\ee73"; }
.ri-pages-fill:before { content: "\ee74"; }
.ri-pages-line:before { content: "\ee75"; }
.ri-paint-brush-fill:before { content: "\ee76"; }
.ri-paint-brush-line:before { content: "\ee77"; }
.ri-paint-fill:before { content: "\ee78"; }
.ri-paint-line:before { content: "\ee79"; }
.ri-palette-fill:before { content: "\ee7a"; }
.ri-palette-line:before { content: "\ee7b"; }
.ri-pantone-fill:before { content: "\ee7c"; }
.ri-pantone-line:before { content: "\ee7d"; }
.ri-paragraph:before { content: "\ee7e"; }
.ri-parent-fill:before { content: "\ee7f"; }
.ri-parent-line:before { content: "\ee80"; }
.ri-parentheses-fill:before { content: "\ee81"; }
.ri-parentheses-line:before { content: "\ee82"; }
.ri-parking-box-fill:before { content: "\ee83"; }
.ri-parking-box-line:before { content: "\ee84"; }
.ri-parking-fill:before { content: "\ee85"; }
.ri-parking-line:before { content: "\ee86"; }
.ri-patreon-fill:before { content: "\ee87"; }
.ri-patreon-line:before { content: "\ee88"; }
.ri-pause-circle-fill:before { content: "\ee89"; }
.ri-pause-circle-line:before { content: "\ee8a"; }
.ri-pause-fill:before { content: "\ee8b"; }
.ri-pause-line:before { content: "\ee8c"; }
.ri-pause-mini-fill:before { content: "\ee8d"; }
.ri-pause-mini-line:before { content: "\ee8e"; }
.ri-paypal-fill:before { content: "\ee8f"; }
.ri-paypal-line:before { content: "\ee90"; }
.ri-pen-nib-fill:before { content: "\ee91"; }
.ri-pen-nib-line:before { content: "\ee92"; }
.ri-pencil-fill:before { content: "\ee93"; }
.ri-pencil-line:before { content: "\ee94"; }
.ri-pencil-ruler-2-fill:before { content: "\ee95"; }
.ri-pencil-ruler-2-line:before { content: "\ee96"; }
.ri-pencil-ruler-fill:before { content: "\ee97"; }
.ri-pencil-ruler-line:before { content: "\ee98"; }
.ri-percent-fill:before { content: "\ee99"; }
.ri-percent-line:before { content: "\ee9a"; }
.ri-phone-camera-fill:before { content: "\ee9b"; }
.ri-phone-camera-line:before { content: "\ee9c"; }
.ri-phone-fill:before { content: "\ee9d"; }
.ri-phone-line:before { content: "\ee9e"; }
.ri-pie-chart-2-fill:before { content: "\ee9f"; }
.ri-pie-chart-2-line:before { content: "\eea0"; }
.ri-pie-chart-box-fill:before { content: "\eea1"; }
.ri-pie-chart-box-line:before { content: "\eea2"; }
.ri-pie-chart-fill:before { content: "\eea3"; }
.ri-pie-chart-line:before { content: "\eea4"; }
.ri-pin-distance-fill:before { content: "\eea5"; }
.ri-pin-distance-line:before { content: "\eea6"; }
.ri-pinterest-fill:before { content: "\eea7"; }
.ri-pinterest-line:before { content: "\eea8"; }
.ri-plane-fill:before { content: "\eea9"; }
.ri-plane-line:before { content: "\eeaa"; }
.ri-play-circle-fill:before { content: "\eeab"; }
.ri-play-circle-line:before { content: "\eeac"; }
.ri-play-fill:before { content: "\eead"; }
.ri-play-line:before { content: "\eeae"; }
.ri-play-list-add-fill:before { content: "\eeaf"; }
.ri-play-list-add-line:before { content: "\eeb0"; }
.ri-play-list-fill:before { content: "\eeb1"; }
.ri-play-list-line:before { content: "\eeb2"; }
.ri-play-mini-fill:before { content: "\eeb3"; }
.ri-play-mini-line:before { content: "\eeb4"; }
.ri-playstation-fill:before { content: "\eeb5"; }
.ri-playstation-line:before { content: "\eeb6"; }
.ri-plug-2-fill:before { content: "\eeb7"; }
.ri-plug-2-line:before { content: "\eeb8"; }
.ri-plug-fill:before { content: "\eeb9"; }
.ri-plug-line:before { content: "\eeba"; }
.ri-polaroid-2-fill:before { content: "\eebb"; }
.ri-polaroid-2-line:before { content: "\eebc"; }
.ri-polaroid-fill:before { content: "\eebd"; }
.ri-polaroid-line:before { content: "\eebe"; }
.ri-police-car-fill:before { content: "\eebf"; }
.ri-police-car-line:before { content: "\eec0"; }
.ri-price-tag-2-fill:before { content: "\eec1"; }
.ri-price-tag-2-line:before { content: "\eec2"; }
.ri-price-tag-3-fill:before { content: "\eec3"; }
.ri-price-tag-3-line:before { content: "\eec4"; }
.ri-price-tag-fill:before { content: "\eec5"; }
.ri-price-tag-line:before { content: "\eec6"; }
.ri-printer-fill:before { content: "\eec7"; }
.ri-printer-line:before { content: "\eec8"; }
.ri-product-hunt-fill:before { content: "\eec9"; }
.ri-product-hunt-line:before { content: "\eeca"; }
.ri-profile-fill:before { content: "\eecb"; }
.ri-profile-line:before { content: "\eecc"; }
.ri-projector-2-fill:before { content: "\eecd"; }
.ri-projector-2-line:before { content: "\eece"; }
.ri-projector-fill:before { content: "\eecf"; }
.ri-projector-line:before { content: "\eed0"; }
.ri-push-pin-2-fill:before { content: "\eed1"; }
.ri-push-pin-2-line:before { content: "\eed2"; }
.ri-push-pin-fill:before { content: "\eed3"; }
.ri-push-pin-line:before { content: "\eed4"; }
.ri-qq-fill:before { content: "\eed5"; }
.ri-qq-line:before { content: "\eed6"; }
.ri-qr-code-fill:before { content: "\eed7"; }
.ri-qr-code-line:before { content: "\eed8"; }
.ri-qr-scan-2-fill:before { content: "\eed9"; }
.ri-qr-scan-2-line:before { content: "\eeda"; }
.ri-qr-scan-fill:before { content: "\eedb"; }
.ri-qr-scan-line:before { content: "\eedc"; }
.ri-question-answer-fill:before { content: "\eedd"; }
.ri-question-answer-line:before { content: "\eede"; }
.ri-question-fill:before { content: "\eedf"; }
.ri-question-line:before { content: "\eee0"; }
.ri-questionnaire-fill:before { content: "\eee1"; }
.ri-questionnaire-line:before { content: "\eee2"; }
.ri-quill-pen-fill:before { content: "\eee3"; }
.ri-quill-pen-line:before { content: "\eee4"; }
.ri-radar-fill:before { content: "\eee5"; }
.ri-radar-line:before { content: "\eee6"; }
.ri-radio-2-fill:before { content: "\eee7"; }
.ri-radio-2-line:before { content: "\eee8"; }
.ri-radio-button-fill:before { content: "\eee9"; }
.ri-radio-button-line:before { content: "\eeea"; }
.ri-radio-fill:before { content: "\eeeb"; }
.ri-radio-line:before { content: "\eeec"; }
.ri-rainy-fill:before { content: "\eeed"; }
.ri-rainy-line:before { content: "\eeee"; }
.ri-reactjs-fill:before { content: "\eeef"; }
.ri-reactjs-line:before { content: "\eef0"; }
.ri-record-circle-fill:before { content: "\eef1"; }
.ri-record-circle-line:before { content: "\eef2"; }
.ri-record-mail-fill:before { content: "\eef3"; }
.ri-record-mail-line:before { content: "\eef4"; }
.ri-red-packet-fill:before { content: "\eef5"; }
.ri-red-packet-line:before { content: "\eef6"; }
.ri-reddit-fill:before { content: "\eef7"; }
.ri-reddit-line:before { content: "\eef8"; }
.ri-refresh-fill:before { content: "\eef9"; }
.ri-refresh-line:before { content: "\eefa"; }
.ri-refund-fill:before { content: "\eefb"; }
.ri-refund-line:before { content: "\eefc"; }
.ri-remixicon-fill:before { content: "\eefd"; }
.ri-remixicon-line:before { content: "\eefe"; }
.ri-repeat-2-fill:before { content: "\eeff"; }
.ri-repeat-2-line:before { content: "\ef00"; }
.ri-repeat-fill:before { content: "\ef01"; }
.ri-repeat-line:before { content: "\ef02"; }
.ri-repeat-one-fill:before { content: "\ef03"; }
.ri-repeat-one-line:before { content: "\ef04"; }
.ri-reply-fill:before { content: "\ef05"; }
.ri-reply-line:before { content: "\ef06"; }
.ri-reserved-fill:before { content: "\ef07"; }
.ri-reserved-line:before { content: "\ef08"; }
.ri-restart-fill:before { content: "\ef09"; }
.ri-restart-line:before { content: "\ef0a"; }
.ri-restaurant-2-fill:before { content: "\ef0b"; }
.ri-restaurant-2-line:before { content: "\ef0c"; }
.ri-restaurant-fill:before { content: "\ef0d"; }
.ri-restaurant-line:before { content: "\ef0e"; }
.ri-rewind-fill:before { content: "\ef0f"; }
.ri-rewind-line:before { content: "\ef10"; }
.ri-rewind-mini-fill:before { content: "\ef11"; }
.ri-rewind-mini-line:before { content: "\ef12"; }
.ri-rhythm-fill:before { content: "\ef13"; }
.ri-rhythm-line:before { content: "\ef14"; }
.ri-riding-fill:before { content: "\ef15"; }
.ri-riding-line:before { content: "\ef16"; }
.ri-road-map-fill:before { content: "\ef17"; }
.ri-road-map-line:before { content: "\ef18"; }
.ri-roadster-fill:before { content: "\ef19"; }
.ri-roadster-line:before { content: "\ef1a"; }
.ri-robot-fill:before { content: "\ef1b"; }
.ri-robot-line:before { content: "\ef1c"; }
.ri-rocket-2-fill:before { content: "\ef1d"; }
.ri-rocket-2-line:before { content: "\ef1e"; }
.ri-rocket-fill:before { content: "\ef1f"; }
.ri-rocket-line:before { content: "\ef20"; }
.ri-route-fill:before { content: "\ef21"; }
.ri-route-line:before { content: "\ef22"; }
.ri-router-fill:before { content: "\ef23"; }
.ri-router-line:before { content: "\ef24"; }
.ri-rss-fill:before { content: "\ef25"; }
.ri-rss-line:before { content: "\ef26"; }
.ri-ruler-2-fill:before { content: "\ef27"; }
.ri-ruler-2-line:before { content: "\ef28"; }
.ri-ruler-fill:before { content: "\ef29"; }
.ri-ruler-line:before { content: "\ef2a"; }
.ri-run-fill:before { content: "\ef2b"; }
.ri-run-line:before { content: "\ef2c"; }
.ri-safari-fill:before { content: "\ef2d"; }
.ri-safari-line:before { content: "\ef2e"; }
.ri-safe-2-fill:before { content: "\ef2f"; }
.ri-safe-2-line:before { content: "\ef30"; }
.ri-safe-fill:before { content: "\ef31"; }
.ri-safe-line:before { content: "\ef32"; }
.ri-sailboat-fill:before { content: "\ef33"; }
.ri-sailboat-line:before { content: "\ef34"; }
.ri-save-2-fill:before { content: "\ef35"; }
.ri-save-2-line:before { content: "\ef36"; }
.ri-save-3-fill:before { content: "\ef37"; }
.ri-save-3-line:before { content: "\ef38"; }
.ri-save-fill:before { content: "\ef39"; }
.ri-save-line:before { content: "\ef3a"; }
.ri-scan-2-fill:before { content: "\ef3b"; }
.ri-scan-2-line:before { content: "\ef3c"; }
.ri-scan-fill:before { content: "\ef3d"; }
.ri-scan-line:before { content: "\ef3e"; }
.ri-scissors-2-fill:before { content: "\ef3f"; }
.ri-scissors-2-line:before { content: "\ef40"; }
.ri-scissors-cut-fill:before { content: "\ef41"; }
.ri-scissors-cut-line:before { content: "\ef42"; }
.ri-scissors-fill:before { content: "\ef43"; }
.ri-scissors-line:before { content: "\ef44"; }
.ri-screenshot-2-fill:before { content: "\ef45"; }
.ri-screenshot-2-line:before { content: "\ef46"; }
.ri-screenshot-fill:before { content: "\ef47"; }
.ri-screenshot-line:before { content: "\ef48"; }
.ri-sd-card-fill:before { content: "\ef49"; }
.ri-sd-card-line:before { content: "\ef4a"; }
.ri-sd-card-mini-fill:before { content: "\ef4b"; }
.ri-sd-card-mini-line:before { content: "\ef4c"; }
.ri-search-2-fill:before { content: "\ef4d"; }
.ri-search-2-line:before { content: "\ef4e"; }
.ri-search-eye-fill:before { content: "\ef4f"; }
.ri-search-eye-line:before { content: "\ef50"; }
.ri-search-fill:before { content: "\ef51"; }
.ri-search-line:before { content: "\ef52"; }
.ri-send-plane-2-fill:before { content: "\ef53"; }
.ri-send-plane-2-line:before { content: "\ef54"; }
.ri-send-plane-fill:before { content: "\ef55"; }
.ri-send-plane-line:before { content: "\ef56"; }
.ri-sensor-fill:before { content: "\ef57"; }
.ri-sensor-line:before { content: "\ef58"; }
.ri-separator:before { content: "\ef59"; }
.ri-server-fill:before { content: "\ef5a"; }
.ri-server-line:before { content: "\ef5b"; }
.ri-settings-2-fill:before { content: "\ef5c"; }
.ri-settings-2-line:before { content: "\ef5d"; }
.ri-settings-3-fill:before { content: "\ef5e"; }
.ri-settings-3-line:before { content: "\ef5f"; }
.ri-settings-4-fill:before { content: "\ef60"; }
.ri-settings-4-line:before { content: "\ef61"; }
.ri-settings-5-fill:before { content: "\ef62"; }
.ri-settings-5-line:before { content: "\ef63"; }
.ri-settings-6-fill:before { content: "\ef64"; }
.ri-settings-6-line:before { content: "\ef65"; }
.ri-settings-fill:before { content: "\ef66"; }
.ri-settings-line:before { content: "\ef67"; }
.ri-shape-2-fill:before { content: "\ef68"; }
.ri-shape-2-line:before { content: "\ef69"; }
.ri-shape-fill:before { content: "\ef6a"; }
.ri-shape-line:before { content: "\ef6b"; }
.ri-share-box-fill:before { content: "\ef6c"; }
.ri-share-box-line:before { content: "\ef6d"; }
.ri-share-circle-fill:before { content: "\ef6e"; }
.ri-share-circle-line:before { content: "\ef6f"; }
.ri-share-fill:before { content: "\ef70"; }
.ri-share-forward-2-fill:before { content: "\ef71"; }
.ri-share-forward-2-line:before { content: "\ef72"; }
.ri-share-forward-box-fill:before { content: "\ef73"; }
.ri-share-forward-box-line:before { content: "\ef74"; }
.ri-share-forward-fill:before { content: "\ef75"; }
.ri-share-forward-line:before { content: "\ef76"; }
.ri-share-line:before { content: "\ef77"; }
.ri-share-stack-fill:before { content: "\ef78"; }
.ri-share-stack-line:before { content: "\ef79"; }
.ri-shield-cross-fill:before { content: "\ef7a"; }
.ri-shield-cross-line:before { content: "\ef7b"; }
.ri-shield-fill:before { content: "\ef7c"; }
.ri-shield-flash-fill:before { content: "\ef7d"; }
.ri-shield-flash-line:before { content: "\ef7e"; }
.ri-shield-keyhole-fill:before { content: "\ef7f"; }
.ri-shield-keyhole-line:before { content: "\ef80"; }
.ri-shield-line:before { content: "\ef81"; }
.ri-shield-star-fill:before { content: "\ef82"; }
.ri-shield-star-line:before { content: "\ef83"; }
.ri-shield-user-fill:before { content: "\ef84"; }
.ri-shield-user-line:before { content: "\ef85"; }
.ri-ship-2-fill:before { content: "\ef86"; }
.ri-ship-2-line:before { content: "\ef87"; }
.ri-ship-fill:before { content: "\ef88"; }
.ri-ship-line:before { content: "\ef89"; }
.ri-shirt-fill:before { content: "\ef8a"; }
.ri-shirt-line:before { content: "\ef8b"; }
.ri-shopping-bag-2-fill:before { content: "\ef8c"; }
.ri-shopping-bag-2-line:before { content: "\ef8d"; }
.ri-shopping-bag-3-fill:before { content: "\ef8e"; }
.ri-shopping-bag-3-line:before { content: "\ef8f"; }
.ri-shopping-bag-fill:before { content: "\ef90"; }
.ri-shopping-bag-line:before { content: "\ef91"; }
.ri-shopping-cart-2-fill:before { content: "\ef92"; }
.ri-shopping-cart-2-line:before { content: "\ef93"; }
.ri-shopping-cart-fill:before { content: "\ef94"; }
.ri-shopping-cart-line:before { content: "\ef95"; }
.ri-showers-fill:before { content: "\ef96"; }
.ri-showers-line:before { content: "\ef97"; }
.ri-shuffle-fill:before { content: "\ef98"; }
.ri-shuffle-line:before { content: "\ef99"; }
.ri-shut-down-fill:before { content: "\ef9a"; }
.ri-shut-down-line:before { content: "\ef9b"; }
.ri-side-bar-fill:before { content: "\ef9c"; }
.ri-side-bar-line:before { content: "\ef9d"; }
.ri-signal-tower-fill:before { content: "\ef9e"; }
.ri-signal-tower-line:before { content: "\ef9f"; }
.ri-sim-card-2-fill:before { content: "\efa0"; }
.ri-sim-card-2-line:before { content: "\efa1"; }
.ri-sim-card-fill:before { content: "\efa2"; }
.ri-sim-card-line:before { content: "\efa3"; }
.ri-single-quotes-l:before { content: "\efa4"; }
.ri-single-quotes-r:before { content: "\efa5"; }
.ri-sip-fill:before { content: "\efa6"; }
.ri-sip-line:before { content: "\efa7"; }
.ri-skip-back-fill:before { content: "\efa8"; }
.ri-skip-back-line:before { content: "\efa9"; }
.ri-skip-back-mini-fill:before { content: "\efaa"; }
.ri-skip-back-mini-line:before { content: "\efab"; }
.ri-skip-forward-fill:before { content: "\efac"; }
.ri-skip-forward-line:before { content: "\efad"; }
.ri-skip-forward-mini-fill:before { content: "\efae"; }
.ri-skip-forward-mini-line:before { content: "\efaf"; }
.ri-skull-fill:before { content: "\efb0"; }
.ri-skull-line:before { content: "\efb1"; }
.ri-skype-fill:before { content: "\efb2"; }
.ri-skype-line:before { content: "\efb3"; }
.ri-slack-fill:before { content: "\efb4"; }
.ri-slack-line:before { content: "\efb5"; }
.ri-slice-fill:before { content: "\efb6"; }
.ri-slice-line:before { content: "\efb7"; }
.ri-slideshow-2-fill:before { content: "\efb8"; }
.ri-slideshow-2-line:before { content: "\efb9"; }
.ri-slideshow-3-fill:before { content: "\efba"; }
.ri-slideshow-3-line:before { content: "\efbb"; }
.ri-slideshow-4-fill:before { content: "\efbc"; }
.ri-slideshow-4-line:before { content: "\efbd"; }
.ri-slideshow-fill:before { content: "\efbe"; }
.ri-slideshow-line:before { content: "\efbf"; }
.ri-smartphone-fill:before { content: "\efc0"; }
.ri-smartphone-line:before { content: "\efc1"; }
.ri-snapchat-fill:before { content: "\efc2"; }
.ri-snapchat-line:before { content: "\efc3"; }
.ri-snowy-fill:before { content: "\efc4"; }
.ri-snowy-line:before { content: "\efc5"; }
.ri-sound-module-fill:before { content: "\efc6"; }
.ri-sound-module-line:before { content: "\efc7"; }
.ri-space-ship-fill:before { content: "\efc8"; }
.ri-space-ship-line:before { content: "\efc9"; }
.ri-space:before { content: "\efca"; }
.ri-spam-2-fill:before { content: "\efcb"; }
.ri-spam-2-line:before { content: "\efcc"; }
.ri-spam-3-fill:before { content: "\efcd"; }
.ri-spam-3-line:before { content: "\efce"; }
.ri-spam-fill:before { content: "\efcf"; }
.ri-spam-line:before { content: "\efd0"; }
.ri-speaker-2-fill:before { content: "\efd1"; }
.ri-speaker-2-line:before { content: "\efd2"; }
.ri-speaker-3-fill:before { content: "\efd3"; }
.ri-speaker-3-line:before { content: "\efd4"; }
.ri-speaker-fill:before { content: "\efd5"; }
.ri-speaker-line:before { content: "\efd6"; }
.ri-speed-fill:before { content: "\efd7"; }
.ri-speed-line:before { content: "\efd8"; }
.ri-speed-mini-fill:before { content: "\efd9"; }
.ri-speed-mini-line:before { content: "\efda"; }
.ri-spotify-fill:before { content: "\efdb"; }
.ri-spotify-line:before { content: "\efdc"; }
.ri-stack-fill:before { content: "\efdd"; }
.ri-stack-line:before { content: "\efde"; }
.ri-stack-overflow-fill:before { content: "\efdf"; }
.ri-stack-overflow-line:before { content: "\efe0"; }
.ri-star-fill:before { content: "\efe1"; }
.ri-star-half-fill:before { content: "\efe2"; }
.ri-star-half-line:before { content: "\efe3"; }
.ri-star-half-s-fill:before { content: "\efe4"; }
.ri-star-half-s-line:before { content: "\efe5"; }
.ri-star-line:before { content: "\efe6"; }
.ri-star-s-fill:before { content: "\efe7"; }
.ri-star-s-line:before { content: "\efe8"; }
.ri-steering-2-fill:before { content: "\efe9"; }
.ri-steering-2-line:before { content: "\efea"; }
.ri-steering-fill:before { content: "\efeb"; }
.ri-steering-line:before { content: "\efec"; }
.ri-sticky-note-2-fill:before { content: "\efed"; }
.ri-sticky-note-2-line:before { content: "\efee"; }
.ri-sticky-note-fill:before { content: "\efef"; }
.ri-sticky-note-line:before { content: "\eff0"; }
.ri-stock-fill:before { content: "\eff1"; }
.ri-stock-line:before { content: "\eff2"; }
.ri-stop-circle-fill:before { content: "\eff3"; }
.ri-stop-circle-line:before { content: "\eff4"; }
.ri-stop-fill:before { content: "\eff5"; }
.ri-stop-line:before { content: "\eff6"; }
.ri-stop-mini-fill:before { content: "\eff7"; }
.ri-stop-mini-line:before { content: "\eff8"; }
.ri-store-2-fill:before { content: "\eff9"; }
.ri-store-2-line:before { content: "\effa"; }
.ri-store-3-fill:before { content: "\effb"; }
.ri-store-3-line:before { content: "\effc"; }
.ri-store-fill:before { content: "\effd"; }
.ri-store-line:before { content: "\effe"; }
.ri-strikethrough-2:before { content: "\efff"; }
.ri-strikethrough:before { content: "\f000"; }
.ri-subscript-2:before { content: "\f001"; }
.ri-subscript:before { content: "\f002"; }
.ri-subtract-fill:before { content: "\f003"; }
.ri-subtract-line:before { content: "\f004"; }
.ri-subway-fill:before { content: "\f005"; }
.ri-subway-line:before { content: "\f006"; }
.ri-sun-cloudy-fill:before { content: "\f007"; }
.ri-sun-cloudy-line:before { content: "\f008"; }
.ri-sun-fill:before { content: "\f009"; }
.ri-sun-foggy-fill:before { content: "\f00a"; }
.ri-sun-foggy-line:before { content: "\f00b"; }
.ri-sun-line:before { content: "\f00c"; }
.ri-superscript-2:before { content: "\f00d"; }
.ri-superscript:before { content: "\f00e"; }
.ri-surround-sound-fill:before { content: "\f00f"; }
.ri-surround-sound-line:before { content: "\f010"; }
.ri-swap-box-fill:before { content: "\f011"; }
.ri-swap-box-line:before { content: "\f012"; }
.ri-swap-fill:before { content: "\f013"; }
.ri-swap-line:before { content: "\f014"; }
.ri-switch-fill:before { content: "\f015"; }
.ri-switch-line:before { content: "\f016"; }
.ri-t-box-fill:before { content: "\f017"; }
.ri-t-box-line:before { content: "\f018"; }
.ri-t-shirt-fill:before { content: "\f019"; }
.ri-t-shirt-line:before { content: "\f01a"; }
.ri-table-2:before { content: "\f01b"; }
.ri-table-fill:before { content: "\f01c"; }
.ri-table-line:before { content: "\f01d"; }
.ri-tablet-fill:before { content: "\f01e"; }
.ri-tablet-line:before { content: "\f01f"; }
.ri-taobao-fill:before { content: "\f020"; }
.ri-taobao-line:before { content: "\f021"; }
.ri-tape-fill:before { content: "\f022"; }
.ri-tape-line:before { content: "\f023"; }
.ri-task-fill:before { content: "\f024"; }
.ri-task-line:before { content: "\f025"; }
.ri-taxi-fill:before { content: "\f026"; }
.ri-taxi-line:before { content: "\f027"; }
.ri-telegram-fill:before { content: "\f028"; }
.ri-telegram-line:before { content: "\f029"; }
.ri-temp-cold-fill:before { content: "\f02a"; }
.ri-temp-cold-line:before { content: "\f02b"; }
.ri-temp-hot-fill:before { content: "\f02c"; }
.ri-temp-hot-line:before { content: "\f02d"; }
.ri-terminal-box-fill:before { content: "\f02e"; }
.ri-terminal-box-line:before { content: "\f02f"; }
.ri-terminal-fill:before { content: "\f030"; }
.ri-terminal-line:before { content: "\f031"; }
.ri-terminal-window-fill:before { content: "\f032"; }
.ri-terminal-window-line:before { content: "\f033"; }
.ri-text-direction-l:before { content: "\f034"; }
.ri-text-direction-r:before { content: "\f035"; }
.ri-text-spacing:before { content: "\f036"; }
.ri-text-wrap:before { content: "\f037"; }
.ri-text:before { content: "\f038"; }
.ri-thumb-down-fill:before { content: "\f039"; }
.ri-thumb-down-line:before { content: "\f03a"; }
.ri-thumb-up-fill:before { content: "\f03b"; }
.ri-thumb-up-line:before { content: "\f03c"; }
.ri-thunderstorms-fill:before { content: "\f03d"; }
.ri-thunderstorms-line:before { content: "\f03e"; }
.ri-time-fill:before { content: "\f03f"; }
.ri-time-line:before { content: "\f040"; }
.ri-timer-2-fill:before { content: "\f041"; }
.ri-timer-2-line:before { content: "\f042"; }
.ri-timer-fill:before { content: "\f043"; }
.ri-timer-flash-fill:before { content: "\f044"; }
.ri-timer-flash-line:before { content: "\f045"; }
.ri-timer-line:before { content: "\f046"; }
.ri-todo-fill:before { content: "\f047"; }
.ri-todo-line:before { content: "\f048"; }
.ri-toggle-fill:before { content: "\f049"; }
.ri-toggle-line:before { content: "\f04a"; }
.ri-tools-fill:before { content: "\f04b"; }
.ri-tools-line:before { content: "\f04c"; }
.ri-tornado-fill:before { content: "\f04d"; }
.ri-tornado-line:before { content: "\f04e"; }
.ri-traffic-light-fill:before { content: "\f04f"; }
.ri-traffic-light-line:before { content: "\f050"; }
.ri-train-fill:before { content: "\f051"; }
.ri-train-line:before { content: "\f052"; }
.ri-translate-2:before { content: "\f053"; }
.ri-translate:before { content: "\f054"; }
.ri-travesti-fill:before { content: "\f055"; }
.ri-travesti-line:before { content: "\f056"; }
.ri-treasure-map-fill:before { content: "\f057"; }
.ri-treasure-map-line:before { content: "\f058"; }
.ri-trello-fill:before { content: "\f059"; }
.ri-trello-line:before { content: "\f05a"; }
.ri-trophy-fill:before { content: "\f05b"; }
.ri-trophy-line:before { content: "\f05c"; }
.ri-truck-fill:before { content: "\f05d"; }
.ri-truck-line:before { content: "\f05e"; }
.ri-tumblr-fill:before { content: "\f05f"; }
.ri-tumblr-line:before { content: "\f060"; }
.ri-tv-2-fill:before { content: "\f061"; }
.ri-tv-2-line:before { content: "\f062"; }
.ri-tv-fill:before { content: "\f063"; }
.ri-tv-line:before { content: "\f064"; }
.ri-twitch-fill:before { content: "\f065"; }
.ri-twitch-line:before { content: "\f066"; }
.ri-twitter-fill:before { content: "\f067"; }
.ri-twitter-line:before { content: "\f068"; }
.ri-u-disk-fill:before { content: "\f069"; }
.ri-u-disk-line:before { content: "\f06a"; }
.ri-ubuntu-fill:before { content: "\f06b"; }
.ri-ubuntu-line:before { content: "\f06c"; }
.ri-umbrella-fill:before { content: "\f06d"; }
.ri-umbrella-line:before { content: "\f06e"; }
.ri-underline:before { content: "\f06f"; }
.ri-upload-2-fill:before { content: "\f070"; }
.ri-upload-2-line:before { content: "\f071"; }
.ri-upload-cloud-2-fill:before { content: "\f072"; }
.ri-upload-cloud-2-line:before { content: "\f073"; }
.ri-upload-cloud-fill:before { content: "\f074"; }
.ri-upload-cloud-line:before { content: "\f075"; }
.ri-upload-fill:before { content: "\f076"; }
.ri-upload-line:before { content: "\f077"; }
.ri-user-2-fill:before { content: "\f078"; }
.ri-user-2-line:before { content: "\f079"; }
.ri-user-3-fill:before { content: "\f07a"; }
.ri-user-3-line:before { content: "\f07b"; }
.ri-user-4-fill:before { content: "\f07c"; }
.ri-user-4-line:before { content: "\f07d"; }
.ri-user-5-fill:before { content: "\f07e"; }
.ri-user-5-line:before { content: "\f07f"; }
.ri-user-add-fill:before { content: "\f080"; }
.ri-user-add-line:before { content: "\f081"; }
.ri-user-fill:before { content: "\f082"; }
.ri-user-follow-fill:before { content: "\f083"; }
.ri-user-follow-line:before { content: "\f084"; }
.ri-user-line:before { content: "\f085"; }
.ri-user-location-fill:before { content: "\f086"; }
.ri-user-location-line:before { content: "\f087"; }
.ri-user-received-2-fill:before { content: "\f088"; }
.ri-user-received-2-line:before { content: "\f089"; }
.ri-user-received-fill:before { content: "\f08a"; }
.ri-user-received-line:before { content: "\f08b"; }
.ri-user-search-fill:before { content: "\f08c"; }
.ri-user-search-line:before { content: "\f08d"; }
.ri-user-settings-fill:before { content: "\f08e"; }
.ri-user-settings-line:before { content: "\f08f"; }
.ri-user-shared-2-fill:before { content: "\f090"; }
.ri-user-shared-2-line:before { content: "\f091"; }
.ri-user-shared-fill:before { content: "\f092"; }
.ri-user-shared-line:before { content: "\f093"; }
.ri-user-smile-fill:before { content: "\f094"; }
.ri-user-smile-line:before { content: "\f095"; }
.ri-user-star-fill:before { content: "\f096"; }
.ri-user-star-line:before { content: "\f097"; }
.ri-user-unfollow-fill:before { content: "\f098"; }
.ri-user-unfollow-line:before { content: "\f099"; }
.ri-user-voice-fill:before { content: "\f09a"; }
.ri-user-voice-line:before { content: "\f09b"; }
.ri-video-chat-fill:before { content: "\f09c"; }
.ri-video-chat-line:before { content: "\f09d"; }
.ri-video-fill:before { content: "\f09e"; }
.ri-video-line:before { content: "\f09f"; }
.ri-vidicon-2-fill:before { content: "\f0a0"; }
.ri-vidicon-2-line:before { content: "\f0a1"; }
.ri-vidicon-fill:before { content: "\f0a2"; }
.ri-vidicon-line:before { content: "\f0a3"; }
.ri-vip-crown-2-fill:before { content: "\f0a4"; }
.ri-vip-crown-2-line:before { content: "\f0a5"; }
.ri-vip-crown-fill:before { content: "\f0a6"; }
.ri-vip-crown-line:before { content: "\f0a7"; }
.ri-vip-diamond-fill:before { content: "\f0a8"; }
.ri-vip-diamond-line:before { content: "\f0a9"; }
.ri-vip-fill:before { content: "\f0aa"; }
.ri-vip-line:before { content: "\f0ab"; }
.ri-visa-fill:before { content: "\f0ac"; }
.ri-visa-line:before { content: "\f0ad"; }
.ri-voiceprint-fill:before { content: "\f0ae"; }
.ri-voiceprint-line:before { content: "\f0af"; }
.ri-volume-down-fill:before { content: "\f0b0"; }
.ri-volume-down-line:before { content: "\f0b1"; }
.ri-volume-mute-fill:before { content: "\f0b2"; }
.ri-volume-mute-line:before { content: "\f0b3"; }
.ri-volume-up-fill:before { content: "\f0b4"; }
.ri-volume-up-line:before { content: "\f0b5"; }
.ri-vuejs-fill:before { content: "\f0b6"; }
.ri-vuejs-line:before { content: "\f0b7"; }
.ri-walk-fill:before { content: "\f0b8"; }
.ri-walk-line:before { content: "\f0b9"; }
.ri-wallet-2-fill:before { content: "\f0ba"; }
.ri-wallet-2-line:before { content: "\f0bb"; }
.ri-wallet-3-fill:before { content: "\f0bc"; }
.ri-wallet-3-line:before { content: "\f0bd"; }
.ri-wallet-fill:before { content: "\f0be"; }
.ri-wallet-line:before { content: "\f0bf"; }
.ri-water-flash-fill:before { content: "\f0c0"; }
.ri-water-flash-line:before { content: "\f0c1"; }
.ri-webcam-fill:before { content: "\f0c2"; }
.ri-webcam-line:before { content: "\f0c3"; }
.ri-wechat-2-fill:before { content: "\f0c4"; }
.ri-wechat-2-line:before { content: "\f0c5"; }
.ri-wechat-fill:before { content: "\f0c6"; }
.ri-wechat-line:before { content: "\f0c7"; }
.ri-wechat-pay-fill:before { content: "\f0c8"; }
.ri-wechat-pay-line:before { content: "\f0c9"; }
.ri-weibo-fill:before { content: "\f0ca"; }
.ri-weibo-line:before { content: "\f0cb"; }
.ri-whatsapp-fill:before { content: "\f0cc"; }
.ri-whatsapp-line:before { content: "\f0cd"; }
.ri-wifi-fill:before { content: "\f0ce"; }
.ri-wifi-line:before { content: "\f0cf"; }
.ri-wifi-off-fill:before { content: "\f0d0"; }
.ri-wifi-off-line:before { content: "\f0d1"; }
.ri-window-2-fill:before { content: "\f0d2"; }
.ri-window-2-line:before { content: "\f0d3"; }
.ri-window-fill:before { content: "\f0d4"; }
.ri-window-line:before { content: "\f0d5"; }
.ri-windows-fill:before { content: "\f0d6"; }
.ri-windows-line:before { content: "\f0d7"; }
.ri-windy-fill:before { content: "\f0d8"; }
.ri-windy-line:before { content: "\f0d9"; }
.ri-women-fill:before { content: "\f0da"; }
.ri-women-line:before { content: "\f0db"; }
.ri-xbox-fill:before { content: "\f0dc"; }
.ri-xbox-line:before { content: "\f0dd"; }
.ri-xing-fill:before { content: "\f0de"; }
.ri-xing-line:before { content: "\f0df"; }
.ri-youtube-fill:before { content: "\f0e0"; }
.ri-youtube-line:before { content: "\f0e1"; }
.ri-zcool-fill:before { content: "\f0e2"; }
.ri-zcool-line:before { content: "\f0e3"; }
.ri-zhihu-fill:before { content: "\f0e4"; }
.ri-zhihu-line:before { content: "\f0e5"; }
.ri-zoom-in-fill:before { content: "\f0e6"; }
.ri-zoom-in-line:before { content: "\f0e7"; }
.ri-zoom-out-fill:before { content: "\f0e8"; }
.ri-zoom-out-line:before { content: "\f0e9"; }
|
2201_75607095/blog
|
css/fonts/remixicon.css
|
CSS
|
unknown
| 86,057
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title> MC万岁!</title>
<meta name="generator" content="hexo-theme-ayer">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/dist/main.css">
<link rel="stylesheet" href="/css/fonts/remixicon.css">
<link rel="stylesheet" href="/css/custom.css">
<script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>
<!-- mermaid -->
<style>
.swal2-styled.swal2-confirm {
font-size: 1.6rem;
}
</style>
<link rel="alternate" href="/atom.xml" title="MC万岁!" type="application/atom+xml">
</head>
</html>
</html>
<body>
<div id="app">
<canvas width="1777" height="841"
style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
<main class="content on">
<section class="cover">
<a class="forkMe" href="https://github.com/Shen-Yu/hexo-theme-ayer"
target="_blank"><img width="149" height="149" src="/images/forkme.png"
class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
<div class="cover-frame">
<div class="bg-box">
<img src="/images/cover1.jpg" alt="image frame" />
</div>
<div class="cover-inner text-center text-white">
<h1><a href="/">MC万岁!</a></h1>
<div id="subtitle-box">
<span id="subtitle"></span>
</div>
<div>
</div>
</div>
</div>
<div class="cover-learn-more">
<a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
</div>
</section>
<script src="https://cdn.staticfile.org/typed.js/2.0.12/typed.min.js"></script>
<!-- Subtitle -->
<script>
try {
var typed = new Typed("#subtitle", {
strings: ['Minecarft', '此生无悔入MC,来世还做方块人!', ''],
startDelay: 0,
typeSpeed: 200,
loop: true,
backSpeed: 100,
showCursor: true
});
} catch (err) {
console.log(err)
}
</script>
<div id="main">
<section class="outer">
<div class="notice" style="margin-top:50px">
<i class="ri-heart-fill"></i>
<div class="notice-content" id="broad"></div>
</div>
<script type="text/javascript">
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
document.getElementById("broad").innerHTML = data.hitokoto;
})
.catch(console.error)
</script>
<style>
.notice {
padding: 20px;
border: 1px dashed #e6e6e6;
color: #969696;
position: relative;
display: inline-block;
width: 100%;
background: #fbfbfb50;
border-radius: 10px;
}
.notice i {
float: left;
color: #999;
font-size: 16px;
padding-right: 10px;
vertical-align: middle;
margin-top: -2px;
}
.notice-content {
display: initial;
vertical-align: middle;
}
</style>
<article class="articles">
<article
id="post-wei"
class="article article-type-post"
itemscope
itemprop="blogPost"
data-scroll-reveal
>
<div class="article-inner">
<header class="article-header">
<h2 itemprop="name">
<a class="article-title" href="/2025/05/10/wei/"
>wei</a>
</h2>
</header>
<div class="article-meta">
<a href="/2025/05/10/wei/" class="article-date">
<time datetime="2025-05-10T02:30:19.000Z" itemprop="datePublished">2025-05-10</time>
</a>
</div>
<div class="article-entry" itemprop="articleBody">
<p>作为开发,日常是离不开代码托管平台的。不然 git 代码往哪提交,代码万一丢了或电脑坏了怎么办?</p>
<p>今天给大家总结下5大免费代码托管平台:</p>
<p>CODING DevOps 是一站式软件研发管理协作平台</p>
<p><a target="_blank" rel="noopener" href="https://coding.net/">https://coding.net/</a></p>
<p>CODING DevOps 是一站式软件研发管理协作平台,提供 Git/SVN 代码托管、项目协同、测试管理、制品库、CI/CD 等一系列在线工具,帮助研发团队快速落地敏捷开发与 DevOps 开发方式,提升研发管理效率,实现研发效能升级。</p>
<p><a target="_blank" rel="noopener" href="http://gitee.com(码云)/">http://Gitee.com(码云)</a> 是 <a target="_blank" rel="noopener" href="http://oschina.net/">http://OSCHINA.NET</a> 推出的代码托管平台</p>
<p><a target="_blank" rel="noopener" href="https://gitee.com/">https://gitee.com/</a></p>
<p><a target="_blank" rel="noopener" href="http://gitee.com(码云)/">http://Gitee.com(码云)</a> 是 <a target="_blank" rel="noopener" href="http://oschina.net/">http://OSCHINA.NET</a> 推出的代码托管平台,支持 Git 和 SVN,提供免费的私有仓库托管。目前已有超过 800 万的开发者选择 Gitee。</p>
<p>GitCode——开源代码托管平台,独立第三方开源社区,Git/Github/Gitlab。</p>
<p><a target="_blank" rel="noopener" href="https://gitcode.net/">https://gitcode.net/</a></p>
<p>GitCode——开源代码托管平台,独立第三方开源社区,Git/Github/Gitlab。</p>
<p>github</p>
<p><a target="_blank" rel="noopener" href="https://github.com/">https://github.com/</a></p>
<p>这个就不用介绍了吧。</p>
<p>gitlab 开独立部署也可免费使用的代码托管平台。</p>
<p><a target="_blank" rel="noopener" href="https://about.gitlab.com/">https://about.gitlab.com/</a></p>
<p>开独立部署也可免费使用的代码托管平台。</p>
<p>Bitbucket 是面向专业团队的 Git 解决方案。Bitbucket Cloud 可供成员数量不超过 5 人的团队免费使用</p>
<p><a target="_blank" rel="noopener" href="https://www.atlassian.com/zh/software/bitbucket/pricing">https://www.atlassian.com/zh/software/bitbucket/pricing</a></p>
<p>atlassian 出品,也是一个老牌代码托管平台了。Bitbucket 是面向专业团队的 Git 解决方案。Bitbucket Cloud 可供成员数量不超过 5 人的团队免费使用。</p>
<!-- reward -->
</div>
<!-- copyright -->
<footer class="article-footer">
</footer>
</div>
</article>
</article>
</section>
</div>
<footer class="footer">
<div class="outer">
<ul>
<li>
Copyrights ©
2015-2025
<i class="ri-heart-fill heart_icon"></i> John Doe
</li>
</ul>
<ul>
<li>
</li>
</ul>
<ul>
<li>
<span>
<span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
<span class="division">|</span>
<span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
</li>
</ul>
<ul>
</ul>
<ul>
</ul>
<ul>
<li>
<!-- cnzz统计 -->
<script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&web_id=1278069914'></script>
</li>
</ul>
</div>
</footer>
</main>
<div class="float_btns">
<div class="totop" id="totop">
<i class="ri-arrow-up-line"></i>
</div>
<div class="todark" id="todark">
<i class="ri-moon-line"></i>
</div>
</div>
<aside class="sidebar on">
<button class="navbar-toggle"></button>
<nav class="navbar">
<div class="logo">
<a href="/"><img src="/images/ayer-side.svg" alt="MC万岁!"></a>
</div>
<ul class="nav nav-main">
<li class="nav-item">
<a class="nav-item-link" href="/">主页</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/archives">归档</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/categories">分类</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags">标签</a>
</li>
<li class="nav-item">
<a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1WxGizsEv5/?spm_id_from=333.1387.homepage.video_card.click&vd_source=4ed0b065e620133f260030c3bf3b5a3c">友链</a>
</li>
<li class="nav-item">
<a class="nav-item-link" target="_blank" rel="noopener" href="https://space.bilibili.com/1592207972?spm_id_from=333.337.0.0">关于我</a>
</li>
</ul>
</nav>
<nav class="navbar navbar-bottom">
<ul class="nav">
<li class="nav-item">
<a class="nav-item-link nav-item-search" title="Search">
<i class="ri-search-line"></i>
</a>
<a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
<i class="ri-rss-line"></i>
</a>
</li>
</ul>
</nav>
<div class="search-form-wrap">
<div class="local-search local-search-plugin">
<input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
<div id="local-search-result" class="local-search-result"></div>
</div>
</div>
</aside>
<div id="mask"></div>
<!-- #reward -->
<div id="reward">
<span class="close"><i class="ri-close-line"></i></span>
<p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
<div class="reward-box">
<div class="reward-item">
<img class="reward-img" src="/images/alipay.jpg">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-item">
<img class="reward-img" src="/images/wechat.jpg">
<span class="reward-type">微信</span>
</div>
</div>
</div>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/lazyload.min.js"></script>
<!-- Tocbot -->
<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>
<script src="/dist/main.js"></script>
<!-- ImageViewer -->
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
<script>
function viewer_init() {
let pswpElement = document.querySelectorAll('.pswp')[0];
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
$imgArr.forEach(($em, i) => {
$em.onclick = () => {
// slider展开状态
// todo: 这样不好,后面改成状态
if (document.querySelector('.left-col.show')) return
let items = []
$imgArr.forEach(($em2, i2) => {
let img = $em2.getAttribute('data-idx', i2)
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
let title = $em2.getAttribute('alt')
// 获得原图尺寸
const image = new Image()
image.src = src
items.push({
src: src,
w: image.width || $em2.width,
h: image.height || $em2.height,
title: title
})
})
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
index: parseInt(i)
});
gallery.init()
}
})
}
viewer_init()
</script>
<!-- MathJax -->
<!-- Katex -->
<!-- busuanzi -->
<script src="/js/busuanzi-2.3.pure.min.js"></script>
<!-- ClickLove -->
<!-- ClickBoom1 -->
<!-- ClickBoom2 -->
<script src="/js/clickBoom2.js"></script>
<!-- CodeCopy -->
<link rel="stylesheet" href="/css/clipboard.css">
<script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
function wait(callback, seconds) {
var timelag = null;
timelag = window.setTimeout(callback, seconds);
}
!function (e, t, a) {
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
$(".article pre code").before(copyHtml);
var clipboard = new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
clipboard.on('success', function(e) {
let $btn = $(e.trigger);
$btn.addClass('copied');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-checkbox-circle-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPIED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-checkbox-circle-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
clipboard.on('error', function(e) {
e.clearSelection();
let $btn = $(e.trigger);
$btn.addClass('copy-failed');
let $icon = $($btn.find('i'));
$icon.removeClass('ri-file-copy-2-line');
$icon.addClass('ri-time-line');
let $span = $($btn.find('span'));
$span[0].innerText = 'COPY FAILED';
wait(function () { // 等待两秒钟后恢复
$icon.removeClass('ri-time-line');
$icon.addClass('ri-file-copy-2-line');
$span[0].innerText = 'COPY';
}, 2000);
});
}
initCopyCode();
}(window, document);
</script>
<!-- CanvasBackground -->
<script src="/js/dz.js"></script>
<script>
if (window.mermaid) {
mermaid.initialize({ theme: "forest" });
}
</script>
<div id="music">
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
src="//music.163.com/outchain/player?type=2&id=22707008&auto=0&height=32"></iframe>
</div>
<style>
#music {
position: fixed;
right: 15px;
bottom: 0;
z-index: 998;
}
</style>
</div>
</body>
</html>
|
2201_75607095/blog
|
index.html
|
HTML
|
unknown
| 18,014
|
const numberOfParticules = 20;
const minOrbitRadius = 50;
const maxOrbitRadius = 100;
const minCircleRadius = 10;
const maxCircleRadius = 20;
const minAnimeDuration = 900;
const maxAnimeDuration = 1500;
const minDiffuseRadius = 50;
const maxDiffuseRadius = 100;
let canvasEl = document.querySelector(".fireworks");
let ctx = canvasEl.getContext("2d");
let pointerX = 0;
let pointerY = 0;
let tap =
"ontouchstart" in window || navigator.msMaxTouchPoints
? "touchstart"
: "mousedown";
// sea blue
let colors = ["127, 180, 226", "157, 209, 243", "204, 229, 255"];
function setCanvasSize() {
canvasEl.width = window.innerWidth;
canvasEl.height = window.innerHeight;
canvasEl.style.width = window.innerWidth + "px";
canvasEl.style.height = window.innerHeight + "px";
}
function updateCoords(e) {
pointerX = e.clientX || e.touches[0].clientX;
pointerY = e.clientY || e.touches[0].clientY;
}
function setParticuleDirection(p) {
let angle = (anime.random(0, 360) * Math.PI) / 180;
let value = anime.random(minDiffuseRadius, maxDiffuseRadius);
let radius = [-1, 1][anime.random(0, 1)] * value;
return {
x: p.x + radius * Math.cos(angle),
y: p.y + radius * Math.sin(angle),
};
}
function createParticule(x, y) {
let p = {};
p.x = x;
p.y = y;
p.color =
"rgba(" +
colors[anime.random(0, colors.length - 1)] +
"," +
anime.random(0.2, 0.8) +
")";
p.radius = anime.random(minCircleRadius, maxCircleRadius);
p.endPos = setParticuleDirection(p);
p.draw = function () {
ctx.beginPath();
ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true);
ctx.fillStyle = p.color;
ctx.fill();
};
return p;
}
function createCircle(x, y) {
let p = {};
p.x = x;
p.y = y;
p.color = "#000";
p.radius = 0.1;
p.alpha = 0.5;
p.lineWidth = 6;
p.draw = function () {
ctx.globalAlpha = p.alpha;
ctx.beginPath();
ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true);
ctx.lineWidth = p.lineWidth;
ctx.strokeStyle = p.color;
ctx.stroke();
ctx.globalAlpha = 1;
};
return p;
}
function renderParticule(anim) {
for (let i = 0; i < anim.animatables.length; i++) {
anim.animatables[i].target.draw();
}
}
function animateParticules(x, y) {
let circle = createCircle(x, y);
let particules = [];
for (let i = 0; i < numberOfParticules; i++) {
particules.push(createParticule(x, y));
}
anime
.timeline()
.add({
targets: particules,
x: function (p) {
return p.endPos.x;
},
y: function (p) {
return p.endPos.y;
},
radius: 0.1,
duration: anime.random(minAnimeDuration, maxAnimeDuration),
easing: "easeOutExpo",
update: renderParticule,
})
.add({
targets: circle,
radius: anime.random(minOrbitRadius, maxOrbitRadius),
lineWidth: 0,
alpha: {
value: 0,
easing: "linear",
duration: anime.random(600, 800),
},
duration: anime.random(1200, 1800),
easing: "easeOutExpo",
update: renderParticule,
offset: 0,
});
}
let render = anime({
duration: Infinity,
update: function () {
ctx.clearRect(0, 0, canvasEl.width, canvasEl.height);
},
});
document.addEventListener(
tap,
function (e) {
render.play();
updateCoords(e);
animateParticules(pointerX, pointerY);
},
false
);
setCanvasSize();
window.addEventListener("resize", setCanvasSize, false);
|
2201_75607095/blog
|
js/clickBoom1.js
|
JavaScript
|
unknown
| 3,448
|
class Circle {
constructor({ origin, speed, color, angle, context }) {
this.origin = origin;
this.position = { ...this.origin };
this.color = color;
this.speed = speed;
this.angle = angle;
this.context = context;
this.renderCount = 0;
}
draw() {
this.context.fillStyle = this.color;
this.context.beginPath();
this.context.arc(this.position.x, this.position.y, 2, 0, Math.PI * 2);
this.context.fill();
}
move() {
this.position.x = Math.sin(this.angle) * this.speed + this.position.x;
this.position.y =
Math.cos(this.angle) * this.speed +
this.position.y +
this.renderCount * 0.3;
this.renderCount++;
}
}
class Boom {
constructor({ origin, context, circleCount = 10, area }) {
this.origin = origin;
this.context = context;
this.circleCount = circleCount;
this.area = area;
this.stop = false;
this.circles = [];
}
randomArray(range) {
const length = range.length;
const randomIndex = Math.floor(length * Math.random());
return range[randomIndex];
}
randomColor() {
const range = ["8", "9", "A", "B", "C", "D", "E", "F"];
return (
"#" +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range)
);
}
randomRange(start, end) {
return (end - start) * Math.random() + start;
}
init() {
for (let i = 0; i < this.circleCount; i++) {
const circle = new Circle({
context: this.context,
origin: this.origin,
color: this.randomColor(),
angle: this.randomRange(Math.PI - 1, Math.PI + 1),
speed: this.randomRange(1, 6),
});
this.circles.push(circle);
}
}
move() {
this.circles.forEach((circle, index) => {
if (
circle.position.x > this.area.width ||
circle.position.y > this.area.height
) {
return this.circles.splice(index, 1);
}
circle.move();
});
if (this.circles.length == 0) {
this.stop = true;
}
}
draw() {
this.circles.forEach((circle) => circle.draw());
}
}
class CursorSpecialEffects {
constructor() {
this.computerCanvas = document.createElement("canvas");
this.renderCanvas = document.createElement("canvas");
this.computerContext = this.computerCanvas.getContext("2d");
this.renderContext = this.renderCanvas.getContext("2d");
this.globalWidth = window.innerWidth;
this.globalHeight = window.innerHeight;
this.booms = [];
this.running = false;
}
handleMouseDown(e) {
const boom = new Boom({
origin: { x: e.clientX, y: e.clientY },
context: this.computerContext,
area: {
width: this.globalWidth,
height: this.globalHeight,
},
});
boom.init();
this.booms.push(boom);
this.running || this.run();
}
handlePageHide() {
this.booms = [];
this.running = false;
}
init() {
const style = this.renderCanvas.style;
style.position = "fixed";
style.top = style.left = 0;
style.zIndex = "99999";
style.pointerEvents = "none";
style.width =
this.renderCanvas.width =
this.computerCanvas.width =
this.globalWidth;
style.height =
this.renderCanvas.height =
this.computerCanvas.height =
this.globalHeight;
document.body.append(this.renderCanvas);
window.addEventListener("mousedown", this.handleMouseDown.bind(this));
window.addEventListener("pagehide", this.handlePageHide.bind(this));
}
run() {
this.running = true;
if (this.booms.length == 0) {
return (this.running = false);
}
requestAnimationFrame(this.run.bind(this));
this.computerContext.clearRect(0, 0, this.globalWidth, this.globalHeight);
this.renderContext.clearRect(0, 0, this.globalWidth, this.globalHeight);
this.booms.forEach((boom, index) => {
if (boom.stop) {
return this.booms.splice(index, 1);
}
boom.move();
boom.draw();
});
this.renderContext.drawImage(
this.computerCanvas,
0,
0,
this.globalWidth,
this.globalHeight
);
}
}
const cursorSpecialEffects = new CursorSpecialEffects();
cursorSpecialEffects.init();
|
2201_75607095/blog
|
js/clickBoom2.js
|
JavaScript
|
unknown
| 4,336
|
// A local search script with the help of [hexo-generator-search](https://github.com/PaicHyperionDev/hexo-generator-search)
// Copyright (C) 2015
// Joseph Pan <http://github.com/wzpan>
// Shuhao Mao <http://github.com/maoshuhao>
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301 USA
//
var searchFunc = function (path, search_id, content_id) {
'use strict';
var BTN = "<button type='button' class='local-search-close' id='local-search-close'></button>";
$.ajax({
url: path,
dataType: "xml",
success: function (xmlResponse) {
// get the contents from search data
var datas = $("entry", xmlResponse).map(function () {
return {
title: $("title", this).text(),
content: $("content", this).text(),
url: $("url", this).text()
};
}).get();
var $input = document.getElementById(search_id);
var $resultContent = document.getElementById(content_id);
$input.addEventListener('input', function () {
var str = '<ul class="search-result-list">';
var keywords = this.value.trim().toLowerCase().split(/[\s]+/);
$resultContent.innerHTML = "";
if (this.value.trim().length <= 0) {
return;
}
// perform local searching
datas.forEach(function (data) {
var isMatch = true;
// var content_index = [];
if (!data.title || data.title.trim() === '') {
data.title = "Untitled";
}
var data_title = data.title.trim().toLowerCase();
var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
var data_url = data.url;
var index_title = -1;
var index_content = -1;
var first_occur = -1;
// only match artiles with not empty contents
if (data_content !== '') {
keywords.forEach(function (keyword, i) {
index_title = data_title.indexOf(keyword);
index_content = data_content.indexOf(keyword);
if (index_title < 0 && index_content < 0) {
isMatch = false;
} else {
if (index_content < 0) {
index_content = 0;
}
if (i == 0) {
first_occur = index_content;
}
// content_index.push({index_content:index_content, keyword_len:keyword_len});
}
});
} else {
isMatch = false;
}
// show search results
if (isMatch) {
str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
var content = data.content.trim().replace(/<[^>]+>/g, "");
if (first_occur >= 0) {
// cut out 100 characters
var start = first_occur - 20;
var end = first_occur + 80;
if (start < 0) {
start = 0;
}
if (start == 0) {
end = 100;
}
if (end > content.length) {
end = content.length;
}
var match_content = content.substr(start, end);
// highlight all keywords
keywords.forEach(function (keyword) {
var regS = new RegExp(keyword, "gi");
match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
});
str += "<p class=\"search-result\">" + match_content + "...</p>"
}
str += "</li>";
}
});
str += "</ul>";
if (str.indexOf('<li>') === -1) {
return $resultContent.innerHTML = BTN + "<div class=\"search-result-empty\"><p><i class=\"fe fe-tired\"></i> 没有找到内容,更换下搜索词试试吧~<p></div>";
}
$resultContent.innerHTML = BTN + str;
});
}
});
$(document).on('click', '#local-search-close', function () {
$('#local-search-input').val('');
$('#local-search-result').html('');
});
};
|
2201_75607095/blog
|
js/search.js
|
JavaScript
|
unknown
| 4,809
|
from flask import Flask, render_template, request, jsonify, redirect, url_for, flash, session
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin, login_user, logout_user, login_required, current_user
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, TextAreaField, SelectField, SubmitField
from wtforms.validators import DataRequired, Length, Email
from flask_cors import CORS
import os
import psutil
import requests
import json
from datetime import datetime
import threading
import time
import sys
# 设置输出编码
if sys.platform.startswith('win'):
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach())
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.detach())
app = Flask(__name__)
app.config['SECRET_KEY'] = 'your-secret-key-here'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///network_system.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
CORS(app)
# 数据库模型
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
password = db.Column(db.String(120), nullable=False)
role = db.Column(db.String(20), default='recon') # 用户的默认/授权角色(现用作授权白名单)
created_at = db.Column(db.DateTime, default=datetime.utcnow)
# 侦察数据表
class ReconData(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(200), nullable=False)
target_system = db.Column(db.String(100), nullable=False)
data_type = db.Column(db.String(50), nullable=False) # network, system, vulnerability, etc.
content = db.Column(db.Text, nullable=False)
priority = db.Column(db.String(20), default='medium') # low, medium, high, critical
status = db.Column(db.String(20), default='pending') # pending, analyzed, processed
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=datetime.utcnow)
updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
# 分析结果表
class AnalysisResult(db.Model):
id = db.Column(db.Integer, primary_key=True)
recon_data_id = db.Column(db.Integer, db.ForeignKey('recon_data.id'))
analysis_type = db.Column(db.String(50), nullable=False) # threat, vulnerability, opportunity
findings = db.Column(db.Text, nullable=False)
recommendations = db.Column(db.Text, nullable=False)
priority_targets = db.Column(db.Text) # JSON格式存储目标列表
suggested_actions = db.Column(db.Text) # JSON格式存储建议行动
confidence_level = db.Column(db.String(20), default='medium') # low, medium, high
status = db.Column(db.String(20), default='pending') # pending, reviewed, approved
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=datetime.utcnow)
# 决策指令表
class DecisionOrder(db.Model):
id = db.Column(db.Integer, primary_key=True)
analysis_id = db.Column(db.Integer, db.ForeignKey('analysis_result.id'))
order_type = db.Column(db.String(50), nullable=False) # reconnaissance, analysis, execution
target = db.Column(db.String(200), nullable=False)
objective = db.Column(db.Text, nullable=False)
instructions = db.Column(db.Text, nullable=False)
priority = db.Column(db.String(20), default='medium')
deadline = db.Column(db.DateTime)
status = db.Column(db.String(20), default='pending') # pending, executing, completed, failed
assigned_to = db.Column(db.Integer, db.ForeignKey('user.id'))
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=datetime.utcnow)
updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
# 执行结果表
class ExecutionResult(db.Model):
id = db.Column(db.Integer, primary_key=True)
order_id = db.Column(db.Integer, db.ForeignKey('decision_order.id'))
result_type = db.Column(db.String(50), nullable=False) # success, partial, failed
description = db.Column(db.Text, nullable=False)
evidence = db.Column(db.Text) # 执行证据或截图
impact_assessment = db.Column(db.Text)
lessons_learned = db.Column(db.Text)
status = db.Column(db.String(20), default='pending') # pending, reviewed
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=datetime.utcnow)
# 系统日志表
class SystemLog(db.Model):
id = db.Column(db.Integer, primary_key=True)
timestamp = db.Column(db.DateTime, default=datetime.utcnow)
level = db.Column(db.String(20), nullable=False)
message = db.Column(db.Text, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
action_type = db.Column(db.String(50)) # recon, analysis, decision, execution
# 表单类
class LoginForm(FlaskForm):
username = StringField('用户名', validators=[DataRequired()])
password = PasswordField('密码', validators=[DataRequired()])
submit = SubmitField('登录')
class ReconDataForm(FlaskForm):
title = StringField('侦察标题', validators=[DataRequired(), Length(min=1, max=200)])
target_system = StringField('目标系统', validators=[DataRequired(), Length(min=1, max=100)])
data_type = SelectField('数据类型', choices=[
('network', '网络信息'),
('system', '系统信息'),
('vulnerability', '漏洞信息'),
('user', '用户信息'),
('service', '服务信息'),
('other', '其他')
])
content = TextAreaField('侦察内容', validators=[DataRequired()])
priority = SelectField('优先级', choices=[
('low', '低'),
('medium', '中'),
('high', '高'),
('critical', '紧急')
])
submit = SubmitField('提交侦察数据')
class AnalysisForm(FlaskForm):
analysis_type = SelectField('分析类型', choices=[
('threat', '威胁分析'),
('vulnerability', '漏洞分析'),
('opportunity', '机会分析'),
('comprehensive', '综合分析')
])
findings = TextAreaField('分析发现', validators=[DataRequired()])
recommendations = TextAreaField('建议措施', validators=[DataRequired()])
priority_targets = TextAreaField('优先目标')
suggested_actions = TextAreaField('建议行动')
confidence_level = SelectField('置信度', choices=[
('low', '低'),
('medium', '中'),
('high', '高')
])
submit = SubmitField('提交分析结果')
class DecisionForm(FlaskForm):
order_type = SelectField('指令类型', choices=[
('reconnaissance', '侦察指令'),
('analysis', '分析指令'),
('execution', '执行指令')
])
target = StringField('目标', validators=[DataRequired(), Length(min=1, max=200)])
objective = TextAreaField('目标描述', validators=[DataRequired()])
instructions = TextAreaField('具体指令', validators=[DataRequired()])
priority = SelectField('优先级', choices=[
('low', '低'),
('medium', '中'),
('high', '高'),
('critical', '紧急')
])
assigned_to = SelectField('分配给', coerce=int)
submit = SubmitField('下达指令')
class ExecutionForm(FlaskForm):
result_type = SelectField('执行结果', choices=[
('success', '成功'),
('partial', '部分成功'),
('failed', '失败')
])
description = TextAreaField('执行描述', validators=[DataRequired()])
evidence = TextAreaField('执行证据')
impact_assessment = TextAreaField('影响评估')
lessons_learned = TextAreaField('经验教训')
submit = SubmitField('提交执行结果')
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
# 辅助函数
def log_system_event(level, message, action_type=None):
log = SystemLog(
level=level,
message=message,
user_id=current_user.id if current_user.is_authenticated else None,
action_type=action_type
)
db.session.add(log)
db.session.commit()
def get_active_role():
return session.get('active_role')
def set_active_role(role_name):
session['active_role'] = role_name
def clear_active_role():
session.pop('active_role', None)
def role_required(role_name):
def decorator(func):
from functools import wraps
@wraps(func)
def wrapper(*args, **kwargs):
if not current_user.is_authenticated:
return redirect(url_for('login'))
active = get_active_role()
if active != role_name:
flash('请先选择并通过该身份的权限验证')
return redirect(url_for('select_role'))
return func(*args, **kwargs)
return wrapper
return decorator
def get_role_dashboard():
"""根据当前已启用的身份返回对应仪表板"""
if not current_user.is_authenticated:
return redirect(url_for('login'))
role = get_active_role()
if not role:
return redirect(url_for('select_role'))
if role == 'recon':
return redirect(url_for('recon_dashboard'))
elif role == 'analyst':
return redirect(url_for('analyst_dashboard'))
elif role == 'decision':
return redirect(url_for('decision_dashboard'))
elif role == 'executor':
return redirect(url_for('executor_dashboard'))
else:
return redirect(url_for('login'))
# 路由
@app.route('/')
def index():
if current_user.is_authenticated:
return get_role_dashboard()
return render_template('index.html')
@app.route('/login', methods=['GET', 'POST'])
def login():
if current_user.is_authenticated:
return get_role_dashboard()
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(username=form.username.data).first()
if user and user.password == form.password.data: # 简化密码验证
login_user(user)
clear_active_role()
log_system_event('info', f'用户 {user.username} 登录系统', 'login')
return redirect(url_for('select_role'))
flash('用户名或密码错误')
return render_template('login.html', form=form)
@app.route('/logout')
@login_required
def logout():
log_system_event('info', f'用户 {current_user.username} 退出系统', 'logout')
logout_user()
clear_active_role()
return redirect(url_for('index'))
@app.context_processor
def inject_active_role():
return {'active_role': get_active_role()}
@app.route('/select_role', methods=['GET', 'POST'])
@login_required
def select_role():
if request.method == 'POST':
selected_role = request.form.get('role')
role_password = request.form.get('role_password')
if selected_role not in ['recon', 'analyst', 'decision', 'executor']:
flash('身份选择无效')
return redirect(url_for('select_role'))
# 二次权限验证(再次输入账号密码)
if not role_password or current_user.password != role_password:
flash('身份验证失败,请输入正确的密码以启用该身份')
return redirect(url_for('select_role'))
# 放宽:所有用户均可启用四种身份
set_active_role(selected_role)
log_system_event('info', f"用户 {current_user.username} 启用身份: {selected_role}", selected_role)
return get_role_dashboard()
return render_template('select_role.html')
# 侦察员页面
@app.route('/recon')
@login_required
@role_required('recon')
def recon_dashboard():
# 获取用户提交的侦察数据
recon_data = ReconData.query.filter_by(created_by=current_user.id).order_by(ReconData.created_at.desc()).all()
return render_template('recon_dashboard.html', recon_data=recon_data)
@app.route('/recon/add', methods=['GET', 'POST'])
@login_required
@role_required('recon')
def add_recon_data():
form = ReconDataForm()
if form.validate_on_submit():
recon_data = ReconData(
title=form.title.data,
target_system=form.target_system.data,
data_type=form.data_type.data,
content=form.content.data,
priority=form.priority.data,
created_by=current_user.id
)
db.session.add(recon_data)
db.session.commit()
log_system_event('info', f'侦察员 {current_user.username} 提交了新的侦察数据: {form.title.data}', 'recon')
flash('侦察数据提交成功!')
return redirect(url_for('recon_dashboard'))
return render_template('add_recon_data.html', form=form)
# 分析员页面
@app.route('/analyst')
@login_required
@role_required('analyst')
def analyst_dashboard():
# 获取待分析的侦察数据
pending_recon = ReconData.query.filter_by(status='pending').order_by(ReconData.created_at.desc()).all()
# 获取用户的分析结果
analysis_results = AnalysisResult.query.filter_by(created_by=current_user.id).order_by(AnalysisResult.created_at.desc()).all()
return render_template('analyst_dashboard.html', pending_recon=pending_recon, analysis_results=analysis_results)
@app.route('/analyst/analyze/<int:recon_id>', methods=['GET', 'POST'])
@login_required
@role_required('analyst')
def analyze_data(recon_id):
recon_data = ReconData.query.get_or_404(recon_id)
form = AnalysisForm()
if form.validate_on_submit():
analysis = AnalysisResult(
recon_data_id=recon_id,
analysis_type=form.analysis_type.data,
findings=form.findings.data,
recommendations=form.recommendations.data,
priority_targets=form.priority_targets.data,
suggested_actions=form.suggested_actions.data,
confidence_level=form.confidence_level.data,
created_by=current_user.id
)
db.session.add(analysis)
# 更新侦察数据状态
recon_data.status = 'analyzed'
db.session.commit()
log_system_event('info', f'分析员 {current_user.username} 完成了对侦察数据 "{recon_data.title}" 的分析', 'analysis')
flash('分析结果提交成功!')
return redirect(url_for('analyst_dashboard'))
return render_template('analyze_data.html', form=form, recon_data=recon_data)
# 决策员页面
@app.route('/decision')
@login_required
@role_required('decision')
def decision_dashboard():
# 获取待审核的分析结果
pending_analysis = AnalysisResult.query.filter_by(status='pending').order_by(AnalysisResult.created_at.desc()).all()
# 获取用户下达的指令
orders = DecisionOrder.query.filter_by(created_by=current_user.id).order_by(DecisionOrder.created_at.desc()).all()
# 获取执行结果
execution_results = ExecutionResult.query.join(DecisionOrder).filter(DecisionOrder.created_by==current_user.id).order_by(ExecutionResult.created_at.desc()).all()
return render_template('decision_dashboard.html',
pending_analysis=pending_analysis,
orders=orders,
execution_results=execution_results)
@app.route('/decision/create_order', methods=['GET', 'POST'])
@login_required
@role_required('decision')
def create_order():
form = DecisionForm()
# 放寬:所有用戶均可被指派(如需依任務類型細分,之後再調整)
form.assigned_to.choices = [(u.id, f"{u.username}") for u in User.query.all()]
if form.validate_on_submit():
order = DecisionOrder(
order_type=form.order_type.data,
target=form.target.data,
objective=form.objective.data,
instructions=form.instructions.data,
priority=form.priority.data,
assigned_to=form.assigned_to.data,
created_by=current_user.id
)
db.session.add(order)
db.session.commit()
assigned_user = User.query.get(form.assigned_to.data)
log_system_event('info', f'决策员 {current_user.username} 向 {assigned_user.username} 下达了指令: {form.target.data}', 'decision')
flash('指令下达成功!')
return redirect(url_for('decision_dashboard'))
return render_template('create_order.html', form=form)
# 执行员页面
@app.route('/executor')
@login_required
@role_required('executor')
def executor_dashboard():
# 获取分配给当前用户的指令
assigned_orders = DecisionOrder.query.filter_by(assigned_to=current_user.id, status='pending').order_by(DecisionOrder.created_at.desc()).all()
# 获取用户提交的执行结果
execution_results = ExecutionResult.query.filter_by(created_by=current_user.id).order_by(ExecutionResult.created_at.desc()).all()
return render_template('executor_dashboard.html', assigned_orders=assigned_orders, execution_results=execution_results)
@app.route('/executor/execute/<int:order_id>', methods=['GET', 'POST'])
@login_required
@role_required('executor')
def execute_order(order_id):
order = DecisionOrder.query.get_or_404(order_id)
if order.assigned_to != current_user.id:
flash('权限不足')
return redirect(url_for('executor_dashboard'))
form = ExecutionForm()
if form.validate_on_submit():
execution = ExecutionResult(
order_id=order_id,
result_type=form.result_type.data,
description=form.description.data,
evidence=form.evidence.data,
impact_assessment=form.impact_assessment.data,
lessons_learned=form.lessons_learned.data,
created_by=current_user.id
)
db.session.add(execution)
# 更新指令状态
order.status = 'completed'
db.session.commit()
log_system_event('info', f'执行员 {current_user.username} 完成了指令: {order.target}', 'execution')
flash('执行结果提交成功!')
return redirect(url_for('executor_dashboard'))
return render_template('execute_order.html', form=form, order=order)
# 系统日志页面
@app.route('/logs')
@login_required
def logs():
page = request.args.get('page', 1, type=int)
logs = SystemLog.query.order_by(SystemLog.timestamp.desc()).paginate(
page=page, per_page=20, error_out=False)
return render_template('logs.html', logs=logs)
if __name__ == '__main__':
with app.app_context():
db.create_all()
# 创建默认用户
default_users = [
{'username': 'recon1', 'email': 'recon1@example.com', 'password': 'recon123', 'role': 'recon'},
{'username': 'analyst1', 'email': 'analyst1@example.com', 'password': 'analyst123', 'role': 'analyst'},
{'username': 'decision1', 'email': 'decision1@example.com', 'password': 'decision123', 'role': 'decision'},
{'username': 'executor1', 'email': 'executor1@example.com', 'password': 'executor123', 'role': 'executor'},
]
for user_data in default_users:
if not User.query.filter_by(username=user_data['username']).first():
user = User(**user_data)
db.session.add(user)
db.session.commit()
print("默认用户账户已创建:")
print("侦察员: recon1/recon123")
print("分析员: analyst1/analyst123")
print("决策员: decision1/decision123")
print("执行员: executor1/executor123")
app.run(debug=True, host='0.0.0.0', port=5000)
|
2201_75665698/planX
|
WebSystemNoChat/app.py
|
Python
|
unknown
| 20,048
|
import sqlite3
# 連接到數據庫
conn = sqlite3.connect('network_system.db')
cursor = conn.cursor()
# 查詢所有用戶
cursor.execute("SELECT id, username, email, role, created_at FROM user ORDER BY id")
users = cursor.fetchall()
print("註冊用戶列表:")
print("-" * 80)
print(f"{'ID':<3} {'用戶名':<12} {'郵箱':<25} {'角色':<10} {'註冊時間'}")
print("-" * 80)
for user in users:
user_id, username, email, role, created_at = user
print(f"{user_id:<3} {username:<12} {email:<25} {role:<10} {created_at or '未知'}")
print(f"\n總共 {len(users)} 個用戶")
conn.close()
|
2201_75665698/planX
|
WebSystemNoChat/checkuser.py
|
Python
|
unknown
| 605
|
@echo off
chcp 65001 >nul
title 网络信息系统启动器
echo.
echo ========================================
echo 网络信息系统启动器
echo ========================================
echo.
set PYTHONIOENCODING=utf-8
python start.py
pause
|
2201_75665698/planX
|
WebSystemNoChat/start.bat
|
Batchfile
|
unknown
| 259
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
网络信息系统通用启动脚本
Network Information System Universal Launcher
支持Windows、Linux、Mac系统,自动检测环境并启动应用
"""
import os
import sys
import subprocess
import platform
import sqlite3
from pathlib import Path
from datetime import datetime
class NetworkSystemLauncher:
def __init__(self):
self.python_path = None
self.system_info = {
'os': platform.system(),
'release': platform.release(),
'machine': platform.machine(),
'python_version': sys.version
}
def print_banner(self):
"""打印启动横幅"""
print("=" * 60)
print("🌐 网络信息系统 - 通用启动器")
print("Network Information System - Universal Launcher")
print("=" * 60)
print(f"操作系统: {self.system_info['os']} {self.system_info['release']}")
print(f"架构: {self.system_info['machine']}")
print(f"Python: {self.system_info['python_version'].split()[0]}")
print("=" * 60)
def find_python_executable(self):
"""自动检测Python可执行文件"""
# 优先使用当前Python解释器
current_python = sys.executable
if current_python and Path(current_python).exists():
self.python_path = current_python
print(f"✅ 使用当前Python: {current_python}")
return True
# 尝试常见的Python命令
python_commands = ['python3', 'python', 'py']
if self.system_info['os'] == 'Windows':
python_commands = ['python', 'py', 'python3']
for cmd in python_commands:
try:
result = subprocess.run([cmd, '--version'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
self.python_path = cmd
print(f"✅ 找到Python: {cmd} ({result.stdout.strip()})")
return True
except:
continue
print("❌ 未找到Python安装")
return False
def check_python_version(self):
"""检查Python版本"""
try:
result = subprocess.run([self.python_path, '--version'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
version_str = result.stdout.strip()
# 提取版本号
version_parts = version_str.split()[1].split('.')
major, minor = int(version_parts[0]), int(version_parts[1])
if major >= 3 and minor >= 7:
print(f"✅ Python版本检查通过: {version_str}")
return True
else:
print(f"❌ Python版本过低: {version_str} (需要3.7+)")
return False
except Exception as e:
print(f"❌ Python版本检查失败: {e}")
return False
def install_dependencies(self):
"""安装依赖包"""
requirements_file = Path("requirements.txt")
if not requirements_file.exists():
print("❌ 错误: 找不到requirements.txt文件")
return False
print("📦 正在安装依赖包...")
try:
# 先升级pip
subprocess.check_call([self.python_path, "-m", "pip", "install", "--upgrade", "pip"],
timeout=300)
# 安装依赖包
subprocess.check_call([self.python_path, "-m", "pip", "install", "-r", "requirements.txt"],
timeout=600)
print("✅ 依赖包安装完成")
return True
except subprocess.CalledProcessError as e:
print(f"❌ 依赖包安装失败: {e}")
print("\n请尝试手动安装:")
print(f"{self.python_path} -m pip install Flask Flask-SQLAlchemy Flask-Login Flask-WTF Flask-CORS SQLAlchemy WTForms python-dotenv requests psutil schedule")
return False
except subprocess.TimeoutExpired:
print("❌ 安装超时,请检查网络连接")
return False
def initialize_database(self):
"""初始化数据库"""
db_path = Path("network_system.db")
print("🗄️ 正在初始化数据库...")
# 如果数据库文件已存在,先备份
if db_path.exists():
backup_path = Path(f"network_system_backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}.db")
try:
db_path.rename(backup_path)
print(f"✅ 已备份现有数据库到: {backup_path}")
except Exception as e:
print(f"⚠️ 备份数据库失败: {e}")
try:
# 创建数据库连接
conn = sqlite3.connect(str(db_path))
cursor = conn.cursor()
# 创建用户表
cursor.execute('''
CREATE TABLE IF NOT EXISTS user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(80) UNIQUE NOT NULL,
email VARCHAR(120) UNIQUE NOT NULL,
password VARCHAR(120) NOT NULL,
role VARCHAR(20) DEFAULT 'recon',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)
''')
# 创建侦察数据表
cursor.execute('''
CREATE TABLE IF NOT EXISTS recon_data (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title VARCHAR(200) NOT NULL,
target_system VARCHAR(100) NOT NULL,
data_type VARCHAR(50) NOT NULL,
content TEXT NOT NULL,
priority VARCHAR(20) DEFAULT 'medium',
status VARCHAR(20) DEFAULT 'pending',
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建分析结果表
cursor.execute('''
CREATE TABLE IF NOT EXISTS analysis_result (
id INTEGER PRIMARY KEY AUTOINCREMENT,
recon_data_id INTEGER,
analysis_type VARCHAR(50) NOT NULL,
findings TEXT NOT NULL,
recommendations TEXT NOT NULL,
priority_targets TEXT,
suggested_actions TEXT,
confidence_level VARCHAR(20) DEFAULT 'medium',
status VARCHAR(20) DEFAULT 'pending',
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (recon_data_id) REFERENCES recon_data (id),
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建决策指令表
cursor.execute('''
CREATE TABLE IF NOT EXISTS decision_order (
id INTEGER PRIMARY KEY AUTOINCREMENT,
analysis_id INTEGER,
order_type VARCHAR(50) NOT NULL,
target VARCHAR(200) NOT NULL,
objective TEXT NOT NULL,
instructions TEXT NOT NULL,
priority VARCHAR(20) DEFAULT 'medium',
deadline DATETIME,
status VARCHAR(20) DEFAULT 'pending',
assigned_to INTEGER,
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (analysis_id) REFERENCES analysis_result (id),
FOREIGN KEY (assigned_to) REFERENCES user (id),
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建执行结果表
cursor.execute('''
CREATE TABLE IF NOT EXISTS execution_result (
id INTEGER PRIMARY KEY AUTOINCREMENT,
order_id INTEGER,
result_type VARCHAR(50) NOT NULL,
description TEXT NOT NULL,
evidence TEXT,
impact_assessment TEXT,
lessons_learned TEXT,
status VARCHAR(20) DEFAULT 'pending',
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (order_id) REFERENCES decision_order (id),
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建系统日志表
cursor.execute('''
CREATE TABLE IF NOT EXISTS system_log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
level VARCHAR(20) NOT NULL,
message TEXT NOT NULL,
user_id INTEGER,
action_type VARCHAR(50),
FOREIGN KEY (user_id) REFERENCES user (id)
)
''')
# 创建默认用户
default_users = [
# ('recon1', 'recon1@example.com', 'recon123', 'recon'),
# ('analyst1', 'analyst1@example.com', 'analyst123', 'analyst'),
# ('decision1', 'decision1@example.com', 'decision123', 'decision'),
# ('executor1', 'executor1@example.com', 'executor123', 'executor'),
('lyh', 'lyh@example.com', 'lyh', 'recon'),
('xcw', 'xcw@example.com', 'xcw', 'recon'),
('gjh', 'gjh@example.com', 'gjh', 'recon'),
('shx', 'shx@example.com', 'shx', 'recon'),
('zzj', 'zzj@example.com', 'zzj', 'recon'),
]
for username, email, password, role in default_users:
cursor.execute('''
INSERT OR IGNORE INTO user (username, email, password, role)
VALUES (?, ?, ?, ?)
''', (username, email, password, role))
# 提交更改
conn.commit()
conn.close()
print("✅ 数据库初始化成功")
print("✅ 默认用户账户已创建:")
# print(" 侦察员: recon1 / recon123")
# print(" 分析员: analyst1 / analyst123")
# print(" 决策员: decision1 / decision123")
# print(" 执行员: executor1 / executor123")
# 设置文件权限(Unix系统)
if os.name != 'nt': # 非Windows系统
try:
os.chmod(db_path, 0o664)
print("✅ 数据库文件权限设置完成")
except Exception as e:
print(f"⚠️ 权限设置失败: {e}")
return True
except Exception as e:
print(f"❌ 数据库初始化失败: {e}")
return False
def test_database(self):
"""测试数据库连接"""
try:
conn = sqlite3.connect("network_system.db")
cursor = conn.cursor()
cursor.execute("SELECT COUNT(*) FROM user")
user_count = cursor.fetchone()[0]
conn.close()
print(f"✅ 数据库连接测试成功,用户数量: {user_count}")
return True
except Exception as e:
print(f"❌ 数据库连接测试失败: {e}")
return False
def start_application(self):
"""启动应用程序"""
print("\n🚀 正在启动网络信息系统...")
print("=" * 50)
print("系统信息:")
print("- 访问地址: http://localhost:5000")
print("- 默认账户: admin / admin123")
print("- 按 Ctrl+C 停止服务")
print("=" * 50)
try:
# 检查app.py是否存在
if not Path("app.py").exists():
print("❌ 找不到应用程序文件: app.py")
return False
# 启动应用程序
subprocess.run([self.python_path, "app.py"])
return True
except KeyboardInterrupt:
print("\n👋 系统已停止")
return True
except FileNotFoundError:
print(f"❌ 找不到应用程序文件: app.py")
return False
except Exception as e:
print(f"❌ 启动失败: {e}")
return False
def run(self):
"""运行启动器"""
self.print_banner()
# 1. 检测Python环境
if not self.find_python_executable():
self.print_install_instructions()
return False
# 2. 检查Python版本
if not self.check_python_version():
return False
# 3. 安装依赖
if not self.install_dependencies():
return False
# 4. 初始化数据库
if not self.initialize_database():
return False
# 5. 测试数据库
if not self.test_database():
return False
# 6. 启动应用
return self.start_application()
def print_install_instructions(self):
"""打印安装说明"""
print("\n📋 Python安装说明:")
print("=" * 40)
if self.system_info['os'] == 'Windows':
print("Windows系统:")
print("1. 访问 https://www.python.org/downloads/")
print("2. 下载Python 3.7或更高版本")
print("3. 安装时勾选 'Add Python to PATH'")
print("4. 重新运行此脚本")
elif self.system_info['os'] == 'Darwin': # macOS
print("macOS系统:")
print("1. 使用Homebrew: brew install python3")
print("2. 或访问 https://www.python.org/downloads/")
print("3. 重新运行此脚本")
else: # Linux
print("Linux系统:")
print("Ubuntu/Debian: sudo apt install python3 python3-pip")
print("CentOS/RHEL: sudo yum install python3 python3-pip")
print("Arch Linux: sudo pacman -S python python-pip")
print("重新运行此脚本")
def main():
"""主函数"""
launcher = NetworkSystemLauncher()
success = launcher.run()
if not success:
print("\n❌ 启动失败,请检查错误信息")
input("按回车键退出...")
sys.exit(1)
if __name__ == "__main__":
main()
|
2201_75665698/planX
|
WebSystemNoChat/start.py
|
Python
|
unknown
| 15,247
|
#!/bin/bash
# 网络信息系统启动器
# Network Information System Launcher
echo "========================================"
echo " 网络信息系统启动器"
echo "========================================"
echo
python3 start.py
|
2201_75665698/planX
|
WebSystemNoChat/start.sh
|
Shell
|
unknown
| 246
|
/* 自定义样式 */
.sidebar {
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.main-content {
background-color: #f8f9fa;
min-height: 100vh;
}
.card {
border: none;
border-radius: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}
.status-online {
color: #28a745;
}
.status-offline {
color: #dc3545;
}
.status-unknown {
color: #6c757d;
}
.navbar-brand {
font-weight: bold;
color: white !important;
}
.nav-link {
color: rgba(255, 255, 255, 0.8) !important;
transition: color 0.3s;
border-radius: 5px;
margin: 2px 0;
}
.nav-link:hover {
color: white !important;
background-color: rgba(255, 255, 255, 0.1);
}
.nav-link.active {
color: white !important;
background-color: rgba(255, 255, 255, 0.2);
}
.log-container {
max-height: 400px;
overflow-y: auto;
}
.log-container::-webkit-scrollbar {
width: 6px;
}
.log-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
.log-container::-webkit-scrollbar-thumb {
background: #888;
border-radius: 3px;
}
.log-container::-webkit-scrollbar-thumb:hover {
background: #555;
}
.table-hover tbody tr:hover {
background-color: rgba(0, 123, 255, 0.05);
}
.badge {
font-size: 0.75em;
}
.btn-group .btn {
margin-right: 2px;
}
.btn-group .btn:last-child {
margin-right: 0;
}
/* 响应式设计 */
@media (max-width: 768px) {
.sidebar {
min-height: auto;
}
.main-content {
margin-top: 20px;
}
.card {
margin-bottom: 20px;
}
}
/* 动画效果 */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.card {
animation: fadeIn 0.5s ease-out;
}
/* 加载动画 */
.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid rgba(255,255,255,.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* 状态指示器 */
.status-indicator {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 5px;
}
.status-indicator.online {
background-color: #28a745;
box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
}
.status-indicator.offline {
background-color: #dc3545;
box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
}
.status-indicator.unknown {
background-color: #6c757d;
}
/* 图表容器 */
.chart-container {
position: relative;
height: 300px;
width: 100%;
}
/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
|
2201_75665698/planX
|
WebSystemNoChat/static/style.css
|
CSS
|
unknown
| 3,152
|
{% extends "base.html" %}
{% block page_title %}添加设备{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h4><i class="fas fa-plus"></i> 添加网络设备</h4>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.name.label(class="form-label") }}
{{ form.name(class="form-control") }}
{% if form.name.errors %}
<div class="text-danger">
{% for error in form.name.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.ip_address.label(class="form-label") }}
{{ form.ip_address(class="form-control", placeholder="例如: 192.168.1.1") }}
{% if form.ip_address.errors %}
<div class="text-danger">
{% for error in form.ip_address.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.device_type.label(class="form-label") }}
{{ form.device_type(class="form-select") }}
{% if form.device_type.errors %}
<div class="text-danger">
{% for error in form.device_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="mb-3">
{{ form.description.label(class="form-label") }}
{{ form.description(class="form-control", rows="3", placeholder="可选:设备的详细描述信息") }}
{% if form.description.errors %}
<div class="text-danger">
{% for error in form.description.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="d-flex justify-content-between">
<a href="{{ url_for('devices') }}" class="btn btn-secondary">
<i class="fas fa-arrow-left"></i> 返回设备列表
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 帮助信息 -->
<div class="card mt-4">
<div class="card-header">
<h5><i class="fas fa-info-circle"></i> 添加设备说明</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6>设备类型说明:</h6>
<ul class="list-unstyled">
<li><i class="fas fa-wifi text-primary"></i> <strong>路由器:</strong>网络路由设备</li>
<li><i class="fas fa-sitemap text-info"></i> <strong>交换机:</strong>网络交换设备</li>
<li><i class="fas fa-server text-success"></i> <strong>服务器:</strong>服务器设备</li>
</ul>
</div>
<div class="col-md-6">
<h6>IP地址格式:</h6>
<ul class="list-unstyled">
<li>• 标准IPv4格式:192.168.1.1</li>
<li>• 确保IP地址在有效范围内</li>
<li>• 系统会自动检查设备连通性</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// IP地址格式验证
document.getElementById('ip_address').addEventListener('input', function(e) {
const ip = e.target.value;
const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (ip && !ipRegex.test(ip)) {
e.target.classList.add('is-invalid');
} else {
e.target.classList.remove('is-invalid');
}
});
// 表单提交前验证
document.querySelector('form').addEventListener('submit', function(e) {
const name = document.getElementById('name').value.trim();
const ip = document.getElementById('ip_address').value.trim();
if (!name || !ip) {
e.preventDefault();
alert('请填写所有必填字段');
return;
}
// 简单的IP格式验证
const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (!ipRegex.test(ip)) {
e.preventDefault();
alert('请输入有效的IP地址格式');
return;
}
});
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/add_device.html
|
HTML
|
unknown
| 6,163
|
{% extends "base.html" %}
{% block title %}提交侦察数据 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-plus"></i> 提交侦察数据
</h4>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="mb-3">
{{ form.title.label(class="form-label") }}
{{ form.title(class="form-control", placeholder="请输入侦察数据的标题") }}
{% if form.title.errors %}
<div class="text-danger">
{% for error in form.title.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="mb-3">
{{ form.target_system.label(class="form-label") }}
{{ form.target_system(class="form-control", placeholder="请输入目标系统名称或IP地址") }}
{% if form.target_system.errors %}
<div class="text-danger">
{% for error in form.target_system.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.data_type.label(class="form-label") }}
{{ form.data_type(class="form-select") }}
{% if form.data_type.errors %}
<div class="text-danger">
{% for error in form.data_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.priority.label(class="form-label") }}
{{ form.priority(class="form-select") }}
{% if form.priority.errors %}
<div class="text-danger">
{% for error in form.priority.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.content.label(class="form-label") }}
{{ form.content(class="form-control", rows="8", placeholder="请详细描述侦察到的信息内容...") }}
{% if form.content.errors %}
<div class="text-danger">
{% for error in form.content.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请详细描述侦察到的信息,包括但不限于:系统配置、网络拓扑、漏洞信息、用户行为等
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('recon_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 填写提示 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-lightbulb"></i> 填写提示
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6><i class="fas fa-check-circle text-success"></i> 好的侦察数据应该包含:</h6>
<ul class="list-unstyled">
<li><i class="fas fa-arrow-right text-primary"></i> 明确的目标系统信息</li>
<li><i class="fas fa-arrow-right text-primary"></i> 详细的侦察内容描述</li>
<li><i class="fas fa-arrow-right text-primary"></i> 准确的数据类型分类</li>
<li><i class="fas fa-arrow-right text-primary"></i> 合理的优先级评估</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-exclamation-triangle text-warning"></i> 注意事项:</h6>
<ul class="list-unstyled">
<li><i class="fas fa-arrow-right text-warning"></i> 确保信息的准确性和完整性</li>
<li><i class="fas fa-arrow-right text-warning"></i> 避免包含敏感的个人信息</li>
<li><i class="fas fa-arrow-right text-warning"></i> 按照实际威胁程度设置优先级</li>
<li><i class="fas fa-arrow-right text-warning"></i> 提交后数据将进入分析流程</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/add_recon_data.html
|
HTML
|
unknown
| 6,497
|
{% extends "base.html" %}
{% block title %}分析员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<!-- 待分析数据 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-clock"></i> 待分析数据
<span class="badge bg-warning ms-2">{{ pending_recon|length }}</span>
</h5>
</div>
<div class="card-body">
{% if pending_recon %}
{% for data in pending_recon %}
<div class="card mb-3 border-warning">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-search"></i> {{ data.title }}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>目标:</strong> {{ data.target_system }} |
<strong>类型:</strong>
{% if data.data_type == 'network' %}网络信息
{% elif data.data_type == 'system' %}系统信息
{% elif data.data_type == 'vulnerability' %}漏洞信息
{% elif data.data_type == 'user' %}用户信息
{% elif data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %} |
<strong>优先级:</strong>
<span class="priority-badge priority-{{ data.priority }}">
{% if data.priority == 'low' %}低
{% elif data.priority == 'medium' %}中
{% elif data.priority == 'high' %}高
{% elif data.priority == 'critical' %}紧急
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ data.content[:100] }}{% if data.content|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ data.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<a href="{{ url_for('analyze_data', recon_id=data.id) }}"
class="btn btn-sm btn-primary">
<i class="fas fa-chart-line"></i> 开始分析
</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<p class="text-muted mb-0">暂无待分析数据</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 我的分析结果 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-chart-line"></i> 我的分析结果
<span class="badge bg-info ms-2">{{ analysis_results|length }}</span>
</h5>
</div>
<div class="card-body">
{% if analysis_results %}
{% for result in analysis_results %}
<div class="card mb-3 border-info">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-chart-bar"></i>
{% if result.analysis_type == 'threat' %}威胁分析
{% elif result.analysis_type == 'vulnerability' %}漏洞分析
{% elif result.analysis_type == 'opportunity' %}机会分析
{% elif result.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>置信度:</strong>
<span class="badge bg-secondary">
{% if result.confidence_level == 'low' %}低
{% elif result.confidence_level == 'medium' %}中
{% elif result.confidence_level == 'high' %}高
{% endif %}
</span> |
<strong>状态:</strong>
<span class="status-badge status-{{ result.status }}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% elif result.status == 'approved' %}已批准
{% endif %}
</span>
</small>
</p>
<p class="card-text">
<strong>主要发现:</strong><br>
{{ result.findings[:150] }}{% if result.findings|length > 150 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ result.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-info"
data-bs-toggle="modal"
data-bs-target="#viewAnalysisModal{{ result.id }}">
<i class="fas fa-eye"></i> 查看详情
</button>
</div>
</div>
</div>
<!-- 查看分析详情模态框 -->
<div class="modal fade" id="viewAnalysisModal{{ result.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{% if result.analysis_type == 'threat' %}威胁分析
{% elif result.analysis_type == 'vulnerability' %}漏洞分析
{% elif result.analysis_type == 'opportunity' %}机会分析
{% elif result.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>置信度:</strong>
<span class="badge bg-secondary">
{% if result.confidence_level == 'low' %}低
{% elif result.confidence_level == 'medium' %}中
{% elif result.confidence_level == 'high' %}高
{% endif %}
</span>
</p>
</div>
<div class="col-md-6">
<p><strong>状态:</strong>
<span class="status-badge status-{{ result.status }}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% elif result.status == 'approved' %}已批准
{% endif %}
</span>
</p>
</div>
</div>
<h6>分析发现:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.findings }}</pre>
</div>
<h6>建议措施:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.recommendations }}</pre>
</div>
{% if result.priority_targets %}
<h6>优先目标:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.priority_targets }}</pre>
</div>
{% endif %}
{% if result.suggested_actions %}
<h6>建议行动:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.suggested_actions }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-chart-line fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无分析结果</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 工作流程说明 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 分析员工作流程
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-search fa-2x text-primary mb-2"></i>
<h6>接收数据</h6>
<small class="text-muted">接收侦察员提交的侦察数据</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-chart-line fa-2x text-info mb-2"></i>
<h6>深度分析</h6>
<small class="text-muted">对数据进行威胁、漏洞或机会分析</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-lightbulb fa-2x text-warning mb-2"></i>
<h6>提供建议</h6>
<small class="text-muted">基于分析结果提供行动建议</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-paper-plane fa-2x text-success mb-2"></i>
<h6>提交结果</h6>
<small class="text-muted">将分析结果提交给决策员审核</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/analyst_dashboard.html
|
HTML
|
unknown
| 13,897
|
{% extends "base.html" %}
{% block title %}分析侦察数据 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-4">
<!-- 侦察数据信息 -->
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-search"></i> 侦察数据信息
</h6>
</div>
<div class="card-body">
<h6>{{ recon_data.title }}</h6>
<p><strong>目标系统:</strong> {{ recon_data.target_system }}</p>
<p><strong>数据类型:</strong>
{% if recon_data.data_type == 'network' %}网络信息
{% elif recon_data.data_type == 'system' %}系统信息
{% elif recon_data.data_type == 'vulnerability' %}漏洞信息
{% elif recon_data.data_type == 'user' %}用户信息
{% elif recon_data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %}
</p>
<p><strong>优先级:</strong>
<span class="priority-badge priority-{{ recon_data.priority }}">
{% if recon_data.priority == 'low' %}低
{% elif recon_data.priority == 'medium' %}中
{% elif recon_data.priority == 'high' %}高
{% elif recon_data.priority == 'critical' %}紧急
{% endif %}
</span>
</p>
<p><strong>提交时间:</strong> {{ recon_data.created_at.strftime('%Y-%m-%d %H:%M') }}</p>
</div>
</div>
<!-- 侦察内容 -->
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-file-text"></i> 侦察内容
</h6>
</div>
<div class="card-body">
<div class="bg-light p-3 rounded" style="max-height: 300px; overflow-y: auto;">
<pre style="white-space: pre-wrap; margin: 0; font-size: 0.9rem;">{{ recon_data.content }}</pre>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<!-- 分析表单 -->
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-chart-line"></i> 数据分析
</h5>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.analysis_type.label(class="form-label") }}
{{ form.analysis_type(class="form-select") }}
{% if form.analysis_type.errors %}
<div class="text-danger">
{% for error in form.analysis_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.confidence_level.label(class="form-label") }}
{{ form.confidence_level(class="form-select") }}
{% if form.confidence_level.errors %}
<div class="text-danger">
{% for error in form.confidence_level.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.findings.label(class="form-label") }}
{{ form.findings(class="form-control", rows="6", placeholder="请详细描述分析发现...") }}
{% if form.findings.errors %}
<div class="text-danger">
{% for error in form.findings.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请详细描述通过分析发现的关键信息、威胁、漏洞或机会
</div>
</div>
<div class="mb-3">
{{ form.recommendations.label(class="form-label") }}
{{ form.recommendations(class="form-control", rows="5", placeholder="请提供具体的建议措施...") }}
{% if form.recommendations.errors %}
<div class="text-danger">
{% for error in form.recommendations.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
基于分析结果,提供具体的建议措施和应对策略
</div>
</div>
<div class="mb-3">
{{ form.priority_targets.label(class="form-label") }}
{{ form.priority_targets(class="form-control", rows="3", placeholder="请列出优先处理的目标...") }}
{% if form.priority_targets.errors %}
<div class="text-danger">
{% for error in form.priority_targets.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
列出需要优先处理的目标或系统(可选)
</div>
</div>
<div class="mb-3">
{{ form.suggested_actions.label(class="form-label") }}
{{ form.suggested_actions(class="form-control", rows="3", placeholder="请提供建议的行动方案...") }}
{% if form.suggested_actions.errors %}
<div class="text-danger">
{% for error in form.suggested_actions.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
提供具体的行动建议和实施方案(可选)
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('analyst_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 分析指导 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-lightbulb"></i> 分析指导
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6><i class="fas fa-exclamation-triangle text-danger"></i> 威胁分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 识别潜在的安全威胁</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估威胁的影响范围</li>
<li><i class="fas fa-arrow-right text-primary"></i> 分析威胁的利用可能性</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供防护建议</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-bug text-warning"></i> 漏洞分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 识别系统安全漏洞</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估漏洞的严重程度</li>
<li><i class="fas fa-arrow-right text-primary"></i> 分析漏洞的利用条件</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供修复建议</li>
</ul>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<h6><i class="fas fa-star text-success"></i> 机会分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 识别可利用的机会</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估机会的价值</li>
<li><i class="fas fa-arrow-right text-primary"></i> 分析实现条件</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供行动建议</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-chart-pie text-info"></i> 综合分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 多维度综合分析</li>
<li><i class="fas fa-arrow-right text-primary"></i> 识别关键风险点</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供整体策略建议</li>
<li><i class="fas fa-arrow-right text-primary"></i> 制定优先级排序</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/analyze_data.html
|
HTML
|
unknown
| 11,448
|
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}协同调度信息系统{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
:root {
--primary-color: #667eea;
--secondary-color: #764ba2;
--success-color: #28a745;
--info-color: #17a2b8;
--warning-color: #ffc107;
--danger-color: #dc3545;
}
body {
background-color: #f8f9fa;
}
.navbar {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-brand {
font-weight: 700;
font-size: 1.5rem;
}
.role-badge {
font-size: 0.8rem;
padding: 4px 8px;
border-radius: 15px;
}
.recon-badge { background-color: var(--success-color); }
.analyst-badge { background-color: var(--info-color); }
.decision-badge { background-color: var(--warning-color); color: #333; }
.executor-badge { background-color: var(--danger-color); }
.main-content {
margin-top: 20px;
}
.card {
border: none;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.08);
transition: transform 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
}
/* 防止模态框闪烁 - 彻底修复 */
.modal {
transition: none !important;
}
.modal-dialog {
transition: none !important;
}
.modal-content {
transition: none !important;
}
.modal-backdrop {
transition: none !important;
}
/* 当模态框打开时,禁用所有悬停效果 */
body.modal-open .card:hover {
transform: none !important;
}
body.modal-open .btn:hover {
transform: none !important;
}
/* 禁用模态框内所有元素的悬停效果 */
.modal .card:hover {
transform: none !important;
}
.modal .btn:hover {
transform: none !important;
}
.card-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
border-radius: 15px 15px 0 0 !important;
border: none;
}
.btn-primary {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
border: none;
border-radius: 10px;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.status-badge {
font-size: 0.75rem;
padding: 4px 8px;
border-radius: 10px;
}
.status-pending { background-color: #ffc107; color: #333; }
.status-analyzed { background-color: #17a2b8; color: white; }
.status-completed { background-color: #28a745; color: white; }
.status-failed { background-color: #dc3545; color: white; }
.priority-badge {
font-size: 0.75rem;
padding: 4px 8px;
border-radius: 10px;
}
.priority-low { background-color: #6c757d; color: white; }
.priority-medium { background-color: #ffc107; color: #333; }
.priority-high { background-color: #fd7e14; color: white; }
.priority-critical { background-color: #dc3545; color: white; }
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark">
<div class="container">
<a class="navbar-brand" href="{{ url_for('index') }}">
<i class="fas fa-shield-alt"></i> 协同调度信息系统
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
{% if current_user.is_authenticated %}
{% if active_role == 'recon' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('recon_dashboard') }}">
<i class="fas fa-search"></i> 侦察工作台
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('add_recon_data') }}">
<i class="fas fa-plus"></i> 提交侦察数据
</a>
</li>
{% elif active_role == 'analyst' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('analyst_dashboard') }}">
<i class="fas fa-chart-line"></i> 分析工作台
</a>
</li>
{% elif active_role == 'decision' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('decision_dashboard') }}">
<i class="fas fa-gavel"></i> 决策工作台
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('create_order') }}">
<i class="fas fa-plus"></i> 下达指令
</a>
</li>
{% elif active_role == 'executor' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('executor_dashboard') }}">
<i class="fas fa-cogs"></i> 执行工作台
</a>
</li>
{% endif %}
{% endif %}
</ul>
<ul class="navbar-nav">
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logs') }}">
<i class="fas fa-list"></i> 系统日志
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
<i class="fas fa-user"></i> {{ current_user.username }}
{% if active_role %}
<span class="role-badge {{ active_role }}-badge">
{% if active_role == 'recon' %}侦察员
{% elif active_role == 'analyst' %}分析员
{% elif active_role == 'decision' %}决策员
{% elif active_role == 'executor' %}执行员
{% endif %}
</span>
{% endif %}
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="{{ url_for('select_role') }}">
<i class="fas fa-user-shield"></i> 切换身份
</a></li>
<li><a class="dropdown-item" href="{{ url_for('logout') }}">
<i class="fas fa-sign-out-alt"></i> 退出登录
</a></li>
</ul>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('login') }}">
<i class="fas fa-sign-in-alt"></i> 登录
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
<div class="container main-content">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-info alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
// 防止模态框闪烁的完整修复
document.addEventListener('DOMContentLoaded', function() {
// 禁用所有模态框的过渡动画
var style = document.createElement('style');
style.textContent = `
.modal, .modal-dialog, .modal-content, .modal-backdrop {
transition: none !important;
animation: none !important;
}
`;
document.head.appendChild(style);
// 监听模态框事件,确保body类正确设置
document.addEventListener('show.bs.modal', function(e) {
document.body.classList.add('modal-open');
});
document.addEventListener('hide.bs.modal', function(e) {
document.body.classList.remove('modal-open');
});
// 防止模态框按钮重复点击
document.querySelectorAll('[data-bs-toggle="modal"]').forEach(function(button) {
button.addEventListener('click', function(e) {
// 防止快速重复点击
if (this.disabled) {
e.preventDefault();
return false;
}
this.disabled = true;
setTimeout(function() {
button.disabled = false;
}, 500);
});
});
});
</script>
{% block extra_js %}{% endblock %}
</body>
</html>
|
2201_75665698/planX
|
WebSystemNoChat/templates/base.html
|
HTML
|
unknown
| 11,323
|
{% extends "base.html" %}
{% block title %}下达指令 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-plus"></i> 下达新指令
</h4>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.order_type.label(class="form-label") }}
{{ form.order_type(class="form-select") }}
{% if form.order_type.errors %}
<div class="text-danger">
{% for error in form.order_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.priority.label(class="form-label") }}
{{ form.priority(class="form-select") }}
{% if form.priority.errors %}
<div class="text-danger">
{% for error in form.priority.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.target.label(class="form-label") }}
{{ form.target(class="form-control", placeholder="请输入指令目标") }}
{% if form.target.errors %}
<div class="text-danger">
{% for error in form.target.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
明确指定指令的目标对象,如系统名称、IP地址、人员等
</div>
</div>
<div class="mb-3">
{{ form.objective.label(class="form-label") }}
{{ form.objective(class="form-control", rows="4", placeholder="请描述指令的目标和期望结果...") }}
{% if form.objective.errors %}
<div class="text-danger">
{% for error in form.objective.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
详细描述指令的目标和期望达到的结果
</div>
</div>
<div class="mb-3">
{{ form.instructions.label(class="form-label") }}
{{ form.instructions(class="form-control", rows="6", placeholder="请提供具体的执行指令...") }}
{% if form.instructions.errors %}
<div class="text-danger">
{% for error in form.instructions.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
提供详细的执行步骤和具体要求
</div>
</div>
<div class="mb-3">
{{ form.assigned_to.label(class="form-label") }}
{{ form.assigned_to(class="form-select") }}
{% if form.assigned_to.errors %}
<div class="text-danger">
{% for error in form.assigned_to.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
选择负责执行此指令的人员
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('decision_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 指令类型说明 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 指令类型说明
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-search fa-2x text-success mb-2"></i>
<h6>侦察指令</h6>
<small class="text-muted">
下达给侦察员,要求进行信息收集和侦察活动
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-chart-line fa-2x text-info mb-2"></i>
<h6>分析指令</h6>
<small class="text-muted">
下达给分析员,要求对特定数据进行深度分析
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-cogs fa-2x text-danger mb-2"></i>
<h6>执行指令</h6>
<small class="text-muted">
下达给执行员,要求执行具体的行动方案
</small>
</div>
</div>
</div>
</div>
</div>
<!-- 优先级说明 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-exclamation-triangle"></i> 优先级说明
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-low">低</span>
<h6 class="mt-2">低优先级</h6>
<small class="text-muted">常规任务,可在空闲时间处理</small>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-medium">中</span>
<h6 class="mt-2">中优先级</h6>
<small class="text-muted">重要任务,需要及时处理</small>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-high">高</span>
<h6 class="mt-2">高优先级</h6>
<small class="text-muted">紧急任务,需要优先处理</small>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-critical">紧急</span>
<h6 class="mt-2">紧急优先级</h6>
<small class="text-muted">最高优先级,立即处理</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/create_order.html
|
HTML
|
unknown
| 9,592
|
{% extends "base.html" %}
{% block page_title %}仪表板{% endblock %}
{% block content %}
<!-- 系统统计卡片 -->
<div class="row mb-4">
<div class="col-md-3">
<div class="card bg-primary text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">总设备数</h6>
<h3>{{ system_stats.total_devices }}</h3>
</div>
<div class="align-self-center">
<i class="fas fa-desktop fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card bg-success text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">在线设备</h6>
<h3>{{ system_stats.online_devices }}</h3>
</div>
<div class="align-self-center">
<i class="fas fa-check-circle fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card bg-info text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">CPU使用率</h6>
<h3>{{ "%.1f"|format(system_stats.cpu_percent) }}%</h3>
</div>
<div class="align-self-center">
<i class="fas fa-microchip fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card bg-warning text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">内存使用率</h6>
<h3>{{ "%.1f"|format(system_stats.memory_percent) }}%</h3>
</div>
<div class="align-self-center">
<i class="fas fa-memory fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!-- 设备状态列表 -->
<div class="col-md-8">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h5><i class="fas fa-desktop"></i> 设备状态</h5>
<a href="{{ url_for('add_device') }}" class="btn btn-primary btn-sm">
<i class="fas fa-plus"></i> 添加设备
</a>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>设备名称</th>
<th>IP地址</th>
<th>类型</th>
<th>状态</th>
<th>最后检查</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for device in devices %}
<tr>
<td>{{ device.name }}</td>
<td>{{ device.ip_address }}</td>
<td>
<span class="badge bg-secondary">
{% if device.device_type == 'router' %}路由器
{% elif device.device_type == 'switch' %}交换机
{% elif device.device_type == 'server' %}服务器
{% elif device.device_type == 'workstation' %}工作站
{% elif device.device_type == 'printer' %}打印机
{% else %}其他
{% endif %}
</span>
</td>
<td>
<span class="badge
{% if device.status == 'online' %}bg-success
{% elif device.status == 'offline' %}bg-danger
{% else %}bg-secondary
{% endif %}">
{% if device.status == 'online' %}在线
{% elif device.status == 'offline' %}离线
{% else %}未知
{% endif %}
</span>
</td>
<td>{{ device.last_check.strftime('%H:%M:%S') if device.last_check else '未检查' }}</td>
<td>
<button class="btn btn-sm btn-outline-primary" onclick="checkDevice({{ device.id }})">
<i class="fas fa-sync"></i>
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 系统日志 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-list-alt"></i> 最近日志</h5>
</div>
<div class="card-body">
<div class="log-container" style="max-height: 400px; overflow-y: auto;">
{% for log in recent_logs %}
<div class="mb-2 p-2 border-start border-3
{% if log.level == 'error' %}border-danger
{% elif log.level == 'warning' %}border-warning
{% else %}border-info
{% endif %}">
<small class="text-muted">{{ log.timestamp.strftime('%H:%M:%S') }}</small>
<div class="small">{{ log.message }}</div>
</div>
{% endfor %}
</div>
<div class="text-center mt-3">
<a href="{{ url_for('logs') }}" class="btn btn-outline-primary btn-sm">查看全部日志</a>
</div>
</div>
</div>
</div>
</div>
<!-- 系统性能图表 -->
<div class="row mt-4">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-chart-pie"></i> 系统资源使用率</h5>
</div>
<div class="card-body">
<canvas id="systemChart" width="400" height="200"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-network-wired"></i> 网络流量统计</h5>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-6">
<h6>发送字节</h6>
<h4 class="text-primary">{{ "{:,}".format(system_stats.network_io.bytes_sent) }}</h4>
</div>
<div class="col-6">
<h6>接收字节</h6>
<h4 class="text-success">{{ "{:,}".format(system_stats.network_io.bytes_recv) }}</h4>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// 系统资源图表
const ctx = document.getElementById('systemChart').getContext('2d');
const systemChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['CPU', '内存', '磁盘'],
datasets: [{
data: [
{{ system_stats.cpu_percent }},
{{ system_stats.memory_percent }},
{{ system_stats.disk_percent }}
],
backgroundColor: [
'#007bff',
'#28a745',
'#ffc107'
]
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
// 检查设备状态
function checkDevice(deviceId) {
fetch(`/api/device_status/${deviceId}`)
.then(response => response.json())
.then(data => {
location.reload();
})
.catch(error => {
console.error('Error:', error);
alert('检查设备状态失败');
});
}
// 自动刷新页面数据
setInterval(function() {
fetch('/api/system_stats')
.then(response => response.json())
.then(data => {
// 更新统计卡片
document.querySelector('.card.bg-primary h3').textContent = data.total_devices;
document.querySelector('.card.bg-success h3').textContent = data.online_devices;
document.querySelector('.card.bg-info h3').textContent = data.cpu_percent.toFixed(1) + '%';
document.querySelector('.card.bg-warning h3').textContent = data.memory_percent.toFixed(1) + '%';
// 更新图表
systemChart.data.datasets[0].data = [
data.cpu_percent,
data.memory_percent,
data.disk_percent
];
systemChart.update();
})
.catch(error => console.error('Error:', error));
}, 30000); // 每30秒刷新一次
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/dashboard.html
|
HTML
|
unknown
| 10,182
|
{% extends "base.html" %}
{% block title %}决策员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<!-- 待审核分析结果 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-clock"></i> 待审核分析
<span class="badge bg-warning ms-2">{{ pending_analysis|length }}</span>
</h6>
</div>
<div class="card-body">
{% if pending_analysis %}
{% for analysis in pending_analysis %}
<div class="card mb-3 border-warning">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-chart-bar"></i>
{% if analysis.analysis_type == 'threat' %}威胁分析
{% elif analysis.analysis_type == 'vulnerability' %}漏洞分析
{% elif analysis.analysis_type == 'opportunity' %}机会分析
{% elif analysis.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>置信度:</strong>
<span class="badge bg-secondary">
{% if analysis.confidence_level == 'low' %}低
{% elif analysis.confidence_level == 'medium' %}中
{% elif analysis.confidence_level == 'high' %}高
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ analysis.findings[:100] }}{% if analysis.findings|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ analysis.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-primary"
data-bs-toggle="modal"
data-bs-target="#viewAnalysisModal{{ analysis.id }}">
<i class="fas fa-eye"></i> 查看
</button>
</div>
</div>
</div>
<!-- 查看分析详情模态框 -->
<div class="modal fade" id="viewAnalysisModal{{ analysis.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{% if analysis.analysis_type == 'threat' %}威胁分析
{% elif analysis.analysis_type == 'vulnerability' %}漏洞分析
{% elif analysis.analysis_type == 'opportunity' %}机会分析
{% elif analysis.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>置信度:</strong>
<span class="badge bg-secondary">
{% if analysis.confidence_level == 'low' %}低
{% elif analysis.confidence_level == 'medium' %}中
{% elif analysis.confidence_level == 'high' %}高
{% endif %}
</span>
</p>
</div>
<div class="col-md-6">
<p><strong>分析员:</strong> {{ analysis.created_by }}</p>
</div>
</div>
<h6>分析发现:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.findings }}</pre>
</div>
<h6>建议措施:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.recommendations }}</pre>
</div>
{% if analysis.priority_targets %}
<h6>优先目标:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.priority_targets }}</pre>
</div>
{% endif %}
{% if analysis.suggested_actions %}
<h6>建议行动:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.suggested_actions }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success"
onclick="approveAnalysis({{ analysis.id }})">
<i class="fas fa-check"></i> 批准
</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<p class="text-muted mb-0">暂无待审核分析</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 我的指令 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-gavel"></i> 我的指令
<span class="badge bg-info ms-2">{{ orders|length }}</span>
</h6>
</div>
<div class="card-body">
{% if orders %}
{% for order in orders %}
<div class="card mb-3 border-info">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-bullhorn"></i> {{ order.target }}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>类型:</strong>
{% if order.order_type == 'reconnaissance' %}侦察指令
{% elif order.order_type == 'analysis' %}分析指令
{% elif order.order_type == 'execution' %}执行指令
{% endif %} |
<strong>优先级:</strong>
<span class="priority-badge priority-{{ order.priority }}">
{% if order.priority == 'low' %}低
{% elif order.priority == 'medium' %}中
{% elif order.priority == 'high' %}高
{% elif order.priority == 'critical' %}紧急
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ order.objective[:80] }}{% if order.objective|length > 80 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ order.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<span class="status-badge status-{{ order.status }}">
{% if order.status == 'pending' %}待执行
{% elif order.status == 'executing' %}执行中
{% elif order.status == 'completed' %}已完成
{% elif order.status == 'failed' %}失败
{% endif %}
</span>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-gavel fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无下达指令</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 执行结果 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-tasks"></i> 执行结果
<span class="badge bg-success ms-2">{{ execution_results|length }}</span>
</h6>
</div>
<div class="card-body">
{% if execution_results %}
{% for result in execution_results %}
<div class="card mb-3 border-success">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-check-circle"></i>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</h6>
<p class="card-text">
{{ result.description[:80] }}{% if result.description|length > 80 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ result.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-success"
data-bs-toggle="modal"
data-bs-target="#viewResultModal{{ result.id }}">
<i class="fas fa-eye"></i> 查看
</button>
</div>
</div>
</div>
<!-- 查看执行结果详情模态框 -->
<div class="modal fade" id="viewResultModal{{ result.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">执行结果详情</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>执行结果:</strong>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</p>
</div>
<div class="col-md-6">
<p><strong>执行员:</strong> {{ result.created_by }}</p>
</div>
</div>
<h6>执行描述:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.description }}</pre>
</div>
{% if result.evidence %}
<h6>执行证据:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.evidence }}</pre>
</div>
{% endif %}
{% if result.impact_assessment %}
<h6>影响评估:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.impact_assessment }}</pre>
</div>
{% endif %}
{% if result.lessons_learned %}
<h6>经验教训:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.lessons_learned }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-tasks fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无执行结果</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 快速操作 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-bolt"></i> 快速操作
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<div class="d-grid">
<a href="{{ url_for('create_order') }}" class="btn btn-primary">
<i class="fas fa-plus"></i> 下达新指令
</a>
</div>
</div>
<div class="col-md-3">
<div class="d-grid">
<button class="btn btn-success" onclick="approveAllAnalysis()">
<i class="fas fa-check-double"></i> 批量批准分析
</button>
</div>
</div>
<div class="col-md-3">
<div class="d-grid">
<button class="btn btn-info" onclick="viewSystemStatus()">
<i class="fas fa-chart-pie"></i> 系统状态
</button>
</div>
</div>
<div class="col-md-3">
<div class="d-grid">
<a href="{{ url_for('logs') }}" class="btn btn-secondary">
<i class="fas fa-list"></i> 查看日志
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
function approveAnalysis(analysisId) {
if (confirm('确定要批准这个分析结果吗?')) {
// 这里可以添加AJAX请求来批准分析
alert('分析结果已批准!');
location.reload();
}
}
function approveAllAnalysis() {
if (confirm('确定要批量批准所有待审核的分析结果吗?')) {
// 这里可以添加AJAX请求来批量批准
alert('所有分析结果已批准!');
location.reload();
}
}
function viewSystemStatus() {
alert('系统状态功能开发中...');
}
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/decision_dashboard.html
|
HTML
|
unknown
| 19,357
|
{% extends "base.html" %}
{% block page_title %}设备管理{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="fas fa-desktop"></i> 网络设备管理</h2>
<a href="{{ url_for('add_device') }}" class="btn btn-primary">
<i class="fas fa-plus"></i> 添加设备
</a>
</div>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>设备名称</th>
<th>IP地址</th>
<th>设备类型</th>
<th>状态</th>
<th>最后检查</th>
<th>描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for device in devices %}
<tr>
<td>{{ device.id }}</td>
<td>
<strong>{{ device.name }}</strong>
</td>
<td>
<code>{{ device.ip_address }}</code>
</td>
<td>
<span class="badge bg-secondary">
{% if device.device_type == 'router' %}
<i class="fas fa-wifi"></i> 路由器
{% elif device.device_type == 'switch' %}
<i class="fas fa-sitemap"></i> 交换机
{% elif device.device_type == 'server' %}
<i class="fas fa-server"></i> 服务器
{% elif device.device_type == 'workstation' %}
<i class="fas fa-desktop"></i> 工作站
{% elif device.device_type == 'printer' %}
<i class="fas fa-print"></i> 打印机
{% else %}
<i class="fas fa-cog"></i> 其他
{% endif %}
</span>
</td>
<td>
<span class="badge
{% if device.status == 'online' %}bg-success
{% elif device.status == 'offline' %}bg-danger
{% else %}bg-secondary
{% endif %}">
{% if device.status == 'online' %}
<i class="fas fa-check-circle"></i> 在线
{% elif device.status == 'offline' %}
<i class="fas fa-times-circle"></i> 离线
{% else %}
<i class="fas fa-question-circle"></i> 未知
{% endif %}
</span>
</td>
<td>
{% if device.last_check %}
<small class="text-muted">
{{ device.last_check.strftime('%Y-%m-%d %H:%M:%S') }}
</small>
{% else %}
<small class="text-muted">未检查</small>
{% endif %}
</td>
<td>
{% if device.description %}
<small>{{ device.description[:50] }}{% if device.description|length > 50 %}...{% endif %}</small>
{% else %}
<small class="text-muted">无描述</small>
{% endif %}
</td>
<td>
<div class="btn-group" role="group">
<button class="btn btn-sm btn-outline-primary"
onclick="checkDevice({{ device.id }})"
title="检查状态">
<i class="fas fa-sync"></i>
</button>
<button class="btn btn-sm btn-outline-info"
onclick="showDeviceInfo({{ device.id }})"
title="查看详情">
<i class="fas fa-info"></i>
</button>
<button class="btn btn-sm btn-outline-danger"
onclick="deleteDevice({{ device.id }})"
title="删除设备">
<i class="fas fa-trash"></i>
</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if not devices %}
<div class="text-center py-5">
<i class="fas fa-desktop fa-3x text-muted mb-3"></i>
<h5 class="text-muted">暂无设备</h5>
<p class="text-muted">点击上方"添加设备"按钮开始添加网络设备</p>
</div>
{% endif %}
</div>
</div>
<!-- 设备详情模态框 -->
<div class="modal fade" id="deviceInfoModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">设备详情</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body" id="deviceInfoContent">
<!-- 设备信息将在这里动态加载 -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// 检查设备状态
function checkDevice(deviceId) {
const button = event.target.closest('button');
const icon = button.querySelector('i');
// 显示加载状态
icon.className = 'fas fa-spinner fa-spin';
button.disabled = true;
fetch(`/api/device_status/${deviceId}`)
.then(response => response.json())
.then(data => {
// 恢复按钮状态
icon.className = 'fas fa-sync';
button.disabled = false;
// 刷新页面显示最新状态
location.reload();
})
.catch(error => {
console.error('Error:', error);
icon.className = 'fas fa-sync';
button.disabled = false;
alert('检查设备状态失败');
});
}
// 显示设备详情
function showDeviceInfo(deviceId) {
// 这里可以添加获取设备详细信息的API调用
const modal = new bootstrap.Modal(document.getElementById('deviceInfoModal'));
document.getElementById('deviceInfoContent').innerHTML = `
<div class="text-center">
<i class="fas fa-spinner fa-spin fa-2x"></i>
<p class="mt-2">加载设备信息中...</p>
</div>
`;
modal.show();
// 模拟加载设备信息
setTimeout(() => {
document.getElementById('deviceInfoContent').innerHTML = `
<div class="row">
<div class="col-6">
<strong>设备ID:</strong> ${deviceId}
</div>
<div class="col-6">
<strong>状态:</strong> <span class="badge bg-success">在线</span>
</div>
</div>
<hr>
<div class="row">
<div class="col-12">
<strong>详细信息:</strong>
<p class="mt-2">这是一个示例设备,实际应用中会显示真实的设备信息。</p>
</div>
</div>
`;
}, 1000);
}
// 删除设备
function deleteDevice(deviceId) {
if (confirm('确定要删除这个设备吗?此操作不可撤销。')) {
// 这里应该添加删除设备的API调用
alert('删除功能需要后端API支持');
}
}
// 批量检查所有设备状态
function checkAllDevices() {
const checkButtons = document.querySelectorAll('button[onclick*="checkDevice"]');
checkButtons.forEach(button => {
button.click();
});
}
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/devices.html
|
HTML
|
unknown
| 8,990
|
{% extends "base.html" %}
{% block title %}执行指令 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-4">
<!-- 指令信息 -->
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-bullhorn"></i> 指令信息
</h6>
</div>
<div class="card-body">
<h6>{{ order.target }}</h6>
<p><strong>指令类型:</strong>
{% if order.order_type == 'reconnaissance' %}侦察指令
{% elif order.order_type == 'analysis' %}分析指令
{% elif order.order_type == 'execution' %}执行指令
{% endif %}
</p>
<p><strong>优先级:</strong>
<span class="priority-badge priority-{{ order.priority }}">
{% if order.priority == 'low' %}低
{% elif order.priority == 'medium' %}中
{% elif order.priority == 'high' %}高
{% elif order.priority == 'critical' %}紧急
{% endif %}
</span>
</p>
<p><strong>下达时间:</strong> {{ order.created_at.strftime('%Y-%m-%d %H:%M') }}</p>
</div>
</div>
<!-- 指令目标 -->
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-target"></i> 指令目标
</h6>
</div>
<div class="card-body">
<div class="bg-light p-3 rounded">
<pre style="white-space: pre-wrap; margin: 0; font-size: 0.9rem;">{{ order.objective }}</pre>
</div>
</div>
</div>
<!-- 具体指令 -->
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-list"></i> 具体指令
</h6>
</div>
<div class="card-body">
<div class="bg-light p-3 rounded" style="max-height: 300px; overflow-y: auto;">
<pre style="white-space: pre-wrap; margin: 0; font-size: 0.9rem;">{{ order.instructions }}</pre>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<!-- 执行结果表单 -->
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-cogs"></i> 执行结果
</h5>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="mb-3">
{{ form.result_type.label(class="form-label") }}
{{ form.result_type(class="form-select") }}
{% if form.result_type.errors %}
<div class="text-danger">
{% for error in form.result_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请如实选择执行结果类型
</div>
</div>
<div class="mb-3">
{{ form.description.label(class="form-label") }}
{{ form.description(class="form-control", rows="6", placeholder="请详细描述执行过程和结果...") }}
{% if form.description.errors %}
<div class="text-danger">
{% for error in form.description.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请详细描述执行过程、遇到的问题、采取的措施和最终结果
</div>
</div>
<div class="mb-3">
{{ form.evidence.label(class="form-label") }}
{{ form.evidence(class="form-control", rows="4", placeholder="请提供执行证据,如截图、日志、文件等...") }}
{% if form.evidence.errors %}
<div class="text-danger">
{% for error in form.evidence.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
提供执行证据,如截图、日志文件、配置文件等(可选)
</div>
</div>
<div class="mb-3">
{{ form.impact_assessment.label(class="form-label") }}
{{ form.impact_assessment(class="form-control", rows="4", placeholder="请评估执行结果的影响...") }}
{% if form.impact_assessment.errors %}
<div class="text-danger">
{% for error in form.impact_assessment.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
评估执行结果对目标系统或环境的影响(可选)
</div>
</div>
<div class="mb-3">
{{ form.lessons_learned.label(class="form-label") }}
{{ form.lessons_learned(class="form-control", rows="3", placeholder="请总结执行过程中的经验教训...") }}
{% if form.lessons_learned.errors %}
<div class="text-danger">
{% for error in form.lessons_learned.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
总结执行过程中的经验教训和改进建议(可选)
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('executor_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 执行指导 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-lightbulb"></i> 执行指导
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6><i class="fas fa-check-circle text-success"></i> 执行成功要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 严格按照指令要求执行</li>
<li><i class="fas fa-arrow-right text-primary"></i> 详细记录执行过程</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供充分的执行证据</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估执行结果的影响</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-exclamation-triangle text-warning"></i> 注意事项:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-warning"></i> 确保操作的安全性和合规性</li>
<li><i class="fas fa-arrow-right text-warning"></i> 遇到问题及时沟通反馈</li>
<li><i class="fas fa-arrow-right text-warning"></i> 保护敏感信息的安全</li>
<li><i class="fas fa-arrow-right text-warning"></i> 如实报告执行结果</li>
</ul>
</div>
</div>
</div>
</div>
<!-- 执行结果类型说明 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 执行结果类型说明
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<h6>执行成功</h6>
<small class="text-muted">
完全按照指令要求完成,达到预期目标
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-exclamation-triangle fa-2x text-warning mb-2"></i>
<h6>部分成功</h6>
<small class="text-muted">
部分完成指令要求,存在一些限制或问题
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-times-circle fa-2x text-danger mb-2"></i>
<h6>执行失败</h6>
<small class="text-muted">
未能完成指令要求,需要重新制定方案
</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/execute_order.html
|
HTML
|
unknown
| 11,282
|
{% extends "base.html" %}
{% block title %}执行员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<!-- 待执行指令 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-tasks"></i> 待执行指令
<span class="badge bg-warning ms-2">{{ assigned_orders|length }}</span>
</h5>
</div>
<div class="card-body">
{% if assigned_orders %}
{% for order in assigned_orders %}
<div class="card mb-3 border-warning">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-bullhorn"></i> {{ order.target }}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>类型:</strong>
{% if order.order_type == 'reconnaissance' %}侦察指令
{% elif order.order_type == 'analysis' %}分析指令
{% elif order.order_type == 'execution' %}执行指令
{% endif %} |
<strong>优先级:</strong>
<span class="priority-badge priority-{{ order.priority }}">
{% if order.priority == 'low' %}低
{% elif order.priority == 'medium' %}中
{% elif order.priority == 'high' %}高
{% elif order.priority == 'critical' %}紧急
{% endif %}
</span>
</small>
</p>
<p class="card-text">
<strong>目标:</strong> {{ order.objective[:100] }}{% if order.objective|length > 100 %}...{% endif %}
</p>
<p class="card-text">
<strong>指令:</strong> {{ order.instructions[:100] }}{% if order.instructions|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ order.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<a href="{{ url_for('execute_order', order_id=order.id) }}"
class="btn btn-sm btn-primary">
<i class="fas fa-play"></i> 开始执行
</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<p class="text-muted mb-0">暂无待执行指令</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 我的执行结果 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-history"></i> 我的执行结果
<span class="badge bg-info ms-2">{{ execution_results|length }}</span>
</h5>
</div>
<div class="card-body">
{% if execution_results %}
{% for result in execution_results %}
<div class="card mb-3 border-info">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-check-circle"></i>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>状态:</strong>
<span class="status-badge status-{{ result.status }}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ result.description[:100] }}{% if result.description|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ result.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-info"
data-bs-toggle="modal"
data-bs-target="#viewResultModal{{ result.id }}">
<i class="fas fa-eye"></i> 查看详情
</button>
</div>
</div>
</div>
<!-- 查看执行结果详情模态框 -->
<div class="modal fade" id="viewResultModal{{ result.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">执行结果详情</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>执行结果:</strong>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</p>
</div>
<div class="col-md-6">
<p><strong>状态:</strong>
<span class="status-badge status-{{ result.status }}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% endif %}
</span>
</p>
</div>
</div>
<h6>执行描述:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.description }}</pre>
</div>
{% if result.evidence %}
<h6>执行证据:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.evidence }}</pre>
</div>
{% endif %}
{% if result.impact_assessment %}
<h6>影响评估:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.impact_assessment }}</pre>
</div>
{% endif %}
{% if result.lessons_learned %}
<h6>经验教训:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.lessons_learned }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-history fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无执行结果</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 执行统计 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-chart-bar"></i> 执行统计
</h6>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-tasks fa-2x text-warning mb-2"></i>
<h4 class="text-warning">{{ assigned_orders|length }}</h4>
<h6>待执行指令</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<h4 class="text-success">
{{ execution_results|selectattr('result_type', 'equalto', 'success')|list|length }}
</h4>
<h6>成功执行</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-exclamation-triangle fa-2x text-warning mb-2"></i>
<h4 class="text-warning">
{{ execution_results|selectattr('result_type', 'equalto', 'partial')|list|length }}
</h4>
<h6>部分成功</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-times-circle fa-2x text-danger mb-2"></i>
<h4 class="text-danger">
{{ execution_results|selectattr('result_type', 'equalto', 'failed')|list|length }}
</h4>
<h6>执行失败</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 工作流程说明 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 执行员工作流程
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-bullhorn fa-2x text-primary mb-2"></i>
<h6>接收指令</h6>
<small class="text-muted">接收决策员下达的执行指令</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-cogs fa-2x text-info mb-2"></i>
<h6>执行任务</h6>
<small class="text-muted">按照指令要求执行具体任务</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-clipboard-check fa-2x text-warning mb-2"></i>
<h6>记录结果</h6>
<small class="text-muted">详细记录执行过程和结果</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-paper-plane fa-2x text-success mb-2"></i>
<h6>提交反馈</h6>
<small class="text-muted">将执行结果反馈给决策员</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/executor_dashboard.html
|
HTML
|
unknown
| 14,755
|
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.welcome-container {
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
padding: 50px;
text-align: center;
max-width: 800px;
width: 90%;
}
.welcome-header h1 {
color: #333;
font-weight: 700;
margin-bottom: 20px;
}
.welcome-header p {
color: #666;
font-size: 1.2rem;
margin-bottom: 40px;
}
.role-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin: 40px 0;
}
.role-card {
background: white;
border-radius: 15px;
padding: 30px 20px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
border: 3px solid transparent;
}
.role-card:hover {
transform: translateY(-10px);
}
.role-card.recon { border-color: #28a745; }
.role-card.analyst { border-color: #17a2b8; }
.role-card.decision { border-color: #ffc107; }
.role-card.executor { border-color: #dc3545; }
.role-icon {
width: 60px;
height: 60px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20px;
font-size: 24px;
color: white;
}
.recon .role-icon { background: #28a745; }
.analyst .role-icon { background: #17a2b8; }
.decision .role-icon { background: #ffc107; color: #333; }
.executor .role-icon { background: #dc3545; }
.role-title {
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 10px;
color: #333;
}
.role-desc {
color: #666;
font-size: 0.9rem;
line-height: 1.5;
}
.btn-login {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 10px;
padding: 15px 40px;
font-size: 1.1rem;
font-weight: 600;
color: white;
text-decoration: none;
display: inline-block;
transition: transform 0.3s ease;
}
.btn-login:hover {
transform: translateY(-3px);
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
color: white;
}
.system-features {
margin-top: 40px;
text-align: left;
}
.feature-item {
display: flex;
align-items: center;
margin-bottom: 15px;
padding: 10px;
background: rgba(102, 126, 234, 0.1);
border-radius: 10px;
}
.feature-icon {
width: 40px;
height: 40px;
background: #667eea;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
color: white;
}
</style>
</head>
<body>
<div class="welcome-container">
<div class="welcome-header">
<h1><i class="fas fa-shield-alt"></i> 协同调度信息系统</h1>
<p>基于角色的协同作战信息管理平台</p>
</div>
<div class="role-cards">
<div class="role-card recon">
<div class="role-icon">
<i class="fas fa-search"></i>
</div>
<div class="role-title">侦察员</div>
<div class="role-desc">
负责信息收集和侦察数据提交,为后续分析提供基础数据支撑
</div>
</div>
<div class="role-card analyst">
<div class="role-icon">
<i class="fas fa-chart-line"></i>
</div>
<div class="role-title">分析员</div>
<div class="role-desc">
对侦察数据进行深度分析,识别威胁和机会,提供决策建议
</div>
</div>
<div class="role-card decision">
<div class="role-icon">
<i class="fas fa-gavel"></i>
</div>
<div class="role-title">决策员</div>
<div class="role-desc">
基于分析结果制定作战计划,下达指令并协调各角色协同作战
</div>
</div>
<div class="role-card executor">
<div class="role-icon">
<i class="fas fa-cogs"></i>
</div>
<div class="role-title">执行员</div>
<div class="role-desc">
执行决策员下达的指令,完成任务并反馈执行结果
</div>
</div>
</div>
<div class="system-features">
<h4 style="text-align: center; margin-bottom: 30px; color: #333;">
<i class="fas fa-star"></i> 系统特性
</h4>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-users"></i>
</div>
<div>
<strong>角色分工明确</strong><br>
<small>四种角色各司其职,形成完整的作战链条</small>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-sync-alt"></i>
</div>
<div>
<strong>信息流转顺畅</strong><br>
<small>从侦察到执行的信息传递和反馈机制</small>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-shield-alt"></i>
</div>
<div>
<strong>权限控制严格</strong><br>
<small>基于角色的访问控制,确保信息安全</small>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-history"></i>
</div>
<div>
<strong>全程可追溯</strong><br>
<small>完整的操作日志和审计跟踪</small>
</div>
</div>
</div>
<div style="margin-top: 40px;">
<a href="{{ url_for('login') }}" class="btn-login">
<i class="fas fa-sign-in-alt"></i> 立即登录
</a>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
|
2201_75665698/planX
|
WebSystemNoChat/templates/index.html
|
HTML
|
unknown
| 7,915
|
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.login-container {
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
padding: 40px;
width: 100%;
max-width: 400px;
}
.login-header {
text-align: center;
margin-bottom: 30px;
}
.login-header h1 {
color: #333;
font-weight: 700;
margin-bottom: 10px;
}
.login-header p {
color: #666;
margin: 0;
}
.form-control {
border-radius: 10px;
border: 2px solid #e1e5e9;
padding: 12px 15px;
font-size: 16px;
}
.form-control:focus {
border-color: #667eea;
box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}
.btn-login {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 10px;
padding: 12px;
font-size: 16px;
font-weight: 600;
width: 100%;
margin-top: 20px;
}
.btn-login:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.role-info {
background: #f8f9fa;
border-radius: 10px;
padding: 20px;
margin-top: 30px;
}
.role-info h6 {
color: #333;
font-weight: 600;
margin-bottom: 15px;
}
.role-item {
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 8px 0;
}
.role-icon {
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
font-size: 14px;
color: white;
}
.recon { background: #28a745; }
.analyst { background: #17a2b8; }
.decision { background: #ffc107; color: #333 !important; }
.executor { background: #dc3545; }
</style>
</head>
<body>
<div class="login-container">
<div class="login-header">
<h1><i class="fas fa-shield-alt"></i> 协同调度信息系统</h1>
<p>请登录以访问您的角色界面</p>
</div>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-danger alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<form method="POST">
{{ form.hidden_tag() }}
<div class="mb-3">
<label for="username" class="form-label">
<i class="fas fa-user"></i> 用户名
</label>
{{ form.username(class="form-control", placeholder="请输入用户名") }}
</div>
<div class="mb-3">
<label for="password" class="form-label">
<i class="fas fa-lock"></i> 密码
</label>
{{ form.password(class="form-control", placeholder="请输入密码") }}
</div>
{{ form.submit(class="btn btn-primary btn-login") }}
</form>
<!--
<div class="role-info">
<h6><i class="fas fa-info-circle"></i> 测试账户</h6>
<div class="role-item">
<div class="role-icon recon">
<i class="fas fa-search"></i>
</div>
<div>
<strong>侦察员:</strong> recon1 / recon123
</div>
</div>
<div class="role-item">
<div class="role-icon analyst">
<i class="fas fa-chart-line"></i>
</div>
<div>
<strong>分析员:</strong> analyst1 / analyst123
</div>
</div>
<div class="role-item">
<div class="role-icon decision">
<i class="fas fa-gavel"></i>
</div>
<div>
<strong>决策员:</strong> decision1 / decision123
</div>
</div>
<div class="role-item">
<div class="role-icon executor">
<i class="fas fa-cogs"></i>
</div>
<div>
<strong>执行员:</strong> executor1 / executor123
</div>
</div>
</div> -->
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
|
2201_75665698/planX
|
WebSystemNoChat/templates/login.html
|
HTML
|
unknown
| 5,797
|
{% extends "base.html" %}
{% block title %}系统日志 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-list"></i> 系统日志
</h4>
</div>
<div class="card-body">
{% if logs.items %}
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-dark">
<tr>
<th>时间</th>
<th>级别</th>
<th>操作类型</th>
<th>消息</th>
<th>用户</th>
</tr>
</thead>
<tbody>
{% for log in logs.items %}
<tr>
<td>{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
<td>
{% if log.level == 'info' %}
<span class="badge bg-info">信息</span>
{% elif log.level == 'warning' %}
<span class="badge bg-warning text-dark">警告</span>
{% elif log.level == 'error' %}
<span class="badge bg-danger">错误</span>
{% elif log.level == 'debug' %}
<span class="badge bg-secondary">调试</span>
{% else %}
<span class="badge bg-light text-dark">{{ log.level }}</span>
{% endif %}
</td>
<td>
{% if log.action_type == 'recon' %}
<span class="badge bg-success">侦察</span>
{% elif log.action_type == 'analysis' %}
<span class="badge bg-info">分析</span>
{% elif log.action_type == 'decision' %}
<span class="badge bg-warning text-dark">决策</span>
{% elif log.action_type == 'execution' %}
<span class="badge bg-danger">执行</span>
{% elif log.action_type == 'login' %}
<span class="badge bg-primary">登录</span>
{% elif log.action_type == 'logout' %}
<span class="badge bg-secondary">退出</span>
{% else %}
<span class="badge bg-light text-dark">{{ log.action_type or '系统' }}</span>
{% endif %}
</td>
<td>{{ log.message }}</td>
<td>
{% if log.user_id %}
<span class="badge bg-light text-dark">用户{{ log.user_id }}</span>
{% else %}
<span class="text-muted">系统</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- 分页 -->
{% if logs.pages > 1 %}
<nav aria-label="日志分页">
<ul class="pagination justify-content-center">
{% if logs.has_prev %}
<li class="page-item">
<a class="page-link" href="{{ url_for('logs', page=logs.prev_num) }}">上一页</a>
</li>
{% endif %}
{% for page_num in logs.iter_pages() %}
{% if page_num %}
{% if page_num != logs.page %}
<li class="page-item">
<a class="page-link" href="{{ url_for('logs', page=page_num) }}">{{ page_num }}</a>
</li>
{% else %}
<li class="page-item active">
<span class="page-link">{{ page_num }}</span>
</li>
{% endif %}
{% else %}
<li class="page-item disabled">
<span class="page-link">...</span>
</li>
{% endif %}
{% endfor %}
{% if logs.has_next %}
<li class="page-item">
<a class="page-link" href="{{ url_for('logs', page=logs.next_num) }}">下一页</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% else %}
<div class="text-center py-5">
<i class="fas fa-list fa-3x text-muted mb-3"></i>
<h5 class="text-muted">暂无系统日志</h5>
<p class="text-muted">系统运行后会产生相应的日志记录</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 日志统计 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-chart-pie"></i> 日志统计
</h6>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-info-circle fa-2x text-info mb-2"></i>
<h4 class="text-info">
{{ logs.items|selectattr('level', 'equalto', 'info')|list|length }}
</h4>
<h6>信息日志</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-exclamation-triangle fa-2x text-warning mb-2"></i>
<h4 class="text-warning">
{{ logs.items|selectattr('level', 'equalto', 'warning')|list|length }}
</h4>
<h6>警告日志</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-times-circle fa-2x text-danger mb-2"></i>
<h4 class="text-danger">
{{ logs.items|selectattr('level', 'equalto', 'error')|list|length }}
</h4>
<h6>错误日志</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-bug fa-2x text-secondary mb-2"></i>
<h4 class="text-secondary">
{{ logs.items|selectattr('level', 'equalto', 'debug')|list|length }}
</h4>
<h6>调试日志</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 操作类型统计 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-chart-bar"></i> 操作类型统计
</h6>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-search fa-2x text-success mb-2"></i>
<h4 class="text-success">
{{ logs.items|selectattr('action_type', 'equalto', 'recon')|list|length }}
</h4>
<h6>侦察操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-chart-line fa-2x text-info mb-2"></i>
<h4 class="text-info">
{{ logs.items|selectattr('action_type', 'equalto', 'analysis')|list|length }}
</h4>
<h6>分析操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-gavel fa-2x text-warning mb-2"></i>
<h4 class="text-warning">
{{ logs.items|selectattr('action_type', 'equalto', 'decision')|list|length }}
</h4>
<h6>决策操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-cogs fa-2x text-danger mb-2"></i>
<h4 class="text-danger">
{{ logs.items|selectattr('action_type', 'equalto', 'execution')|list|length }}
</h4>
<h6>执行操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-sign-in-alt fa-2x text-primary mb-2"></i>
<h4 class="text-primary">
{{ logs.items|selectattr('action_type', 'equalto', 'login')|list|length }}
</h4>
<h6>登录操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-sign-out-alt fa-2x text-secondary mb-2"></i>
<h4 class="text-secondary">
{{ logs.items|selectattr('action_type', 'equalto', 'logout')|list|length }}
</h4>
<h6>退出操作</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/logs.html
|
HTML
|
unknown
| 11,807
|
{% extends "base.html" %}
{% block title %}侦察员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-search"></i> 侦察员工作台
</h4>
</div>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-6">
<div class="d-grid">
<a href="{{ url_for('add_recon_data') }}" class="btn btn-primary">
<i class="fas fa-plus"></i> 提交新的侦察数据
</a>
</div>
</div>
<div class="col-md-6">
<div class="alert alert-info mb-0">
<i class="fas fa-info-circle"></i>
<strong>当前状态:</strong> 已提交 {{ recon_data|length }} 条侦察数据
</div>
</div>
</div>
{% if recon_data %}
<h5><i class="fas fa-list"></i> 我的侦察数据</h5>
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-dark">
<tr>
<th>标题</th>
<th>目标系统</th>
<th>数据类型</th>
<th>优先级</th>
<th>状态</th>
<th>提交时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for data in recon_data %}
<tr>
<td>
<strong>{{ data.title }}</strong>
</td>
<td>{{ data.target_system }}</td>
<td>
<span class="badge bg-info">
{% if data.data_type == 'network' %}网络信息
{% elif data.data_type == 'system' %}系统信息
{% elif data.data_type == 'vulnerability' %}漏洞信息
{% elif data.data_type == 'user' %}用户信息
{% elif data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %}
</span>
</td>
<td>
<span class="priority-badge priority-{{ data.priority }}">
{% if data.priority == 'low' %}低
{% elif data.priority == 'medium' %}中
{% elif data.priority == 'high' %}高
{% elif data.priority == 'critical' %}紧急
{% endif %}
</span>
</td>
<td>
<span class="status-badge status-{{ data.status }}">
{% if data.status == 'pending' %}待分析
{% elif data.status == 'analyzed' %}已分析
{% elif data.status == 'processed' %}已处理
{% endif %}
</span>
</td>
<td>{{ data.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
<td>
<button class="btn btn-sm btn-outline-primary"
data-bs-toggle="modal"
data-bs-target="#viewModal{{ data.id }}">
<i class="fas fa-eye"></i> 查看
</button>
</td>
</tr>
<!-- 查看详情模态框 -->
<div class="modal fade" id="viewModal{{ data.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ data.title }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<p><strong>目标系统:</strong> {{ data.target_system }}</p>
<p><strong>数据类型:</strong>
{% if data.data_type == 'network' %}网络信息
{% elif data.data_type == 'system' %}系统信息
{% elif data.data_type == 'vulnerability' %}漏洞信息
{% elif data.data_type == 'user' %}用户信息
{% elif data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %}
</p>
</div>
<div class="col-md-6">
<p><strong>优先级:</strong>
<span class="priority-badge priority-{{ data.priority }}">
{% if data.priority == 'low' %}低
{% elif data.priority == 'medium' %}中
{% elif data.priority == 'high' %}高
{% elif data.priority == 'critical' %}紧急
{% endif %}
</span>
</p>
<p><strong>状态:</strong>
<span class="status-badge status-{{ data.status }}">
{% if data.status == 'pending' %}待分析
{% elif data.status == 'analyzed' %}已分析
{% elif data.status == 'processed' %}已处理
{% endif %}
</span>
</p>
</div>
</div>
<hr>
<h6>侦察内容:</h6>
<div class="bg-light p-3 rounded">
<pre style="white-space: pre-wrap; margin: 0;">{{ data.content }}</pre>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-5">
<i class="fas fa-search fa-3x text-muted mb-3"></i>
<h5 class="text-muted">暂无侦察数据</h5>
<p class="text-muted">点击上方按钮提交您的第一条侦察数据</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemNoChat/templates/recon_dashboard.html
|
HTML
|
unknown
| 9,445
|
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body { background: #f8f9fa; }
.role-card { cursor: pointer; transition: transform .2s; }
.role-card:hover { transform: translateY(-4px); }
.active-role { border: 2px solid #667eea; }
</style>
<script>
function selectRole(role){
document.getElementById('role').value = role;
const cards = document.querySelectorAll('.role-card');
cards.forEach(c=>c.classList.remove('active-role'));
document.getElementById('card-'+role).classList.add('active-role');
}
</script>
</head>
<body>
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="card">
<div class="card-header">
<h5 class="mb-0"><i class="fas fa-user-shield"></i> 请选择本次使用的身份并进行二次验证</h5>
</div>
<div class="card-body">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="row g-3 mb-3">
<div class="col-6 col-md-3">
<div id="card-recon" class="card role-card" onclick="selectRole('recon')">
<div class="card-body text-center">
<div class="text-success fs-3"><i class="fas fa-search"></i></div>
<div class="mt-2">侦察员</div>
</div>
</div>
</div>
<div class="col-6 col-md-3">
<div id="card-analyst" class="card role-card" onclick="selectRole('analyst')">
<div class="card-body text-center">
<div class="text-info fs-3"><i class="fas fa-chart-line"></i></div>
<div class="mt-2">分析员</div>
</div>
</div>
</div>
<div class="col-6 col-md-3">
<div id="card-decision" class="card role-card" onclick="selectRole('decision')">
<div class="card-body text-center">
<div class="text-warning fs-3"><i class="fas fa-gavel"></i></div>
<div class="mt-2">决策员</div>
</div>
</div>
</div>
<div class="col-6 col-md-3">
<div id="card-executor" class="card role-card" onclick="selectRole('executor')">
<div class="card-body text-center">
<div class="text-danger fs-3"><i class="fas fa-cogs"></i></div>
<div class="mt-2">执行员</div>
</div>
</div>
</div>
</div>
<form method="POST">
<input type="hidden" id="role" name="role" value="{{ active_role or '' }}">
<div class="mb-3">
<label class="form-label">身份密码(再次输入账号密码以验证)</label>
<input type="password" name="role_password" class="form-control" placeholder="请输入密码" required>
</div>
<button class="btn btn-primary" type="submit"><i class="fas fa-check"></i> 启用身份</button>
<a href="{{ url_for('logout') }}" class="btn btn-link">退出账户</a>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
|
2201_75665698/planX
|
WebSystemNoChat/templates/select_role.html
|
HTML
|
unknown
| 5,212
|
from flask import Flask, render_template, request, jsonify, redirect, url_for, flash, session, send_from_directory
from werkzeug.utils import secure_filename
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin, login_user, logout_user, login_required, current_user
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed
from wtforms import StringField, PasswordField, TextAreaField, SelectField, SubmitField
from wtforms.validators import DataRequired, Length, Email
from flask_cors import CORS
import os
import psutil
import requests
import json
from datetime import datetime, timedelta, timezone
import threading
import time
import sys
import uuid
from flask_socketio import SocketIO, emit, join_room, leave_room
# 设置输出编码
if sys.platform.startswith('win'):
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach())
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.detach())
app = Flask(__name__)
app.config['SECRET_KEY'] = 'your-secret-key-here'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///network_system.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['UPLOAD_FOLDER'] = 'uploads'
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB max file size
db = SQLAlchemy(app)
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
CORS(app)
socketio = SocketIO(app, cors_allowed_origins="*",async_mode="threading", logger=False, engineio_logger=False)
# 确保上传目录存在
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
def save_uploaded_file(file, order_id, user_id):
"""保存上传的文件并返回文件路径"""
if file and file.filename:
# 获取文件扩展名
file_ext = os.path.splitext(file.filename)[1]
# 生成安全的文件名
filename = f"execution_{order_id}_{user_id}_{datetime.now().strftime('%Y%m%d_%H%M%S')}{file_ext}"
filename = secure_filename(filename)
file_path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
file.save(file_path)
return filename
return None
def create_user_session(user_id, ip_address=None, user_agent=None):
"""創建用戶會話"""
session_token = str(uuid.uuid4())
user_session = UserSession(
user_id=user_id,
session_token=session_token,
ip_address=ip_address,
user_agent=user_agent
)
db.session.add(user_session)
return session_token
def invalidate_user_sessions(user_id):
"""使指定用戶的所有會話失效"""
UserSession.query.filter_by(user_id=user_id, is_active=True).update({'is_active': False})
User.query.filter_by(id=user_id).update({'is_online': False})
db.session.commit()
def cleanup_expired_sessions():
"""清理過期的會話"""
try:
# 設置會話過期時間為2小時
expire_time = datetime.now(timezone.utc) - timedelta(hours=2)
UserSession.query.filter(
UserSession.last_activity < expire_time,
UserSession.is_active == True
).update({'is_active': False})
# 更新用戶在線狀態
active_users = db.session.query(UserSession.user_id).filter_by(is_active=True).distinct().all()
active_user_ids = [user_id for (user_id,) in active_users]
User.query.filter(User.id.notin_(active_user_ids)).update({'is_online': False})
User.query.filter(User.id.in_(active_user_ids)).update({'is_online': True})
db.session.commit()
print(f"会话清理完成: {datetime.now()}")
except Exception as e:
print(f"会话清理失敗: {e}")
db.session.rollback()
def session_cleanup_worker():
"""後台會話清理工作線程"""
while True:
cleanup_expired_sessions()
time.sleep(30) # 每5分鐘清理一次
def is_user_already_logged_in(user_id):
"""檢查用戶是否已經登錄"""
active_session = UserSession.query.filter_by(
user_id=user_id,
is_active=True
).first()
return active_session is not None
# 辅助函数:获取当前UTC时间
def get_utc_now():
"""返回当前UTC时间(替代已弃用的datetime.utcnow())"""
return datetime.now(timezone.utc)
# 数据库模型
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
password = db.Column(db.String(120), nullable=False)
role = db.Column(db.String(20), default='recon') # 用户的默认/授权角色(现用作授权白名单)
created_at = db.Column(db.DateTime, default=get_utc_now)
last_login_at = db.Column(db.DateTime) # 最後登錄時間
is_online = db.Column(db.Boolean, default=False) # 是否在線
# 用戶會話管理表
class UserSession(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
session_token = db.Column(db.String(255), unique=True, nullable=False)
login_time = db.Column(db.DateTime, default=get_utc_now)
last_activity = db.Column(db.DateTime, default=get_utc_now)
ip_address = db.Column(db.String(45)) # 支持IPv6
user_agent = db.Column(db.Text)
is_active = db.Column(db.Boolean, default=True)
def __repr__(self):
return f'<UserSession {self.session_token}>'
class ChatMessage(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), nullable=False)
text = db.Column(db.Text, nullable=False)
timestamp = db.Column(db.DateTime, default=get_utc_now)
# 侦察数据表
class ReconData(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(200), nullable=False)
target_system = db.Column(db.String(100), nullable=False)
data_type = db.Column(db.String(50), nullable=False) # network, system, vulnerability, etc.
content = db.Column(db.Text, nullable=False)
priority = db.Column(db.String(20), default='medium') # low, medium, high, critical
status = db.Column(db.String(20), default='pending') # pending, analyzed, processed
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=get_utc_now)
updated_at = db.Column(db.DateTime, default=get_utc_now, onupdate=get_utc_now)
# 分析结果表
class AnalysisResult(db.Model):
id = db.Column(db.Integer, primary_key=True)
recon_data_id = db.Column(db.Integer, db.ForeignKey('recon_data.id'))
analysis_type = db.Column(db.String(50), nullable=False) # threat, vulnerability, opportunity
findings = db.Column(db.Text, nullable=False)
recommendations = db.Column(db.Text, nullable=False)
priority_targets = db.Column(db.Text) # JSON格式存储目标列表
suggested_actions = db.Column(db.Text) # JSON格式存储建议行动
confidence_level = db.Column(db.String(20), default='medium') # low, medium, high
status = db.Column(db.String(20), default='pending') # pending, reviewed, approved
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=get_utc_now)
# 决策指令表
class DecisionOrder(db.Model):
id = db.Column(db.Integer, primary_key=True)
analysis_id = db.Column(db.Integer, db.ForeignKey('analysis_result.id'))
order_type = db.Column(db.String(50), nullable=False) # reconnaissance, analysis, execution
target = db.Column(db.String(200), nullable=False)
objective = db.Column(db.Text, nullable=False)
instructions = db.Column(db.Text, nullable=False)
priority = db.Column(db.String(20), default='medium')
deadline = db.Column(db.DateTime)
status = db.Column(db.String(20), default='pending') # pending, executing, completed, failed
assigned_to = db.Column(db.Integer, db.ForeignKey('user.id'))
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=get_utc_now)
updated_at = db.Column(db.DateTime, default=get_utc_now, onupdate=get_utc_now)
# 执行结果表
class ExecutionResult(db.Model):
id = db.Column(db.Integer, primary_key=True)
order_id = db.Column(db.Integer, db.ForeignKey('decision_order.id'))
result_type = db.Column(db.String(50), nullable=False) # success, partial, failed
description = db.Column(db.Text, nullable=False)
evidence = db.Column(db.Text) # 执行证据或截图
image_path = db.Column(db.String(200)) # 上传图片的文件路径
impact_assessment = db.Column(db.Text)
lessons_learned = db.Column(db.Text)
status = db.Column(db.String(20), default='pending') # pending, reviewed
created_by = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.DateTime, default=get_utc_now)
# 系统日志表
class SystemLog(db.Model):
id = db.Column(db.Integer, primary_key=True)
timestamp = db.Column(db.DateTime, default=get_utc_now)
level = db.Column(db.String(20), nullable=False)
message = db.Column(db.Text, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
action_type = db.Column(db.String(50)) # recon, analysis, decision, execution
# 啟動後台會話清理線程(必須在模型定義之後)
cleanup_thread = threading.Thread(target=session_cleanup_worker, daemon=True)
cleanup_thread.start()
# 表单类
class LoginForm(FlaskForm):
username = StringField('用户名', validators=[DataRequired()])
password = PasswordField('密码', validators=[DataRequired()])
submit = SubmitField('登录')
class ReconDataForm(FlaskForm):
title = StringField('侦察标题', validators=[DataRequired(), Length(min=1, max=200)])
target_system = StringField('目标系统', validators=[DataRequired(), Length(min=1, max=100)])
data_type = SelectField('数据类型', choices=[
('network', '网络信息'),
('system', '系统信息'),
('vulnerability', '漏洞信息'),
('user', '用户信息'),
('service', '服务信息'),
('other', '其他')
])
content = TextAreaField('侦察内容', validators=[DataRequired()])
priority = SelectField('优先级', choices=[
('low', '低'),
('medium', '中'),
('high', '高'),
('critical', '紧急')
])
submit = SubmitField('提交侦察数据')
class AnalysisForm(FlaskForm):
analysis_type = SelectField('分析类型', choices=[
('threat', '威胁分析'),
('vulnerability', '漏洞分析'),
('opportunity', '机会分析'),
('comprehensive', '综合分析')
])
findings = TextAreaField('分析发现', validators=[DataRequired()])
recommendations = TextAreaField('建议措施', validators=[DataRequired()])
priority_targets = TextAreaField('优先目标')
suggested_actions = TextAreaField('建议行动')
confidence_level = SelectField('置信度', choices=[
('low', '低'),
('medium', '中'),
('high', '高')
])
submit = SubmitField('提交分析结果')
class DecisionForm(FlaskForm):
order_type = SelectField('指令类型', choices=[
('reconnaissance', '侦察指令'),
('analysis', '分析指令'),
('execution', '执行指令')
])
target = StringField('目标', validators=[DataRequired(), Length(min=1, max=200)])
objective = TextAreaField('目标描述', validators=[DataRequired()])
instructions = TextAreaField('具体指令', validators=[DataRequired()])
priority = SelectField('优先级', choices=[
('low', '低'),
('medium', '中'),
('high', '高'),
('critical', '紧急')
])
assigned_to = SelectField('分配给', coerce=int)
submit = SubmitField('下达指令')
class ExecutionForm(FlaskForm):
result_type = SelectField('执行结果', choices=[
('success', '成功'),
('partial', '部分成功'),
('failed', '失败')
])
description = TextAreaField('执行描述', validators=[DataRequired()])
evidence = TextAreaField('执行证据')
evidence_image = FileField('上传执行证据图片', validators=[FileAllowed(['jpg', 'jpeg', 'png', 'gif'], '只允许上传图片文件!')])
impact_assessment = TextAreaField('影响评估')
lessons_learned = TextAreaField('经验教训')
submit = SubmitField('提交执行结果')
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
# 辅助函数
def log_system_event(level, message, action_type=None):
log = SystemLog(
level=level,
message=message,
user_id=current_user.id if current_user.is_authenticated else None,
action_type=action_type
)
db.session.add(log)
db.session.commit()
def get_active_role():
return session.get('active_role')
def set_active_role(role_name):
session['active_role'] = role_name
def clear_active_role():
session.pop('active_role', None)
def role_required(role_name):
def decorator(func):
from functools import wraps
@wraps(func)
def wrapper(*args, **kwargs):
if not current_user.is_authenticated:
return redirect(url_for('login'))
active = get_active_role()
if active != role_name:
flash('请先选择并通过该身份的权限验证')
return redirect(url_for('select_role'))
return func(*args, **kwargs)
return wrapper
return decorator
def get_role_dashboard():
"""根据当前已启用的身份返回对应仪表板"""
if not current_user.is_authenticated:
return redirect(url_for('login'))
role = get_active_role()
if not role:
return redirect(url_for('select_role'))
if role == 'recon':
return redirect(url_for('recon_dashboard'))
elif role == 'analyst':
return redirect(url_for('analyst_dashboard'))
elif role == 'decision':
return redirect(url_for('decision_dashboard'))
elif role == 'executor':
return redirect(url_for('executor_dashboard'))
else:
return redirect(url_for('login'))
# 路由
@app.route('/')
def index():
if current_user.is_authenticated:
return get_role_dashboard()
return render_template('index.html')
@app.route('/login', methods=['GET', 'POST'])
def login():
if current_user.is_authenticated:
return get_role_dashboard()
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(username=form.username.data).first()
if user and user.password == form.password.data: # 简化密码验证
# 檢查用戶是否已經登錄
if is_user_already_logged_in(user.id):
# 使舊會話失效
invalidate_user_sessions(user.id)
flash('检测到您的账号在其他地方登录,已自动登出其他设备。', 'warning')
# 創建新的會話
session_token = create_user_session(
user.id,
ip_address=request.remote_addr,
user_agent=request.headers.get('User-Agent')
)
# 更新用戶登錄狀態
user.last_login_at = get_utc_now()
user.is_online = True
login_user(user)
clear_active_role()
# 將會話令牌存儲在Flask session中
session['session_token'] = session_token
db.session.commit()
log_system_event('info', f'用户 {user.username} 登录系统 (IP: {request.remote_addr})', 'login')
return redirect(url_for('select_role'))
flash('用户名或密码错误')
return render_template('login.html', form=form)
@app.route('/logout')
@login_required
def logout():
# 使當前會話失效
session_token = session.get('session_token')
if session_token:
UserSession.query.filter_by(session_token=session_token).update({'is_active': False})
db.session.commit()
# 檢查用戶是否還有其他活躍會話
remaining_sessions = UserSession.query.filter_by(
user_id=current_user.id,
is_active=True
).count()
if remaining_sessions == 0:
User.query.filter_by(id=current_user.id).update({'is_online': False})
db.session.commit()
log_system_event('info', f'用户 {current_user.username} 退出系统', 'logout')
logout_user()
clear_active_role()
session.pop('session_token', None)
return redirect(url_for('index'))
# 管理员路由:查看在线用户
@app.route('/admin/online_users')
@login_required
def admin_online_users():
"""查看在線用戶(僅限決策員)"""
if current_user.role != 'decision':
flash('权限不足', 'error')
return redirect(url_for('index'))
# 获取所有活跃会话
active_sessions = db.session.query(UserSession, User).join(
User, UserSession.user_id == User.id
).filter(
UserSession.is_active == True
).order_by(UserSession.last_activity.desc()).all()
return render_template('admin_online_users.html', active_sessions=active_sessions)
@app.route('/admin/kick_user/<int:user_id>', methods=['POST'])
@login_required
def admin_kick_user(user_id):
"""踢出指定用戶(僅限決策員)"""
if current_user.role != 'decision':
flash('权限不足', 'error')
return redirect(url_for('index'))
try:
# 使指定用戶的所有會話失效
invalidate_user_sessions(user_id)
flash(f'已成功踢出用戶 ID: {user_id}', 'success')
except Exception as e:
flash(f'踢出用戶失敗: {str(e)}', 'error')
return redirect(url_for('admin_online_users'))
@app.before_request
def update_session_activity():
"""在每個請求前更新會話活動時間"""
if current_user.is_authenticated:
session_token = session.get('session_token')
if session_token:
# 檢查會話是否有效
user_session = UserSession.query.filter_by(
session_token=session_token,
is_active=True
).first()
if not user_session:
# 會話無效,強制登出
logout_user()
clear_active_role()
session.pop('session_token', None)
flash('您的会话已过期,请重新登录。', 'warning')
return redirect(url_for('login'))
else:
# 更新會話活動時間
user_session.last_activity = get_utc_now()
db.session.commit()
@app.context_processor
def inject_active_role():
return {'active_role': get_active_role()}
@app.route('/select_role', methods=['GET', 'POST'])
@login_required
def select_role():
if request.method == 'POST':
selected_role = request.form.get('role')
role_password = request.form.get('role_password')
if selected_role not in ['recon', 'analyst', 'decision', 'executor']:
flash('身份选择无效')
return redirect(url_for('select_role'))
# 二次权限验证(再次输入账号密码)
if not role_password or current_user.password != role_password:
flash('身份验证失败,请输入正确的密码以启用该身份')
return redirect(url_for('select_role'))
# 放宽:所有用户均可启用四种身份
set_active_role(selected_role)
log_system_event('info', f"用户 {current_user.username} 启用身份: {selected_role}", selected_role)
return get_role_dashboard()
return render_template('select_role.html')
# 侦察员页面
@app.route('/recon')
@login_required
@role_required('recon')
def recon_dashboard():
# 获取用户提交的侦察数据
recon_data = ReconData.query.filter_by(created_by=current_user.id).order_by(ReconData.created_at.desc()).all()
return render_template('recon_dashboard.html', recon_data=recon_data)
@app.route('/recon/add', methods=['GET', 'POST'])
@login_required
@role_required('recon')
def add_recon_data():
form = ReconDataForm()
if form.validate_on_submit():
recon_data = ReconData(
title=form.title.data,
target_system=form.target_system.data,
data_type=form.data_type.data,
content=form.content.data,
priority=form.priority.data,
created_by=current_user.id
)
db.session.add(recon_data)
db.session.commit()
log_system_event('info', f'侦察员 {current_user.username} 提交了新的侦察数据: {form.title.data}', 'recon')
flash('侦察数据提交成功!')
return redirect(url_for('recon_dashboard'))
return render_template('add_recon_data.html', form=form)
# 分析员页面
@app.route('/analyst')
@login_required
@role_required('analyst')
def analyst_dashboard():
# 获取待分析的侦察数据
pending_recon = ReconData.query.filter_by(status='pending').order_by(ReconData.created_at.desc()).all()
# 获取用户的分析结果
analysis_results = AnalysisResult.query.filter_by(created_by=current_user.id).order_by(AnalysisResult.created_at.desc()).all()
return render_template('analyst_dashboard.html', pending_recon=pending_recon, analysis_results=analysis_results)
@app.route('/analyst/analyze/<int:recon_id>', methods=['GET', 'POST'])
@login_required
@role_required('analyst')
def analyze_data(recon_id):
recon_data = ReconData.query.get_or_404(recon_id)
form = AnalysisForm()
if form.validate_on_submit():
analysis = AnalysisResult(
recon_data_id=recon_id,
analysis_type=form.analysis_type.data,
findings=form.findings.data,
recommendations=form.recommendations.data,
priority_targets=form.priority_targets.data,
suggested_actions=form.suggested_actions.data,
confidence_level=form.confidence_level.data,
created_by=current_user.id
)
db.session.add(analysis)
# 更新侦察数据状态
recon_data.status = 'analyzed'
db.session.commit()
log_system_event('info', f'分析员 {current_user.username} 完成了对侦察数据 "{recon_data.title}" 的分析', 'analysis')
flash('分析结果提交成功!')
return redirect(url_for('analyst_dashboard'))
return render_template('analyze_data.html', form=form, recon_data=recon_data)
# 决策员页面
@app.route('/decision')
@login_required
@role_required('decision')
def decision_dashboard():
# 获取待审核的分析结果
pending_analysis = AnalysisResult.query.filter_by(status='pending').order_by(AnalysisResult.created_at.desc()).all()
# 获取用户下达的指令
orders = DecisionOrder.query.filter_by(created_by=current_user.id).order_by(DecisionOrder.created_at.desc()).all()
# 获取执行结果
execution_results = ExecutionResult.query.join(DecisionOrder).filter(DecisionOrder.created_by==current_user.id).order_by(ExecutionResult.created_at.desc()).all()
return render_template('decision_dashboard.html',
pending_analysis=pending_analysis,
orders=orders,
execution_results=execution_results)
@app.route('/decision/create_order', methods=['GET', 'POST'])
@login_required
@role_required('decision')
def create_order():
form = DecisionForm()
# 放寬:所有用戶均可被指派(如需依任務類型細分,之後再調整)
form.assigned_to.choices = [(u.id, f"{u.username}") for u in User.query.all()]
if form.validate_on_submit():
order = DecisionOrder(
order_type=form.order_type.data,
target=form.target.data,
objective=form.objective.data,
instructions=form.instructions.data,
priority=form.priority.data,
assigned_to=form.assigned_to.data,
created_by=current_user.id
)
db.session.add(order)
db.session.commit()
assigned_user = User.query.get(form.assigned_to.data)
log_system_event('info', f'决策员 {current_user.username} 向 {assigned_user.username} 下达了指令: {form.target.data}', 'decision')
flash('指令下达成功!')
return redirect(url_for('decision_dashboard'))
return render_template('create_order.html', form=form)
# 执行员页面
@app.route('/executor')
@login_required
@role_required('executor')
def executor_dashboard():
# 获取分配给当前用户的指令
assigned_orders = DecisionOrder.query.filter_by(assigned_to=current_user.id, status='pending').order_by(DecisionOrder.created_at.desc()).all()
# 获取用户提交的执行结果
execution_results = ExecutionResult.query.filter_by(created_by=current_user.id).order_by(ExecutionResult.created_at.desc()).all()
return render_template('executor_dashboard.html', assigned_orders=assigned_orders, execution_results=execution_results)
@app.route('/executor/execute/<int:order_id>', methods=['GET', 'POST'])
@login_required
@role_required('executor')
def execute_order(order_id):
order = DecisionOrder.query.get_or_404(order_id)
if order.assigned_to != current_user.id:
flash('权限不足')
return redirect(url_for('executor_dashboard'))
form = ExecutionForm()
if form.validate_on_submit():
# 处理图片上传
image_filename = None
if form.evidence_image.data:
image_filename = save_uploaded_file(form.evidence_image.data, order_id, current_user.id)
execution = ExecutionResult(
order_id=order_id,
result_type=form.result_type.data,
description=form.description.data,
evidence=form.evidence.data,
image_path=image_filename,
impact_assessment=form.impact_assessment.data,
lessons_learned=form.lessons_learned.data,
created_by=current_user.id
)
db.session.add(execution)
# 更新指令状态
order.status = 'completed'
db.session.commit()
log_system_event('info', f'执行员 {current_user.username} 完成了指令: {order.target}', 'execution')
flash('执行结果提交成功!')
return redirect(url_for('executor_dashboard'))
return render_template('execute_order.html', form=form, order=order)
# 提供上传的图片文件
@app.route('/uploads/<filename>')
@login_required
def uploaded_file(filename):
"""提供上传的图片文件"""
return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
# 批准分析结果API
@app.route('/api/approve_analysis/<int:analysis_id>', methods=['POST'])
@login_required
@role_required('decision')
def approve_analysis(analysis_id):
analysis = AnalysisResult.query.get_or_404(analysis_id)
analysis.status = 'approved'
db.session.commit()
log_system_event('info', f'决策员 {current_user.username} 批准了分析结果 ID: {analysis_id}', 'decision')
return jsonify({'success': True, 'message': '分析结果已批准'})
# 批量批准分析结果API
@app.route('/api/approve_all_analysis', methods=['POST'])
@login_required
@role_required('decision')
def approve_all_analysis():
pending_analyses = AnalysisResult.query.filter_by(status='pending').all()
count = 0
for analysis in pending_analyses:
analysis.status = 'approved'
count += 1
db.session.commit()
log_system_event('info', f'决策员 {current_user.username} 批量批准了 {count} 个分析结果', 'decision')
return jsonify({'success': True, 'message': f'已批准 {count} 个分析结果'})
# 审核执行结果API
@app.route('/api/review_execution/<int:execution_id>', methods=['POST'])
@login_required
@role_required('decision')
def review_execution(execution_id):
execution = ExecutionResult.query.get_or_404(execution_id)
execution.status = 'reviewed'
db.session.commit()
log_system_event('info', f'决策员 {current_user.username} 审核了执行结果 ID: {execution_id}', 'decision')
return jsonify({'success': True, 'message': '执行结果已审核'})
# 系统日志页面
@app.route('/logs')
@login_required
def logs():
page = request.args.get('page', 1, type=int)
logs = SystemLog.query.order_by(SystemLog.timestamp.desc()).paginate(
page=page, per_page=20, error_out=False)
return render_template('logs.html', logs=logs)
# ---------- 聊天 ----------
@socketio.on("connect")
def chat_connect():
# 必须已登录才能连
if not current_user.is_authenticated:
return False
join_room("main_room")
emit("user_join", {"username": current_user.username}, room="main_room")
@socketio.on("disconnect")
def chat_disconnect():
if current_user.is_authenticated:
leave_room("main_room")
emit("user_left", {"username": current_user.username}, room="main_room")
@socketio.on("send_message")
def chat_message(data):
if not current_user.is_authenticated:
return
msg = ChatMessage(username=current_user.username,
text=data["text"][:500])
db.session.add(msg)
db.session.commit()
# 仅保留最近 100 条
cnt = ChatMessage.query.count()
if cnt > 100:
to_del = (ChatMessage.query.order_by(ChatMessage.timestamp)
.limit(cnt-100).all())
for m in to_del:
db.session.delete(m)
db.session.commit()
emit("new_message",
{"username": current_user.username,
"text": data["text"],
"timestamp": msg.timestamp.strftime("%H:%M:%S")},
room="main_room")
if __name__ == '__main__':
with app.app_context():
db.create_all()
# 创建默认用户
default_users = [
{'username': 'recon1', 'email': 'recon1@example.com', 'password': 'recon123', 'role': 'recon'},
{'username': 'analyst1', 'email': 'analyst1@example.com', 'password': 'analyst123', 'role': 'analyst'},
{'username': 'decision1', 'email': 'decision1@example.com', 'password': 'decision123', 'role': 'decision'},
{'username': 'executor1', 'email': 'executor1@example.com', 'password': 'executor123', 'role': 'executor'},
]
for user_data in default_users:
if not User.query.filter_by(username=user_data['username']).first():
user = User(**user_data)
db.session.add(user)
db.session.commit()
print("默认用户账户已创建:")
print("侦察员: recon1/recon123")
print("分析员: analyst1/analyst123")
print("决策员: decision1/decision123")
print("执行员: executor1/executor123")
socketio.run(app, debug=True, host='0.0.0.0', port=5000)
|
2201_75665698/planX
|
WebSystemWithChat/app.py
|
Python
|
unknown
| 31,428
|
@echo off
chcp 65001 >nul
title 网络信息系统启动器
echo.
echo ========================================
echo 网络信息系统启动器
echo ========================================
echo.
set PYTHONIOENCODING=utf-8
python start.py
pause
|
2201_75665698/planX
|
WebSystemWithChat/start.bat
|
Batchfile
|
unknown
| 259
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
网络信息系统通用启动脚本
Network Information System Universal Launcher
支持Windows、Linux、Mac系统,自动检测环境并启动应用
"""
import os
import sys
import subprocess
import platform
import sqlite3
from pathlib import Path
from datetime import datetime
class NetworkSystemLauncher:
def __init__(self):
self.python_path = None
self.system_info = {
'os': platform.system(),
'release': platform.release(),
'machine': platform.machine(),
'python_version': sys.version
}
def print_banner(self):
"""打印启动横幅"""
print("=" * 60)
print("网络信息系统 - 通用启动器")
print("Network Information System - Universal Launcher")
print("=" * 60)
print(f"操作系统: {self.system_info['os']} {self.system_info['release']}")
print(f"架构: {self.system_info['machine']}")
print(f"Python: {self.system_info['python_version'].split()[0]}")
print("=" * 60)
def find_python_executable(self):
"""自动检测Python可执行文件"""
# 优先使用当前Python解释器
current_python = sys.executable
if current_python and Path(current_python).exists():
self.python_path = current_python
print(f"[OK] 使用当前Python: {current_python}")
return True
# 尝试常见的Python命令
python_commands = ['python3', 'python', 'py']
if self.system_info['os'] == 'Windows':
python_commands = ['python', 'py', 'python3']
for cmd in python_commands:
try:
result = subprocess.run([cmd, '--version'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
self.python_path = cmd
print(f"[OK] 找到Python: {cmd} ({result.stdout.strip()})")
return True
except:
continue
print("[ERROR] 未找到Python安装")
return False
def check_python_version(self):
"""检查Python版本"""
try:
result = subprocess.run([self.python_path, '--version'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
version_str = result.stdout.strip()
# 提取版本号
version_parts = version_str.split()[1].split('.')
major, minor = int(version_parts[0]), int(version_parts[1])
if major >= 3 and minor >= 7:
print(f"[OK] Python版本检查通过: {version_str}")
return True
else:
print(f"[ERROR] Python版本过低: {version_str} (需要3.7+)")
return False
except Exception as e:
print(f"[ERROR] Python版本检查失败: {e}")
return False
def install_dependencies(self):
"""安装依赖包"""
requirements_file = Path("requirements.txt")
if not requirements_file.exists():
print("[ERROR] 错误: 找不到requirements.txt文件")
return False
print("[INFO] 正在安装依赖包...")
try:
# 先升级pip
subprocess.check_call([self.python_path, "-m", "pip", "install", "--upgrade", "pip"],
timeout=300)
# 安装依赖包
subprocess.check_call([self.python_path, "-m", "pip", "install", "-r", "requirements.txt"],
timeout=600)
print("[OK] 依赖包安装完成")
return True
except subprocess.CalledProcessError as e:
print(f"[ERROR] 依赖包安装失败: {e}")
print("\n请尝试手动安装:")
print(f"{self.python_path} -m pip install Flask Flask-SQLAlchemy Flask-Login Flask-WTF Flask-CORS SQLAlchemy WTForms python-dotenv requests psutil schedule")
return False
except subprocess.TimeoutExpired:
print("[ERROR] 安装超时,请检查网络连接")
return False
def initialize_database(self):
"""初始化数据库"""
# 确保 instance 目录存在
instance_dir = Path("instance")
instance_dir.mkdir(exist_ok=True)
db_path = instance_dir / "network_system.db"
print("[INFO] 正在初始化数据库...")
# 如果数据库文件已存在,先备份
if db_path.exists():
backup_path = instance_dir / f"network_system_backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}.db"
try:
db_path.rename(backup_path)
print(f"[OK] 已备份现有数据库到: {backup_path}")
except Exception as e:
print(f"[WARNING] 备份数据库失败: {e}")
try:
# 创建数据库连接
conn = sqlite3.connect(str(db_path))
cursor = conn.cursor()
# 创建用户表
cursor.execute('''
CREATE TABLE IF NOT EXISTS user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(80) UNIQUE NOT NULL,
email VARCHAR(120) UNIQUE NOT NULL,
password VARCHAR(120) NOT NULL,
role VARCHAR(20) DEFAULT 'recon',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
last_login_at DATETIME,
is_online BOOLEAN DEFAULT 0
)
''')
# 创建用户会话表
cursor.execute('''
CREATE TABLE IF NOT EXISTS user_session (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
session_token VARCHAR(255) UNIQUE NOT NULL,
login_time DATETIME DEFAULT CURRENT_TIMESTAMP,
last_activity DATETIME DEFAULT CURRENT_TIMESTAMP,
ip_address VARCHAR(45),
user_agent TEXT,
is_active BOOLEAN DEFAULT 1,
FOREIGN KEY (user_id) REFERENCES user (id)
)
''')
# 创建聊天消息表
cursor.execute('''
CREATE TABLE IF NOT EXISTS chat_message (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(80) NOT NULL,
text TEXT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
)
''')
# 创建侦察数据表
cursor.execute('''
CREATE TABLE IF NOT EXISTS recon_data (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title VARCHAR(200) NOT NULL,
target_system VARCHAR(100) NOT NULL,
data_type VARCHAR(50) NOT NULL,
content TEXT NOT NULL,
priority VARCHAR(20) DEFAULT 'medium',
status VARCHAR(20) DEFAULT 'pending',
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建分析结果表
cursor.execute('''
CREATE TABLE IF NOT EXISTS analysis_result (
id INTEGER PRIMARY KEY AUTOINCREMENT,
recon_data_id INTEGER,
analysis_type VARCHAR(50) NOT NULL,
findings TEXT NOT NULL,
recommendations TEXT NOT NULL,
priority_targets TEXT,
suggested_actions TEXT,
confidence_level VARCHAR(20) DEFAULT 'medium',
status VARCHAR(20) DEFAULT 'pending',
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (recon_data_id) REFERENCES recon_data (id),
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建决策指令表
cursor.execute('''
CREATE TABLE IF NOT EXISTS decision_order (
id INTEGER PRIMARY KEY AUTOINCREMENT,
analysis_id INTEGER,
order_type VARCHAR(50) NOT NULL,
target VARCHAR(200) NOT NULL,
objective TEXT NOT NULL,
instructions TEXT NOT NULL,
priority VARCHAR(20) DEFAULT 'medium',
deadline DATETIME,
status VARCHAR(20) DEFAULT 'pending',
assigned_to INTEGER,
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (analysis_id) REFERENCES analysis_result (id),
FOREIGN KEY (assigned_to) REFERENCES user (id),
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建执行结果表
cursor.execute('''
CREATE TABLE IF NOT EXISTS execution_result (
id INTEGER PRIMARY KEY AUTOINCREMENT,
order_id INTEGER,
result_type VARCHAR(50) NOT NULL,
description TEXT NOT NULL,
evidence TEXT,
impact_assessment TEXT,
lessons_learned TEXT,
status VARCHAR(20) DEFAULT 'pending',
created_by INTEGER,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (order_id) REFERENCES decision_order (id),
FOREIGN KEY (created_by) REFERENCES user (id)
)
''')
# 创建系统日志表
cursor.execute('''
CREATE TABLE IF NOT EXISTS system_log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
level VARCHAR(20) NOT NULL,
message TEXT NOT NULL,
user_id INTEGER,
action_type VARCHAR(50),
FOREIGN KEY (user_id) REFERENCES user (id)
)
''')
# 创建默认用户
default_users = [
# ('recon1', 'recon1@example.com', 'recon123', 'recon'),
# ('analyst1', 'analyst1@example.com', 'analyst123', 'analyst'),
# ('decision1', 'decision1@example.com', 'decision123', 'decision'),
# ('executor1', 'executor1@example.com', 'executor123', 'executor'),
('lyh', 'lyh@example.com', 'lyh', 'recon'),
('xcw', 'xcw@example.com', 'xcw', 'recon'),
('gjh', 'gjh@example.com', 'gjh', 'recon'),
('shx', 'shx@example.com', 'shx', 'recon'),
('zzj', 'zzj@example.com', 'zzj', 'recon'),
]
for username, email, password, role in default_users:
cursor.execute('''
INSERT OR IGNORE INTO user (username, email, password, role)
VALUES (?, ?, ?, ?)
''', (username, email, password, role))
# 提交更改
conn.commit()
conn.close()
print("[OK] 数据库初始化成功")
print("[OK] 默认用户账户已创建:")
# print(" 侦察员: recon1 / recon123")
# print(" 分析员: analyst1 / analyst123")
# print(" 决策员: decision1 / decision123")
# print(" 执行员: executor1 / executor123")
# 设置文件权限(Unix系统)
if os.name != 'nt': # 非Windows系统
try:
os.chmod(db_path, 0o664)
print("[OK] 数据库文件权限设置完成")
except Exception as e:
print(f"[WARNING] 权限设置失败: {e}")
return True
except Exception as e:
print(f"[ERROR] 数据库初始化失败: {e}")
return False
def test_database(self):
"""测试数据库连接"""
try:
conn = sqlite3.connect("instance/network_system.db")
cursor = conn.cursor()
cursor.execute("SELECT COUNT(*) FROM user")
user_count = cursor.fetchone()[0]
conn.close()
print(f"[OK] 数据库连接测试成功,用户数量: {user_count}")
return True
except Exception as e:
print(f"[ERROR] 数据库连接测试失败: {e}")
return False
def start_application(self):
"""启动应用程序"""
print("\n[INFO] 正在启动网络信息系统...")
print("=" * 50)
print("系统信息:")
print("- 访问地址: http://localhost:5000")
print("- 默认账户: admin / admin123")
print("- 按 Ctrl+C 停止服务")
print("=" * 50)
try:
# 检查app.py是否存在
if not Path("app.py").exists():
print("[ERROR] 找不到应用程序文件: app.py")
return False
# 启动应用程序
subprocess.run([self.python_path, "app.py"])
return True
except KeyboardInterrupt:
print("\n[INFO] 系统已停止")
return True
except FileNotFoundError:
print(f"[ERROR] 找不到应用程序文件: app.py")
return False
except Exception as e:
print(f"[ERROR] 启动失败: {e}")
return False
def run(self):
"""运行启动器"""
self.print_banner()
# 1. 检测Python环境
if not self.find_python_executable():
self.print_install_instructions()
return False
# 2. 检查Python版本
if not self.check_python_version():
return False
# 3. 安装依赖
if not self.install_dependencies():
return False
# 4. 初始化数据库
if not self.initialize_database():
return False
# 5. 测试数据库
if not self.test_database():
return False
# 6. 启动应用
return self.start_application()
def print_install_instructions(self):
"""打印安装说明"""
print("\n📋 Python安装说明:")
print("=" * 40)
if self.system_info['os'] == 'Windows':
print("Windows系统:")
print("1. 访问 https://www.python.org/downloads/")
print("2. 下载Python 3.7或更高版本")
print("3. 安装时勾选 'Add Python to PATH'")
print("4. 重新运行此脚本")
elif self.system_info['os'] == 'Darwin': # macOS
print("macOS系统:")
print("1. 使用Homebrew: brew install python3")
print("2. 或访问 https://www.python.org/downloads/")
print("3. 重新运行此脚本")
else: # Linux
print("Linux系统:")
print("Ubuntu/Debian: sudo apt install python3 python3-pip")
print("CentOS/RHEL: sudo yum install python3 python3-pip")
print("Arch Linux: sudo pacman -S python python-pip")
print("重新运行此脚本")
def main():
"""主函数"""
launcher = NetworkSystemLauncher()
success = launcher.run()
if not success:
print("\n[ERROR] 启动失败,请检查错误信息")
input("按回车键退出...")
sys.exit(1)
if __name__ == "__main__":
main()
|
2201_75665698/planX
|
WebSystemWithChat/start.py
|
Python
|
unknown
| 16,615
|
#!/bin/bash
# 网络信息系统启动器
# Network Information System Launcher
echo "========================================"
echo " 网络信息系统启动器"
echo "========================================"
echo
python3 start.py
|
2201_75665698/planX
|
WebSystemWithChat/start.sh
|
Shell
|
unknown
| 246
|
.chat-panel{
position: sticky;
top: 20px;
height: calc(100vh - 120px);
display: flex;
flex-direction: column;
background: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,.15);
}
.chat-header{
padding: 10px 15px;
background: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
color: #fff; font-size: 14px; font-weight: 600;
}
.chat-messages{
flex: 1; overflow-y: auto; padding: 10px;
}
.chat-input-group{
display: flex; padding: 10px; gap: 6px;
}
.chat-msg{
margin-bottom: 8px; font-size: 13px; line-height: 1.4;
}
.chat-msg .chat-user{
font-weight: 600; color:#667eea;
}
.chat-msg .chat-time{
font-size: 11px; color:#999; margin-left: 4px;
}
|
2201_75665698/planX
|
WebSystemWithChat/static/css/chat.css
|
CSS
|
unknown
| 682
|
const socket = io();
const msgBox = document.getElementById("chat-messages");
const input = document.getElementById("chatInput");
const btnSend = document.getElementById("chatSend");
function appendMsg(data){
const div = document.createElement("div");
div.className = "chat-msg";
div.innerHTML = `<span class="chat-user">${data.username}</span>
<span class="chat-time">${data.timestamp}</span>
<div>${data.text}</div>`;
msgBox.appendChild(div);
msgBox.scrollTop = msgBox.scrollHeight;
}
// 接收消息
socket.on("new_message", appendMsg);
socket.on("user_join", d=>{
appendMsg({username:"系统",text:`${d.username} 加入群聊`,timestamp:""});
});
socket.on("user_left", d=>{
appendMsg({username:"系统",text:`${d.username} 离开群聊`,timestamp:""});
});
// 发送消息
function sendMsg(){
const txt = input.value.trim();
if(!txt) return;
socket.emit("send_message",{text:txt});
input.value="";
}
input.addEventListener("keydown", e=>{ if(e.key==="Enter") sendMsg(); });
btnSend.addEventListener("click", sendMsg);
|
2201_75665698/planX
|
WebSystemWithChat/static/js/chat.js
|
JavaScript
|
unknown
| 1,085
|
/* 自定义样式 */
.sidebar {
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.main-content {
background-color: #f8f9fa;
min-height: 100vh;
}
.card {
border: none;
border-radius: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}
.status-online {
color: #28a745;
}
.status-offline {
color: #dc3545;
}
.status-unknown {
color: #6c757d;
}
.navbar-brand {
font-weight: bold;
color: white !important;
}
.nav-link {
color: rgba(255, 255, 255, 0.8) !important;
transition: color 0.3s;
border-radius: 5px;
margin: 2px 0;
}
.nav-link:hover {
color: white !important;
background-color: rgba(255, 255, 255, 0.1);
}
.nav-link.active {
color: white !important;
background-color: rgba(255, 255, 255, 0.2);
}
.log-container {
max-height: 400px;
overflow-y: auto;
}
.log-container::-webkit-scrollbar {
width: 6px;
}
.log-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
.log-container::-webkit-scrollbar-thumb {
background: #888;
border-radius: 3px;
}
.log-container::-webkit-scrollbar-thumb:hover {
background: #555;
}
.table-hover tbody tr:hover {
background-color: rgba(0, 123, 255, 0.05);
}
.badge {
font-size: 0.75em;
}
.btn-group .btn {
margin-right: 2px;
}
.btn-group .btn:last-child {
margin-right: 0;
}
/* 响应式设计 */
@media (max-width: 768px) {
.sidebar {
min-height: auto;
}
.main-content {
margin-top: 20px;
}
.card {
margin-bottom: 20px;
}
}
/* 动画效果 */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.card {
animation: fadeIn 0.5s ease-out;
}
/* 加载动画 */
.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid rgba(255,255,255,.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* 状态指示器 */
.status-indicator {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 5px;
}
.status-indicator.online {
background-color: #28a745;
box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
}
.status-indicator.offline {
background-color: #dc3545;
box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
}
.status-indicator.unknown {
background-color: #6c757d;
}
/* 图表容器 */
.chart-container {
position: relative;
height: 300px;
width: 100%;
}
/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
/* 状态徽章样式 */
.status-badge {
font-size: 0.75em;
padding: 0.25em 0.5em;
border-radius: 0.25rem;
font-weight: 500;
}
.status-pending {
background-color: #ffc107;
color: #000;
}
.status-reviewed {
background-color: #28a745;
color: #fff;
}
.status-approved {
background-color: #17a2b8;
color: #fff;
}
.priority-badge {
font-size: 0.75em;
padding: 0.25em 0.5em;
border-radius: 0.25rem;
font-weight: 500;
}
.priority-low {
background-color: #6c757d;
color: #fff;
}
.priority-medium {
background-color: #ffc107;
color: #000;
}
.priority-high {
background-color: #fd7e14;
color: #fff;
}
.priority-critical {
background-color: #dc3545;
color: #fff;
}
|
2201_75665698/planX
|
WebSystemWithChat/static/style.css
|
CSS
|
unknown
| 3,902
|
{% extends "base.html" %}
{% block page_title %}添加设备{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h4><i class="fas fa-plus"></i> 添加网络设备</h4>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.name.label(class="form-label") }}
{{ form.name(class="form-control") }}
{% if form.name.errors %}
<div class="text-danger">
{% for error in form.name.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.ip_address.label(class="form-label") }}
{{ form.ip_address(class="form-control", placeholder="例如: 192.168.1.1") }}
{% if form.ip_address.errors %}
<div class="text-danger">
{% for error in form.ip_address.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.device_type.label(class="form-label") }}
{{ form.device_type(class="form-select") }}
{% if form.device_type.errors %}
<div class="text-danger">
{% for error in form.device_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="mb-3">
{{ form.description.label(class="form-label") }}
{{ form.description(class="form-control", rows="3", placeholder="可选:设备的详细描述信息") }}
{% if form.description.errors %}
<div class="text-danger">
{% for error in form.description.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="d-flex justify-content-between">
<a href="{{ url_for('devices') }}" class="btn btn-secondary">
<i class="fas fa-arrow-left"></i> 返回设备列表
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 帮助信息 -->
<div class="card mt-4">
<div class="card-header">
<h5><i class="fas fa-info-circle"></i> 添加设备说明</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6>设备类型说明:</h6>
<ul class="list-unstyled">
<li><i class="fas fa-wifi text-primary"></i> <strong>路由器:</strong>网络路由设备</li>
<li><i class="fas fa-sitemap text-info"></i> <strong>交换机:</strong>网络交换设备</li>
<li><i class="fas fa-server text-success"></i> <strong>服务器:</strong>服务器设备</li>
</ul>
</div>
<div class="col-md-6">
<h6>IP地址格式:</h6>
<ul class="list-unstyled">
<li>• 标准IPv4格式:192.168.1.1</li>
<li>• 确保IP地址在有效范围内</li>
<li>• 系统会自动检查设备连通性</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// IP地址格式验证
document.getElementById('ip_address').addEventListener('input', function(e) {
const ip = e.target.value;
const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (ip && !ipRegex.test(ip)) {
e.target.classList.add('is-invalid');
} else {
e.target.classList.remove('is-invalid');
}
});
// 表单提交前验证
document.querySelector('form').addEventListener('submit', function(e) {
const name = document.getElementById('name').value.trim();
const ip = document.getElementById('ip_address').value.trim();
if (!name || !ip) {
e.preventDefault();
alert('请填写所有必填字段');
return;
}
// 简单的IP格式验证
const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (!ipRegex.test(ip)) {
e.preventDefault();
alert('请输入有效的IP地址格式');
return;
}
});
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/add_device.html
|
HTML
|
unknown
| 6,163
|
{% extends "base.html" %}
{% block title %}提交侦察数据 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-plus"></i> 提交侦察数据
</h4>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="mb-3">
{{ form.title.label(class="form-label") }}
{{ form.title(class="form-control", placeholder="请输入侦察数据的标题") }}
{% if form.title.errors %}
<div class="text-danger">
{% for error in form.title.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="mb-3">
{{ form.target_system.label(class="form-label") }}
{{ form.target_system(class="form-control", placeholder="请输入目标系统名称或IP地址") }}
{% if form.target_system.errors %}
<div class="text-danger">
{% for error in form.target_system.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.data_type.label(class="form-label") }}
{{ form.data_type(class="form-select") }}
{% if form.data_type.errors %}
<div class="text-danger">
{% for error in form.data_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.priority.label(class="form-label") }}
{{ form.priority(class="form-select") }}
{% if form.priority.errors %}
<div class="text-danger">
{% for error in form.priority.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.content.label(class="form-label") }}
{{ form.content(class="form-control", rows="8", placeholder="请详细描述侦察到的信息内容...") }}
{% if form.content.errors %}
<div class="text-danger">
{% for error in form.content.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请详细描述侦察到的信息,包括但不限于:系统配置、网络拓扑、漏洞信息、用户行为等
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('recon_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 填写提示 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-lightbulb"></i> 填写提示
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6><i class="fas fa-check-circle text-success"></i> 好的侦察数据应该包含:</h6>
<ul class="list-unstyled">
<li><i class="fas fa-arrow-right text-primary"></i> 明确的目标系统信息</li>
<li><i class="fas fa-arrow-right text-primary"></i> 详细的侦察内容描述</li>
<li><i class="fas fa-arrow-right text-primary"></i> 准确的数据类型分类</li>
<li><i class="fas fa-arrow-right text-primary"></i> 合理的优先级评估</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-exclamation-triangle text-warning"></i> 注意事项:</h6>
<ul class="list-unstyled">
<li><i class="fas fa-arrow-right text-warning"></i> 确保信息的准确性和完整性</li>
<li><i class="fas fa-arrow-right text-warning"></i> 避免包含敏感的个人信息</li>
<li><i class="fas fa-arrow-right text-warning"></i> 按照实际威胁程度设置优先级</li>
<li><i class="fas fa-arrow-right text-warning"></i> 提交后数据将进入分析流程</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/add_recon_data.html
|
HTML
|
unknown
| 6,497
|
{% extends "base.html" %}
{% block title %}在线用户管理 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-0">
<i class="fas fa-users"></i> 在线用户管理
</h5>
<div>
<a href="{{ url_for('decision_dashboard') }}" class="btn btn-secondary btn-sm">
<i class="fas fa-arrow-left"></i> 返回工作台
</a>
<button class="btn btn-primary btn-sm" onclick="location.reload()">
<i class="fas fa-sync-alt"></i> 刷新
</button>
</div>
</div>
</div>
<div class="card-body">
{% if active_sessions %}
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> 当前共有 <strong>{{ active_sessions|length }}</strong> 个活跃会话
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>会话ID</th>
<th>用户名</th>
<th>邮箱</th>
<th>角色</th>
<th>登录时间</th>
<th>最后活动</th>
<th>IP地址</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for session, user in active_sessions %}
<tr>
<td><code>{{ session.id }}</code></td>
<td>
<i class="fas fa-user"></i> {{ user.username }}
{% if user.id == current_user.id %}
<span class="badge bg-primary">当前用户</span>
{% endif %}
</td>
<td>{{ user.email }}</td>
<td>
<span class="role-badge {{ user.role }}-badge">
{% if user.role == 'recon' %}侦察员
{% elif user.role == 'analyst' %}分析员
{% elif user.role == 'decision' %}决策员
{% elif user.role == 'executor' %}执行员
{% else %}{{ user.role }}
{% endif %}
</span>
</td>
<td>
<small>{{ session.login_time.strftime('%Y-%m-%d %H:%M:%S') if session.login_time else 'N/A' }}</small>
</td>
<td>
<small>{{ session.last_activity.strftime('%Y-%m-%d %H:%M:%S') if session.last_activity else 'N/A' }}</small>
</td>
<td>
<small><i class="fas fa-network-wired"></i> {{ session.ip_address or 'N/A' }}</small>
</td>
<td>
{% if session.is_active %}
<span class="badge bg-success">
<i class="fas fa-circle"></i> 在线
</span>
{% else %}
<span class="badge bg-secondary">
<i class="fas fa-circle"></i> 离线
</span>
{% endif %}
</td>
<td>
{% if user.id != current_user.id %}
<button class="btn btn-danger btn-sm"
onclick="kickUser({{ user.id }}, '{{ user.username }}')"
title="踢出用户">
<i class="fas fa-sign-out-alt"></i> 踢出
</button>
{% else %}
<button class="btn btn-secondary btn-sm" disabled title="不能踢出自己">
<i class="fas fa-ban"></i> 自己
</button>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="alert alert-warning">
<i class="fas fa-exclamation-triangle"></i> 当前没有活跃的用户会话
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 踢出用户确认模态框 -->
<div class="modal fade" id="kickUserModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-danger text-white">
<h5 class="modal-title">
<i class="fas fa-exclamation-triangle"></i> 确认踢出用户
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<p>您确定要踢出用户 <strong id="kickUsername"></strong> 吗?</p>
<p class="text-muted">该用户的所有活跃会话将被终止,需要重新登录。</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
<form id="kickUserForm" method="POST" style="display: inline;">
<button type="submit" class="btn btn-danger">
<i class="fas fa-sign-out-alt"></i> 确认踢出
</button>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
function kickUser(userId, username) {
// 设置模态框内容
document.getElementById('kickUsername').textContent = username;
document.getElementById('kickUserForm').action = '/admin/kick_user/' + userId;
// 显示模态框
var modal = new bootstrap.Modal(document.getElementById('kickUserModal'));
modal.show();
}
// 自动刷新(可选)
// setInterval(function() {
// location.reload();
// }, 30000); // 每30秒刷新一次
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/admin_online_users.html
|
HTML
|
unknown
| 7,513
|
{% extends "base.html" %}
{% block title %}分析员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<!-- 待分析数据 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-clock"></i> 待分析数据
<span class="badge bg-warning ms-2">{{ pending_recon|length }}</span>
</h5>
</div>
<div class="card-body">
{% if pending_recon %}
{% for data in pending_recon %}
<div class="card mb-3 border-warning">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-search"></i> {{ data.title }}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>目标:</strong> {{ data.target_system }} |
<strong>类型:</strong>
{% if data.data_type == 'network' %}网络信息
{% elif data.data_type == 'system' %}系统信息
{% elif data.data_type == 'vulnerability' %}漏洞信息
{% elif data.data_type == 'user' %}用户信息
{% elif data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %} |
<strong>优先级:</strong>
<span class="priority-badge priority-{{ data.priority }}">
{% if data.priority == 'low' %}低
{% elif data.priority == 'medium' %}中
{% elif data.priority == 'high' %}高
{% elif data.priority == 'critical' %}紧急
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ data.content[:100] }}{% if data.content|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ data.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<a href="{{ url_for('analyze_data', recon_id=data.id) }}"
class="btn btn-sm btn-primary">
<i class="fas fa-chart-line"></i> 开始分析
</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<p class="text-muted mb-0">暂无待分析数据</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 我的分析结果 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-chart-line"></i> 我的分析结果
<span class="badge bg-info ms-2">{{ analysis_results|length }}</span>
</h5>
</div>
<div class="card-body">
{% if analysis_results %}
{% for result in analysis_results %}
<div class="card mb-3 border-info">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-chart-bar"></i>
{% if result.analysis_type == 'threat' %}威胁分析
{% elif result.analysis_type == 'vulnerability' %}漏洞分析
{% elif result.analysis_type == 'opportunity' %}机会分析
{% elif result.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>置信度:</strong>
<span class="badge bg-secondary">
{% if result.confidence_level == 'low' %}低
{% elif result.confidence_level == 'medium' %}中
{% elif result.confidence_level == 'high' %}高
{% endif %}
</span> |
<strong>状态:</strong>
<span class="status-badge status-{{ result.status }}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% elif result.status == 'approved' %}已批准
{% endif %}
</span>
</small>
</p>
<p class="card-text">
<strong>主要发现:</strong><br>
{{ result.findings[:150] }}{% if result.findings|length > 150 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ result.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-info"
data-bs-toggle="modal"
data-bs-target="#viewAnalysisModal{{ result.id }}">
<i class="fas fa-eye"></i> 查看详情
</button>
</div>
</div>
</div>
<!-- 查看分析详情模态框 -->
<div class="modal fade" id="viewAnalysisModal{{ result.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{% if result.analysis_type == 'threat' %}威胁分析
{% elif result.analysis_type == 'vulnerability' %}漏洞分析
{% elif result.analysis_type == 'opportunity' %}机会分析
{% elif result.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>置信度:</strong>
<span class="badge bg-secondary">
{% if result.confidence_level == 'low' %}低
{% elif result.confidence_level == 'medium' %}中
{% elif result.confidence_level == 'high' %}高
{% endif %}
</span>
</p>
</div>
<div class="col-md-6">
<p><strong>状态:</strong>
<span class="status-badge status-{{ result.status }}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% elif result.status == 'approved' %}已批准
{% endif %}
</span>
</p>
</div>
</div>
<h6>分析发现:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.findings }}</pre>
</div>
<h6>建议措施:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.recommendations }}</pre>
</div>
{% if result.priority_targets %}
<h6>优先目标:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.priority_targets }}</pre>
</div>
{% endif %}
{% if result.suggested_actions %}
<h6>建议行动:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.suggested_actions }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-chart-line fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无分析结果</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 工作流程说明 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 分析员工作流程
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-search fa-2x text-primary mb-2"></i>
<h6>接收数据</h6>
<small class="text-muted">接收侦察员提交的侦察数据</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-chart-line fa-2x text-info mb-2"></i>
<h6>深度分析</h6>
<small class="text-muted">对数据进行威胁、漏洞或机会分析</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-lightbulb fa-2x text-warning mb-2"></i>
<h6>提供建议</h6>
<small class="text-muted">基于分析结果提供行动建议</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-paper-plane fa-2x text-success mb-2"></i>
<h6>提交结果</h6>
<small class="text-muted">将分析结果提交给决策员审核</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/analyst_dashboard.html
|
HTML
|
unknown
| 13,897
|
{% extends "base.html" %}
{% block title %}分析侦察数据 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-4">
<!-- 侦察数据信息 -->
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-search"></i> 侦察数据信息
</h6>
</div>
<div class="card-body">
<h6>{{ recon_data.title }}</h6>
<p><strong>目标系统:</strong> {{ recon_data.target_system }}</p>
<p><strong>数据类型:</strong>
{% if recon_data.data_type == 'network' %}网络信息
{% elif recon_data.data_type == 'system' %}系统信息
{% elif recon_data.data_type == 'vulnerability' %}漏洞信息
{% elif recon_data.data_type == 'user' %}用户信息
{% elif recon_data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %}
</p>
<p><strong>优先级:</strong>
<span class="priority-badge priority-{{ recon_data.priority }}">
{% if recon_data.priority == 'low' %}低
{% elif recon_data.priority == 'medium' %}中
{% elif recon_data.priority == 'high' %}高
{% elif recon_data.priority == 'critical' %}紧急
{% endif %}
</span>
</p>
<p><strong>提交时间:</strong> {{ recon_data.created_at.strftime('%Y-%m-%d %H:%M') }}</p>
</div>
</div>
<!-- 侦察内容 -->
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-file-text"></i> 侦察内容
</h6>
</div>
<div class="card-body">
<div class="bg-light p-3 rounded" style="max-height: 300px; overflow-y: auto;">
<pre style="white-space: pre-wrap; margin: 0; font-size: 0.9rem;">{{ recon_data.content }}</pre>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<!-- 分析表单 -->
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-chart-line"></i> 数据分析
</h5>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.analysis_type.label(class="form-label") }}
{{ form.analysis_type(class="form-select") }}
{% if form.analysis_type.errors %}
<div class="text-danger">
{% for error in form.analysis_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.confidence_level.label(class="form-label") }}
{{ form.confidence_level(class="form-select") }}
{% if form.confidence_level.errors %}
<div class="text-danger">
{% for error in form.confidence_level.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.findings.label(class="form-label") }}
{{ form.findings(class="form-control", rows="6", placeholder="请详细描述分析发现...") }}
{% if form.findings.errors %}
<div class="text-danger">
{% for error in form.findings.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请详细描述通过分析发现的关键信息、威胁、漏洞或机会
</div>
</div>
<div class="mb-3">
{{ form.recommendations.label(class="form-label") }}
{{ form.recommendations(class="form-control", rows="5", placeholder="请提供具体的建议措施...") }}
{% if form.recommendations.errors %}
<div class="text-danger">
{% for error in form.recommendations.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
基于分析结果,提供具体的建议措施和应对策略
</div>
</div>
<div class="mb-3">
{{ form.priority_targets.label(class="form-label") }}
{{ form.priority_targets(class="form-control", rows="3", placeholder="请列出优先处理的目标...") }}
{% if form.priority_targets.errors %}
<div class="text-danger">
{% for error in form.priority_targets.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
列出需要优先处理的目标或系统(可选)
</div>
</div>
<div class="mb-3">
{{ form.suggested_actions.label(class="form-label") }}
{{ form.suggested_actions(class="form-control", rows="3", placeholder="请提供建议的行动方案...") }}
{% if form.suggested_actions.errors %}
<div class="text-danger">
{% for error in form.suggested_actions.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
提供具体的行动建议和实施方案(可选)
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('analyst_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 分析指导 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-lightbulb"></i> 分析指导
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6><i class="fas fa-exclamation-triangle text-danger"></i> 威胁分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 识别潜在的安全威胁</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估威胁的影响范围</li>
<li><i class="fas fa-arrow-right text-primary"></i> 分析威胁的利用可能性</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供防护建议</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-bug text-warning"></i> 漏洞分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 识别系统安全漏洞</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估漏洞的严重程度</li>
<li><i class="fas fa-arrow-right text-primary"></i> 分析漏洞的利用条件</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供修复建议</li>
</ul>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<h6><i class="fas fa-star text-success"></i> 机会分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 识别可利用的机会</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估机会的价值</li>
<li><i class="fas fa-arrow-right text-primary"></i> 分析实现条件</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供行动建议</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-chart-pie text-info"></i> 综合分析要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 多维度综合分析</li>
<li><i class="fas fa-arrow-right text-primary"></i> 识别关键风险点</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供整体策略建议</li>
<li><i class="fas fa-arrow-right text-primary"></i> 制定优先级排序</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/analyze_data.html
|
HTML
|
unknown
| 11,448
|
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}协同调度信息系统{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
:root {
--primary-color: #667eea;
--secondary-color: #764ba2;
--success-color: #28a745;
--info-color: #17a2b8;
--warning-color: #ffc107;
--danger-color: #dc3545;
}
body {
background-color: #f8f9fa;
}
.navbar {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-brand {
font-weight: 700;
font-size: 1.5rem;
}
.role-badge {
font-size: 0.8rem;
padding: 4px 8px;
border-radius: 15px;
}
.recon-badge { background-color: var(--success-color); }
.analyst-badge { background-color: var(--info-color); }
.decision-badge { background-color: var(--warning-color); color: #333; }
.executor-badge { background-color: var(--danger-color); }
.main-content {
margin-top: 20px;
}
.card {
border: none;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.08);
transition: transform 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
}
/* 防止模态框闪烁 - 彻底修复 */
.modal {
transition: none !important;
}
.modal-dialog {
transition: none !important;
}
.modal-content {
transition: none !important;
}
.modal-backdrop {
transition: none !important;
}
/* 当模态框打开时,禁用所有悬停效果 */
body.modal-open .card:hover {
transform: none !important;
}
body.modal-open .btn:hover {
transform: none !important;
}
/* 禁用模态框内所有元素的悬停效果 */
.modal .card:hover {
transform: none !important;
}
.modal .btn:hover {
transform: none !important;
}
.card-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
border-radius: 15px 15px 0 0 !important;
border: none;
}
.btn-primary {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
border: none;
border-radius: 10px;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.status-badge {
font-size: 0.75rem;
padding: 4px 8px;
border-radius: 10px;
}
.status-pending { background-color: #ffc107; color: #333; }
.status-analyzed { background-color: #17a2b8; color: white; }
.status-completed { background-color: #28a745; color: white; }
.status-failed { background-color: #dc3545; color: white; }
.priority-badge {
font-size: 0.75rem;
padding: 4px 8px;
border-radius: 10px;
}
.priority-low { background-color: #6c757d; color: white; }
.priority-medium { background-color: #ffc107; color: #333; }
.priority-high { background-color: #fd7e14; color: white; }
.priority-critical { background-color: #dc3545; color: white; }
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark">
<div class="container">
<a class="navbar-brand" href="{{ url_for('index') }}">
<i class="fas fa-shield-alt"></i> 协同调度信息系统
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
{% if current_user.is_authenticated %}
{% if active_role == 'recon' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('recon_dashboard') }}">
<i class="fas fa-search"></i> 侦察工作台
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('add_recon_data') }}">
<i class="fas fa-plus"></i> 提交侦察数据
</a>
</li>
{% elif active_role == 'analyst' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('analyst_dashboard') }}">
<i class="fas fa-chart-line"></i> 分析工作台
</a>
</li>
{% elif active_role == 'decision' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('decision_dashboard') }}">
<i class="fas fa-gavel"></i> 决策工作台
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('create_order') }}">
<i class="fas fa-plus"></i> 下达指令
</a>
</li>
{% elif active_role == 'executor' %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('executor_dashboard') }}">
<i class="fas fa-cogs"></i> 执行工作台
</a>
</li>
{% endif %}
{% endif %}
</ul>
<ul class="navbar-nav">
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logs') }}">
<i class="fas fa-list"></i> 系统日志
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
<i class="fas fa-user"></i> {{ current_user.username }}
{% if active_role %}
<span class="role-badge {{ active_role }}-badge">
{% if active_role == 'recon' %}侦察员
{% elif active_role == 'analyst' %}分析员
{% elif active_role == 'decision' %}决策员
{% elif active_role == 'executor' %}执行员
{% endif %}
</span>
{% endif %}
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="{{ url_for('select_role') }}">
<i class="fas fa-user-shield"></i> 切换身份
</a></li>
<li><a class="dropdown-item" href="{{ url_for('logout') }}">
<i class="fas fa-sign-out-alt"></i> 退出登录
</a></li>
</ul>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('login') }}">
<i class="fas fa-sign-in-alt"></i> 登录
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
<div class="container-fluid main-content">
<div class="row">
<!-- 左侧原有内容 -->
<div class="col-md-9">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-info alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</div>
<!-- 右侧聊天面板 -->
<div class="col-md-3 ps-0">
{% include 'chat_panel.html' %}
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
// 防止模态框闪烁的完整修复
document.addEventListener('DOMContentLoaded', function() {
// 禁用所有模态框的过渡动画
var style = document.createElement('style');
style.textContent = `
.modal, .modal-dialog, .modal-content, .modal-backdrop {
transition: none !important;
animation: none !important;
}
`;
document.head.appendChild(style);
// 监听模态框事件,确保body类正确设置
document.addEventListener('show.bs.modal', function(e) {
document.body.classList.add('modal-open');
});
document.addEventListener('hide.bs.modal', function(e) {
document.body.classList.remove('modal-open');
});
// 防止模态框按钮重复点击
document.querySelectorAll('[data-bs-toggle="modal"]').forEach(function(button) {
button.addEventListener('click', function(e) {
// 防止快速重复点击
if (this.disabled) {
e.preventDefault();
return false;
}
this.disabled = true;
setTimeout(function() {
button.disabled = false;
}, 500);
});
});
});
</script>
{% block extra_js %}{% endblock %}
</body>
</html>
|
2201_75665698/planX
|
WebSystemWithChat/templates/base.html
|
HTML
|
unknown
| 11,667
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/chat.css') }}">
<div id="chat-panel" class="chat-panel">
<div class="chat-header">
<i class="fas fa-comments"></i> 作战群聊
<span id="chat-status" class="float-end"><i class="fas fa-circle text-success"></i></span>
</div>
<div id="chat-messages" class="chat-messages"></div>
<div class="chat-input-group">
<input id="chatInput" type="text" maxlength="500"
placeholder="按 Enter 发送消息..." class="form-control form-control-sm">
<button id="chatSend" class="btn btn-sm btn-primary">发送</button>
</div>
</div>
<script src="https://cdn.socket.io/4.7.2/socket.io.min.js"></script>
<script src="{{ url_for('static', filename='js/chat.js') }}"></script>
|
2201_75665698/planX
|
WebSystemWithChat/templates/chat_panel.html
|
HTML
|
unknown
| 765
|
{% extends "base.html" %}
{% block title %}下达指令 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-plus"></i> 下达新指令
</h4>
</div>
<div class="card-body">
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.order_type.label(class="form-label") }}
{{ form.order_type(class="form-select") }}
{% if form.order_type.errors %}
<div class="text-danger">
{% for error in form.order_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.priority.label(class="form-label") }}
{{ form.priority(class="form-select") }}
{% if form.priority.errors %}
<div class="text-danger">
{% for error in form.priority.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
{{ form.target.label(class="form-label") }}
{{ form.target(class="form-control", placeholder="请输入指令目标") }}
{% if form.target.errors %}
<div class="text-danger">
{% for error in form.target.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
明确指定指令的目标对象,如系统名称、IP地址、人员等
</div>
</div>
<div class="mb-3">
{{ form.objective.label(class="form-label") }}
{{ form.objective(class="form-control", rows="4", placeholder="请描述指令的目标和期望结果...") }}
{% if form.objective.errors %}
<div class="text-danger">
{% for error in form.objective.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
详细描述指令的目标和期望达到的结果
</div>
</div>
<div class="mb-3">
{{ form.instructions.label(class="form-label") }}
{{ form.instructions(class="form-control", rows="6", placeholder="请提供具体的执行指令...") }}
{% if form.instructions.errors %}
<div class="text-danger">
{% for error in form.instructions.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
提供详细的执行步骤和具体要求
</div>
</div>
<div class="mb-3">
{{ form.assigned_to.label(class="form-label") }}
{{ form.assigned_to(class="form-select") }}
{% if form.assigned_to.errors %}
<div class="text-danger">
{% for error in form.assigned_to.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
选择负责执行此指令的人员
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('decision_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 指令类型说明 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 指令类型说明
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-search fa-2x text-success mb-2"></i>
<h6>侦察指令</h6>
<small class="text-muted">
下达给侦察员,要求进行信息收集和侦察活动
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-chart-line fa-2x text-info mb-2"></i>
<h6>分析指令</h6>
<small class="text-muted">
下达给分析员,要求对特定数据进行深度分析
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-cogs fa-2x text-danger mb-2"></i>
<h6>执行指令</h6>
<small class="text-muted">
下达给执行员,要求执行具体的行动方案
</small>
</div>
</div>
</div>
</div>
</div>
<!-- 优先级说明 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-exclamation-triangle"></i> 优先级说明
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-low">低</span>
<h6 class="mt-2">低优先级</h6>
<small class="text-muted">常规任务,可在空闲时间处理</small>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-medium">中</span>
<h6 class="mt-2">中优先级</h6>
<small class="text-muted">重要任务,需要及时处理</small>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-high">高</span>
<h6 class="mt-2">高优先级</h6>
<small class="text-muted">紧急任务,需要优先处理</small>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<span class="priority-badge priority-critical">紧急</span>
<h6 class="mt-2">紧急优先级</h6>
<small class="text-muted">最高优先级,立即处理</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/create_order.html
|
HTML
|
unknown
| 9,592
|
{% extends "base.html" %}
{% block page_title %}仪表板{% endblock %}
{% block content %}
<!-- 系统统计卡片 -->
<div class="row mb-4">
<div class="col-md-3">
<div class="card bg-primary text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">总设备数</h6>
<h3>{{ system_stats.total_devices }}</h3>
</div>
<div class="align-self-center">
<i class="fas fa-desktop fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card bg-success text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">在线设备</h6>
<h3>{{ system_stats.online_devices }}</h3>
</div>
<div class="align-self-center">
<i class="fas fa-check-circle fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card bg-info text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">CPU使用率</h6>
<h3>{{ "%.1f"|format(system_stats.cpu_percent) }}%</h3>
</div>
<div class="align-self-center">
<i class="fas fa-microchip fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card bg-warning text-white">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h6 class="card-title">内存使用率</h6>
<h3>{{ "%.1f"|format(system_stats.memory_percent) }}%</h3>
</div>
<div class="align-self-center">
<i class="fas fa-memory fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!-- 设备状态列表 -->
<div class="col-md-8">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h5><i class="fas fa-desktop"></i> 设备状态</h5>
<a href="{{ url_for('add_device') }}" class="btn btn-primary btn-sm">
<i class="fas fa-plus"></i> 添加设备
</a>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>设备名称</th>
<th>IP地址</th>
<th>类型</th>
<th>状态</th>
<th>最后检查</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for device in devices %}
<tr>
<td>{{ device.name }}</td>
<td>{{ device.ip_address }}</td>
<td>
<span class="badge bg-secondary">
{% if device.device_type == 'router' %}路由器
{% elif device.device_type == 'switch' %}交换机
{% elif device.device_type == 'server' %}服务器
{% elif device.device_type == 'workstation' %}工作站
{% elif device.device_type == 'printer' %}打印机
{% else %}其他
{% endif %}
</span>
</td>
<td>
<span class="badge
{% if device.status == 'online' %}bg-success
{% elif device.status == 'offline' %}bg-danger
{% else %}bg-secondary
{% endif %}">
{% if device.status == 'online' %}在线
{% elif device.status == 'offline' %}离线
{% else %}未知
{% endif %}
</span>
</td>
<td>{{ device.last_check.strftime('%H:%M:%S') if device.last_check else '未检查' }}</td>
<td>
<button class="btn btn-sm btn-outline-primary" onclick="checkDevice({{ device.id }})">
<i class="fas fa-sync"></i>
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 系统日志 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-list-alt"></i> 最近日志</h5>
</div>
<div class="card-body">
<div class="log-container" style="max-height: 400px; overflow-y: auto;">
{% for log in recent_logs %}
<div class="mb-2 p-2 border-start border-3
{% if log.level == 'error' %}border-danger
{% elif log.level == 'warning' %}border-warning
{% else %}border-info
{% endif %}">
<small class="text-muted">{{ log.timestamp.strftime('%H:%M:%S') }}</small>
<div class="small">{{ log.message }}</div>
</div>
{% endfor %}
</div>
<div class="text-center mt-3">
<a href="{{ url_for('logs') }}" class="btn btn-outline-primary btn-sm">查看全部日志</a>
</div>
</div>
</div>
</div>
</div>
<!-- 系统性能图表 -->
<div class="row mt-4">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-chart-pie"></i> 系统资源使用率</h5>
</div>
<div class="card-body">
<canvas id="systemChart" width="400" height="200"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-network-wired"></i> 网络流量统计</h5>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-6">
<h6>发送字节</h6>
<h4 class="text-primary">{{ "{:,}".format(system_stats.network_io.bytes_sent) }}</h4>
</div>
<div class="col-6">
<h6>接收字节</h6>
<h4 class="text-success">{{ "{:,}".format(system_stats.network_io.bytes_recv) }}</h4>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// 系统资源图表
const ctx = document.getElementById('systemChart').getContext('2d');
const systemChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['CPU', '内存', '磁盘'],
datasets: [{
data: [
{{ system_stats.cpu_percent }},
{{ system_stats.memory_percent }},
{{ system_stats.disk_percent }}
],
backgroundColor: [
'#007bff',
'#28a745',
'#ffc107'
]
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
// 检查设备状态
function checkDevice(deviceId) {
fetch(`/api/device_status/${deviceId}`)
.then(response => response.json())
.then(data => {
location.reload();
})
.catch(error => {
console.error('Error:', error);
alert('检查设备状态失败');
});
}
// 自动刷新页面数据
setInterval(function() {
fetch('/api/system_stats')
.then(response => response.json())
.then(data => {
// 更新统计卡片
document.querySelector('.card.bg-primary h3').textContent = data.total_devices;
document.querySelector('.card.bg-success h3').textContent = data.online_devices;
document.querySelector('.card.bg-info h3').textContent = data.cpu_percent.toFixed(1) + '%';
document.querySelector('.card.bg-warning h3').textContent = data.memory_percent.toFixed(1) + '%';
// 更新图表
systemChart.data.datasets[0].data = [
data.cpu_percent,
data.memory_percent,
data.disk_percent
];
systemChart.update();
})
.catch(error => console.error('Error:', error));
}, 30000); // 每30秒刷新一次
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/dashboard.html
|
HTML
|
unknown
| 10,182
|
{% extends "base.html" %}
{% block title %}决策员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<!-- 管理功能區域 -->
<div class="row mb-4">
<div class="col-12">
<div class="card bg-light">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div>
<h5 class="mb-1">
<i class="fas fa-user-shield"></i> 决策员工作台
</h5>
<p class="text-muted mb-0">系统管理和监督中心</p>
</div>
<div class="btn-group">
<a href="{{ url_for('admin_online_users') }}" class="btn btn-info">
<i class="fas fa-users"></i> 在线用户管理
</a>
<button class="btn btn-outline-secondary" onclick="refreshDashboard()">
<i class="fas fa-sync-alt"></i> 刷新
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!-- 待审核分析结果 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-clock"></i> 待审核分析
<span class="badge bg-warning ms-2">{{ pending_analysis|length }}</span>
</h6>
</div>
<div class="card-body">
{% if pending_analysis %}
{% for analysis in pending_analysis %}
<div class="card mb-3 border-warning">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-chart-bar"></i>
{% if analysis.analysis_type == 'threat' %}威胁分析
{% elif analysis.analysis_type == 'vulnerability' %}漏洞分析
{% elif analysis.analysis_type == 'opportunity' %}机会分析
{% elif analysis.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>置信度:</strong>
<span class="badge bg-secondary">
{% if analysis.confidence_level == 'low' %}低
{% elif analysis.confidence_level == 'medium' %}中
{% elif analysis.confidence_level == 'high' %}高
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ analysis.findings[:100] }}{% if analysis.findings|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ analysis.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-primary"
data-bs-toggle="modal"
data-bs-target="#viewAnalysisModal{{ analysis.id }}">
<i class="fas fa-eye"></i> 查看
</button>
</div>
</div>
</div>
<!-- 查看分析详情模态框 -->
<div class="modal fade" id="viewAnalysisModal{{ analysis.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{% if analysis.analysis_type == 'threat' %}威胁分析
{% elif analysis.analysis_type == 'vulnerability' %}漏洞分析
{% elif analysis.analysis_type == 'opportunity' %}机会分析
{% elif analysis.analysis_type == 'comprehensive' %}综合分析
{% endif %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>置信度:</strong>
<span class="badge bg-secondary">
{% if analysis.confidence_level == 'low' %}低
{% elif analysis.confidence_level == 'medium' %}中
{% elif analysis.confidence_level == 'high' %}高
{% endif %}
</span>
</p>
</div>
<div class="col-md-6">
<p><strong>分析员:</strong> {{ analysis.created_by }}</p>
</div>
</div>
<h6>分析发现:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.findings }}</pre>
</div>
<h6>建议措施:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.recommendations }}</pre>
</div>
{% if analysis.priority_targets %}
<h6>优先目标:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.priority_targets }}</pre>
</div>
{% endif %}
{% if analysis.suggested_actions %}
<h6>建议行动:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ analysis.suggested_actions }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success"
onclick="approveAnalysis({{ analysis.id }})">
<i class="fas fa-check"></i> 批准
</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<p class="text-muted mb-0">暂无待审核分析</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 我的指令 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-gavel"></i> 我的指令
<span class="badge bg-info ms-2">{{ orders|length }}</span>
</h6>
</div>
<div class="card-body">
{% if orders %}
{% for order in orders %}
<div class="card mb-3 border-info">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-bullhorn"></i> {{ order.target }}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>类型:</strong>
{% if order.order_type == 'reconnaissance' %}侦察指令
{% elif order.order_type == 'analysis' %}分析指令
{% elif order.order_type == 'execution' %}执行指令
{% endif %} |
<strong>优先级:</strong>
<span class="priority-badge priority-{{ order.priority }}">
{% if order.priority == 'low' %}低
{% elif order.priority == 'medium' %}中
{% elif order.priority == 'high' %}高
{% elif order.priority == 'critical' %}紧急
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ order.objective[:80] }}{% if order.objective|length > 80 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ order.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<span class="badge {% if order.status == 'pending' %}bg-warning{% elif order.status == 'executing' %}bg-info{% elif order.status == 'completed' %}bg-success{% elif order.status == 'failed' %}bg-danger{% endif %}">
{% if order.status == 'pending' %}待执行
{% elif order.status == 'executing' %}执行中
{% elif order.status == 'completed' %}已完成
{% elif order.status == 'failed' %}失败
{% endif %}
</span>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-gavel fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无下达指令</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 执行结果 -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-tasks"></i> 执行结果
<span class="badge bg-success ms-2">{{ execution_results|length }}</span>
</h6>
</div>
<div class="card-body">
{% if execution_results %}
{% for result in execution_results %}
<div class="card mb-3 border-success">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-check-circle"></i>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</h6>
<p class="card-text">
{{ result.description[:80] }}{% if result.description|length > 80 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ result.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-success"
data-bs-toggle="modal"
data-bs-target="#viewResultModal{{ result.id }}">
<i class="fas fa-eye"></i> 查看
</button>
</div>
</div>
</div>
<!-- 查看执行结果详情模态框 -->
<div class="modal fade" id="viewResultModal{{ result.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">执行结果详情</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>执行结果:</strong>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</p>
</div>
<div class="col-md-6">
<p><strong>执行员:</strong> {{ result.created_by }}</p>
</div>
</div>
<h6>执行描述:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.description }}</pre>
</div>
{% if result.evidence %}
<h6>执行证据:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.evidence }}</pre>
</div>
{% endif %}
{% if result.image_path %}
<h6>执行证据图片:</h6>
<div class="mb-3">
<img src="{{ url_for('uploaded_file', filename=result.image_path) }}"
class="img-fluid rounded border"
alt="执行证据图片"
style="max-height: 400px; cursor: pointer;"
onclick="showImageModal('{{ url_for('uploaded_file', filename=result.image_path) }}')">
</div>
{% endif %}
{% if result.impact_assessment %}
<h6>影响评估:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.impact_assessment }}</pre>
</div>
{% endif %}
{% if result.lessons_learned %}
<h6>经验教训:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.lessons_learned }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
{% if result.status == 'pending' %}
<button type="button" class="btn btn-success"
onclick="reviewExecution({{ result.id }})">
<i class="fas fa-check"></i> 审核通过
</button>
{% endif %}
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-tasks fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无执行结果</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 快速操作 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-bolt"></i> 快速操作
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<div class="d-grid">
<a href="{{ url_for('create_order') }}" class="btn btn-primary">
<i class="fas fa-plus"></i> 下达新指令
</a>
</div>
</div>
<div class="col-md-3">
<div class="d-grid">
<button class="btn btn-success" onclick="approveAllAnalysis()">
<i class="fas fa-check-double"></i> 批量批准分析
</button>
</div>
</div>
<div class="col-md-3">
<div class="d-grid">
<button class="btn btn-info" onclick="viewSystemStatus()">
<i class="fas fa-chart-pie"></i> 系统状态
</button>
</div>
</div>
<div class="col-md-3">
<div class="d-grid">
<a href="{{ url_for('logs') }}" class="btn btn-secondary">
<i class="fas fa-list"></i> 查看日志
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
function approveAnalysis(analysisId) {
if (confirm('确定要批准这个分析结果吗?')) {
fetch(`/api/approve_analysis/${analysisId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert(data.message);
location.reload();
} else {
alert('批准失败:' + data.message);
}
})
.catch(error => {
console.error('Error:', error);
alert('批准失败,请重试');
});
}
}
function approveAllAnalysis() {
if (confirm('确定要批量批准所有待审核的分析结果吗?')) {
fetch('/api/approve_all_analysis', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert(data.message);
location.reload();
} else {
alert('批量批准失败:' + data.message);
}
})
.catch(error => {
console.error('Error:', error);
alert('批量批准失败,请重试');
});
}
}
function reviewExecution(executionId) {
if (confirm('确定要审核通过这个执行结果吗?')) {
fetch(`/api/review_execution/${executionId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert(data.message);
location.reload();
} else {
alert('审核失败:' + data.message);
}
})
.catch(error => {
console.error('Error:', error);
alert('审核失败,请重试');
});
}
}
function viewSystemStatus() {
alert('系统状态功能开发中...');
}
function refreshDashboard() {
location.reload();
}
function showImageModal(imageSrc) {
document.getElementById('modalImage').src = imageSrc;
var imageModal = new bootstrap.Modal(document.getElementById('imageModal'));
imageModal.show();
}
</script>
<!-- 图片查看模态框 -->
<div class="modal fade" id="imageModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">执行证据图片</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body text-center">
<img id="modalImage" src="" class="img-fluid" alt="执行证据图片">
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/decision_dashboard.html
|
HTML
|
unknown
| 24,231
|
{% extends "base.html" %}
{% block page_title %}设备管理{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="fas fa-desktop"></i> 网络设备管理</h2>
<a href="{{ url_for('add_device') }}" class="btn btn-primary">
<i class="fas fa-plus"></i> 添加设备
</a>
</div>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>设备名称</th>
<th>IP地址</th>
<th>设备类型</th>
<th>状态</th>
<th>最后检查</th>
<th>描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for device in devices %}
<tr>
<td>{{ device.id }}</td>
<td>
<strong>{{ device.name }}</strong>
</td>
<td>
<code>{{ device.ip_address }}</code>
</td>
<td>
<span class="badge bg-secondary">
{% if device.device_type == 'router' %}
<i class="fas fa-wifi"></i> 路由器
{% elif device.device_type == 'switch' %}
<i class="fas fa-sitemap"></i> 交换机
{% elif device.device_type == 'server' %}
<i class="fas fa-server"></i> 服务器
{% elif device.device_type == 'workstation' %}
<i class="fas fa-desktop"></i> 工作站
{% elif device.device_type == 'printer' %}
<i class="fas fa-print"></i> 打印机
{% else %}
<i class="fas fa-cog"></i> 其他
{% endif %}
</span>
</td>
<td>
<span class="badge
{% if device.status == 'online' %}bg-success
{% elif device.status == 'offline' %}bg-danger
{% else %}bg-secondary
{% endif %}">
{% if device.status == 'online' %}
<i class="fas fa-check-circle"></i> 在线
{% elif device.status == 'offline' %}
<i class="fas fa-times-circle"></i> 离线
{% else %}
<i class="fas fa-question-circle"></i> 未知
{% endif %}
</span>
</td>
<td>
{% if device.last_check %}
<small class="text-muted">
{{ device.last_check.strftime('%Y-%m-%d %H:%M:%S') }}
</small>
{% else %}
<small class="text-muted">未检查</small>
{% endif %}
</td>
<td>
{% if device.description %}
<small>{{ device.description[:50] }}{% if device.description|length > 50 %}...{% endif %}</small>
{% else %}
<small class="text-muted">无描述</small>
{% endif %}
</td>
<td>
<div class="btn-group" role="group">
<button class="btn btn-sm btn-outline-primary"
onclick="checkDevice({{ device.id }})"
title="检查状态">
<i class="fas fa-sync"></i>
</button>
<button class="btn btn-sm btn-outline-info"
onclick="showDeviceInfo({{ device.id }})"
title="查看详情">
<i class="fas fa-info"></i>
</button>
<button class="btn btn-sm btn-outline-danger"
onclick="deleteDevice({{ device.id }})"
title="删除设备">
<i class="fas fa-trash"></i>
</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if not devices %}
<div class="text-center py-5">
<i class="fas fa-desktop fa-3x text-muted mb-3"></i>
<h5 class="text-muted">暂无设备</h5>
<p class="text-muted">点击上方"添加设备"按钮开始添加网络设备</p>
</div>
{% endif %}
</div>
</div>
<!-- 设备详情模态框 -->
<div class="modal fade" id="deviceInfoModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">设备详情</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body" id="deviceInfoContent">
<!-- 设备信息将在这里动态加载 -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// 检查设备状态
function checkDevice(deviceId) {
const button = event.target.closest('button');
const icon = button.querySelector('i');
// 显示加载状态
icon.className = 'fas fa-spinner fa-spin';
button.disabled = true;
fetch(`/api/device_status/${deviceId}`)
.then(response => response.json())
.then(data => {
// 恢复按钮状态
icon.className = 'fas fa-sync';
button.disabled = false;
// 刷新页面显示最新状态
location.reload();
})
.catch(error => {
console.error('Error:', error);
icon.className = 'fas fa-sync';
button.disabled = false;
alert('检查设备状态失败');
});
}
// 显示设备详情
function showDeviceInfo(deviceId) {
// 这里可以添加获取设备详细信息的API调用
const modal = new bootstrap.Modal(document.getElementById('deviceInfoModal'));
document.getElementById('deviceInfoContent').innerHTML = `
<div class="text-center">
<i class="fas fa-spinner fa-spin fa-2x"></i>
<p class="mt-2">加载设备信息中...</p>
</div>
`;
modal.show();
// 模拟加载设备信息
setTimeout(() => {
document.getElementById('deviceInfoContent').innerHTML = `
<div class="row">
<div class="col-6">
<strong>设备ID:</strong> ${deviceId}
</div>
<div class="col-6">
<strong>状态:</strong> <span class="badge bg-success">在线</span>
</div>
</div>
<hr>
<div class="row">
<div class="col-12">
<strong>详细信息:</strong>
<p class="mt-2">这是一个示例设备,实际应用中会显示真实的设备信息。</p>
</div>
</div>
`;
}, 1000);
}
// 删除设备
function deleteDevice(deviceId) {
if (confirm('确定要删除这个设备吗?此操作不可撤销。')) {
// 这里应该添加删除设备的API调用
alert('删除功能需要后端API支持');
}
}
// 批量检查所有设备状态
function checkAllDevices() {
const checkButtons = document.querySelectorAll('button[onclick*="checkDevice"]');
checkButtons.forEach(button => {
button.click();
});
}
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/devices.html
|
HTML
|
unknown
| 8,990
|
{% extends "base.html" %}
{% block title %}执行指令 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-4">
<!-- 指令信息 -->
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-bullhorn"></i> 指令信息
</h6>
</div>
<div class="card-body">
<h6>{{ order.target }}</h6>
<p><strong>指令类型:</strong>
{% if order.order_type == 'reconnaissance' %}侦察指令
{% elif order.order_type == 'analysis' %}分析指令
{% elif order.order_type == 'execution' %}执行指令
{% endif %}
</p>
<p><strong>优先级:</strong>
<span class="priority-badge priority-{{ order.priority }}">
{% if order.priority == 'low' %}低
{% elif order.priority == 'medium' %}中
{% elif order.priority == 'high' %}高
{% elif order.priority == 'critical' %}紧急
{% endif %}
</span>
</p>
<p><strong>下达时间:</strong> {{ order.created_at.strftime('%Y-%m-%d %H:%M') }}</p>
</div>
</div>
<!-- 指令目标 -->
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-target"></i> 指令目标
</h6>
</div>
<div class="card-body">
<div class="bg-light p-3 rounded">
<pre style="white-space: pre-wrap; margin: 0; font-size: 0.9rem;">{{ order.objective }}</pre>
</div>
</div>
</div>
<!-- 具体指令 -->
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-list"></i> 具体指令
</h6>
</div>
<div class="card-body">
<div class="bg-light p-3 rounded" style="max-height: 300px; overflow-y: auto;">
<pre style="white-space: pre-wrap; margin: 0; font-size: 0.9rem;">{{ order.instructions }}</pre>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<!-- 执行结果表单 -->
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-cogs"></i> 执行结果
</h5>
</div>
<div class="card-body">
<form method="POST" enctype="multipart/form-data">
{{ form.hidden_tag() }}
<div class="mb-3">
{{ form.result_type.label(class="form-label") }}
{{ form.result_type(class="form-select") }}
{% if form.result_type.errors %}
<div class="text-danger">
{% for error in form.result_type.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请如实选择执行结果类型
</div>
</div>
<div class="mb-3">
{{ form.description.label(class="form-label") }}
{{ form.description(class="form-control", rows="6", placeholder="请详细描述执行过程和结果...") }}
{% if form.description.errors %}
<div class="text-danger">
{% for error in form.description.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
请详细描述执行过程、遇到的问题、采取的措施和最终结果
</div>
</div>
<div class="mb-3">
{{ form.evidence.label(class="form-label") }}
{{ form.evidence(class="form-control", rows="4", placeholder="请提供执行证据,如截图、日志、文件等...") }}
{% if form.evidence.errors %}
<div class="text-danger">
{% for error in form.evidence.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
提供执行证据,如截图、日志文件、配置文件等(可选)
</div>
</div>
<div class="mb-3">
{{ form.evidence_image.label(class="form-label") }}
{{ form.evidence_image(class="form-control") }}
{% if form.evidence_image.errors %}
<div class="text-danger">
{% for error in form.evidence_image.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-image"></i>
支持 JPG、JPEG、PNG、GIF 格式,最大 16MB
</div>
</div>
<div class="mb-3">
{{ form.impact_assessment.label(class="form-label") }}
{{ form.impact_assessment(class="form-control", rows="4", placeholder="请评估执行结果的影响...") }}
{% if form.impact_assessment.errors %}
<div class="text-danger">
{% for error in form.impact_assessment.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
评估执行结果对目标系统或环境的影响(可选)
</div>
</div>
<div class="mb-3">
{{ form.lessons_learned.label(class="form-label") }}
{{ form.lessons_learned(class="form-control", rows="3", placeholder="请总结执行过程中的经验教训...") }}
{% if form.lessons_learned.errors %}
<div class="text-danger">
{% for error in form.lessons_learned.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
<div class="form-text">
<i class="fas fa-info-circle"></i>
总结执行过程中的经验教训和改进建议(可选)
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{{ url_for('executor_dashboard') }}" class="btn btn-secondary me-md-2">
<i class="fas fa-arrow-left"></i> 返回
</a>
{{ form.submit(class="btn btn-primary") }}
</div>
</form>
</div>
</div>
<!-- 执行指导 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-lightbulb"></i> 执行指导
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6><i class="fas fa-check-circle text-success"></i> 执行成功要点:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-primary"></i> 严格按照指令要求执行</li>
<li><i class="fas fa-arrow-right text-primary"></i> 详细记录执行过程</li>
<li><i class="fas fa-arrow-right text-primary"></i> 提供充分的执行证据</li>
<li><i class="fas fa-arrow-right text-primary"></i> 评估执行结果的影响</li>
</ul>
</div>
<div class="col-md-6">
<h6><i class="fas fa-exclamation-triangle text-warning"></i> 注意事项:</h6>
<ul class="list-unstyled small">
<li><i class="fas fa-arrow-right text-warning"></i> 确保操作的安全性和合规性</li>
<li><i class="fas fa-arrow-right text-warning"></i> 遇到问题及时沟通反馈</li>
<li><i class="fas fa-arrow-right text-warning"></i> 保护敏感信息的安全</li>
<li><i class="fas fa-arrow-right text-warning"></i> 如实报告执行结果</li>
</ul>
</div>
</div>
</div>
</div>
<!-- 执行结果类型说明 -->
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 执行结果类型说明
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<h6>执行成功</h6>
<small class="text-muted">
完全按照指令要求完成,达到预期目标
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-exclamation-triangle fa-2x text-warning mb-2"></i>
<h6>部分成功</h6>
<small class="text-muted">
部分完成指令要求,存在一些限制或问题
</small>
</div>
</div>
<div class="col-md-4">
<div class="text-center">
<i class="fas fa-times-circle fa-2x text-danger mb-2"></i>
<h6>执行失败</h6>
<small class="text-muted">
未能完成指令要求,需要重新制定方案
</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/execute_order.html
|
HTML
|
unknown
| 12,113
|
{% extends "base.html" %}
{% block title %}执行员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<!-- 待执行指令 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-tasks"></i> 待执行指令
<span class="badge bg-warning ms-2">{{ assigned_orders|length }}</span>
</h5>
</div>
<div class="card-body">
{% if assigned_orders %}
{% for order in assigned_orders %}
<div class="card mb-3 border-warning">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-bullhorn"></i> {{ order.target }}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>类型:</strong>
{% if order.order_type == 'reconnaissance' %}侦察指令
{% elif order.order_type == 'analysis' %}分析指令
{% elif order.order_type == 'execution' %}执行指令
{% endif %} |
<strong>优先级:</strong>
<span class="priority-badge priority-{{ order.priority }}">
{% if order.priority == 'low' %}低
{% elif order.priority == 'medium' %}中
{% elif order.priority == 'high' %}高
{% elif order.priority == 'critical' %}紧急
{% endif %}
</span>
</small>
</p>
<p class="card-text">
<strong>目标:</strong> {{ order.objective[:100] }}{% if order.objective|length > 100 %}...{% endif %}
</p>
<p class="card-text">
<strong>指令:</strong> {{ order.instructions[:100] }}{% if order.instructions|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ order.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<a href="{{ url_for('execute_order', order_id=order.id) }}"
class="btn btn-sm btn-primary">
<i class="fas fa-play"></i> 开始执行
</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<p class="text-muted mb-0">暂无待执行指令</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- 我的执行结果 -->
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
<i class="fas fa-history"></i> 我的执行结果
<span class="badge bg-info ms-2">{{ execution_results|length }}</span>
</h5>
</div>
<div class="card-body">
{% if execution_results %}
{% for result in execution_results %}
<div class="card mb-3 border-info">
<div class="card-body">
<h6 class="card-title">
<i class="fas fa-check-circle"></i>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</h6>
<p class="card-text">
<small class="text-muted">
<strong>状态:</strong>
<span class="badge {% if result.status == 'pending' %}bg-warning{% elif result.status == 'reviewed' %}bg-success{% endif %}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% endif %}
</span>
</small>
</p>
<p class="card-text">
{{ result.description[:100] }}{% if result.description|length > 100 %}...{% endif %}
</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
{{ result.created_at.strftime('%Y-%m-%d %H:%M') }}
</small>
<button class="btn btn-sm btn-outline-info"
data-bs-toggle="modal"
data-bs-target="#viewResultModal{{ result.id }}">
<i class="fas fa-eye"></i> 查看详情
</button>
</div>
</div>
</div>
<!-- 查看执行结果详情模态框 -->
<div class="modal fade" id="viewResultModal{{ result.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">执行结果详情</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row mb-3">
<div class="col-md-6">
<p><strong>执行结果:</strong>
{% if result.result_type == 'success' %}执行成功
{% elif result.result_type == 'partial' %}部分成功
{% elif result.result_type == 'failed' %}执行失败
{% endif %}
</p>
</div>
<div class="col-md-6">
<p><strong>状态:</strong>
<span class="badge {% if result.status == 'pending' %}bg-warning{% elif result.status == 'reviewed' %}bg-success{% endif %}">
{% if result.status == 'pending' %}待审核
{% elif result.status == 'reviewed' %}已审核
{% endif %}
</span>
</p>
</div>
</div>
<h6>执行描述:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.description }}</pre>
</div>
{% if result.evidence %}
<h6>执行证据:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.evidence }}</pre>
</div>
{% endif %}
{% if result.image_path %}
<h6>执行证据图片:</h6>
<div class="mb-3">
<img src="{{ url_for('uploaded_file', filename=result.image_path) }}"
class="img-fluid rounded border"
alt="执行证据图片"
style="max-height: 400px; cursor: pointer;"
onclick="showImageModal('{{ url_for('uploaded_file', filename=result.image_path) }}')">
</div>
{% endif %}
{% if result.impact_assessment %}
<h6>影响评估:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.impact_assessment }}</pre>
</div>
{% endif %}
{% if result.lessons_learned %}
<h6>经验教训:</h6>
<div class="bg-light p-3 rounded mb-3">
<pre style="white-space: pre-wrap; margin: 0;">{{ result.lessons_learned }}</pre>
</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="text-center py-4">
<i class="fas fa-history fa-2x text-muted mb-2"></i>
<p class="text-muted mb-0">暂无执行结果</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 执行统计 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-chart-bar"></i> 执行统计
</h6>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-tasks fa-2x text-warning mb-2"></i>
<h4 class="text-warning">{{ assigned_orders|length }}</h4>
<h6>待执行指令</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-check-circle fa-2x text-success mb-2"></i>
<h4 class="text-success">
{{ execution_results|selectattr('result_type', 'equalto', 'success')|list|length }}
</h4>
<h6>成功执行</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-exclamation-triangle fa-2x text-warning mb-2"></i>
<h4 class="text-warning">
{{ execution_results|selectattr('result_type', 'equalto', 'partial')|list|length }}
</h4>
<h6>部分成功</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-times-circle fa-2x text-danger mb-2"></i>
<h4 class="text-danger">
{{ execution_results|selectattr('result_type', 'equalto', 'failed')|list|length }}
</h4>
<h6>执行失败</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 工作流程说明 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-info-circle"></i> 执行员工作流程
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-bullhorn fa-2x text-primary mb-2"></i>
<h6>接收指令</h6>
<small class="text-muted">接收决策员下达的执行指令</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-cogs fa-2x text-info mb-2"></i>
<h6>执行任务</h6>
<small class="text-muted">按照指令要求执行具体任务</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-clipboard-check fa-2x text-warning mb-2"></i>
<h6>记录结果</h6>
<small class="text-muted">详细记录执行过程和结果</small>
</div>
</div>
<div class="col-md-3 text-center">
<div class="mb-3">
<i class="fas fa-paper-plane fa-2x text-success mb-2"></i>
<h6>提交反馈</h6>
<small class="text-muted">将执行结果反馈给决策员</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 图片查看模态框 -->
<div class="modal fade" id="imageModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">执行证据图片</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body text-center">
<img id="modalImage" src="" class="img-fluid" alt="执行证据图片">
</div>
</div>
</div>
</div>
<script>
function showImageModal(imageSrc) {
document.getElementById('modalImage').src = imageSrc;
var imageModal = new bootstrap.Modal(document.getElementById('imageModal'));
imageModal.show();
}
</script>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/executor_dashboard.html
|
HTML
|
unknown
| 16,414
|
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.welcome-container {
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
padding: 50px;
text-align: center;
max-width: 800px;
width: 90%;
}
.welcome-header h1 {
color: #333;
font-weight: 700;
margin-bottom: 20px;
}
.welcome-header p {
color: #666;
font-size: 1.2rem;
margin-bottom: 40px;
}
.role-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin: 40px 0;
}
.role-card {
background: white;
border-radius: 15px;
padding: 30px 20px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
border: 3px solid transparent;
}
.role-card:hover {
transform: translateY(-10px);
}
.role-card.recon { border-color: #28a745; }
.role-card.analyst { border-color: #17a2b8; }
.role-card.decision { border-color: #ffc107; }
.role-card.executor { border-color: #dc3545; }
.role-icon {
width: 60px;
height: 60px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20px;
font-size: 24px;
color: white;
}
.recon .role-icon { background: #28a745; }
.analyst .role-icon { background: #17a2b8; }
.decision .role-icon { background: #ffc107; color: #333; }
.executor .role-icon { background: #dc3545; }
.role-title {
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 10px;
color: #333;
}
.role-desc {
color: #666;
font-size: 0.9rem;
line-height: 1.5;
}
.btn-login {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 10px;
padding: 15px 40px;
font-size: 1.1rem;
font-weight: 600;
color: white;
text-decoration: none;
display: inline-block;
transition: transform 0.3s ease;
}
.btn-login:hover {
transform: translateY(-3px);
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
color: white;
}
.system-features {
margin-top: 40px;
text-align: left;
}
.feature-item {
display: flex;
align-items: center;
margin-bottom: 15px;
padding: 10px;
background: rgba(102, 126, 234, 0.1);
border-radius: 10px;
}
.feature-icon {
width: 40px;
height: 40px;
background: #667eea;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
color: white;
}
</style>
</head>
<body>
<div class="welcome-container">
<div class="welcome-header">
<h1><i class="fas fa-shield-alt"></i> 协同调度信息系统</h1>
<p>基于角色的协同作战信息管理平台</p>
</div>
<div class="role-cards">
<div class="role-card recon">
<div class="role-icon">
<i class="fas fa-search"></i>
</div>
<div class="role-title">侦察员</div>
<div class="role-desc">
负责信息收集和侦察数据提交,为后续分析提供基础数据支撑
</div>
</div>
<div class="role-card analyst">
<div class="role-icon">
<i class="fas fa-chart-line"></i>
</div>
<div class="role-title">分析员</div>
<div class="role-desc">
对侦察数据进行深度分析,识别威胁和机会,提供决策建议
</div>
</div>
<div class="role-card decision">
<div class="role-icon">
<i class="fas fa-gavel"></i>
</div>
<div class="role-title">决策员</div>
<div class="role-desc">
基于分析结果制定作战计划,下达指令并协调各角色协同作战
</div>
</div>
<div class="role-card executor">
<div class="role-icon">
<i class="fas fa-cogs"></i>
</div>
<div class="role-title">执行员</div>
<div class="role-desc">
执行决策员下达的指令,完成任务并反馈执行结果
</div>
</div>
</div>
<div class="system-features">
<h4 style="text-align: center; margin-bottom: 30px; color: #333;">
<i class="fas fa-star"></i> 系统特性
</h4>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-users"></i>
</div>
<div>
<strong>角色分工明确</strong><br>
<small>四种角色各司其职,形成完整的作战链条</small>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-sync-alt"></i>
</div>
<div>
<strong>信息流转顺畅</strong><br>
<small>从侦察到执行的信息传递和反馈机制</small>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-shield-alt"></i>
</div>
<div>
<strong>权限控制严格</strong><br>
<small>基于角色的访问控制,确保信息安全</small>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">
<i class="fas fa-history"></i>
</div>
<div>
<strong>全程可追溯</strong><br>
<small>完整的操作日志和审计跟踪</small>
</div>
</div>
</div>
<div style="margin-top: 40px;">
<a href="{{ url_for('login') }}" class="btn-login">
<i class="fas fa-sign-in-alt"></i> 立即登录
</a>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
|
2201_75665698/planX
|
WebSystemWithChat/templates/index.html
|
HTML
|
unknown
| 7,915
|
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.login-container {
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
padding: 40px;
width: 100%;
max-width: 400px;
}
.login-header {
text-align: center;
margin-bottom: 30px;
}
.login-header h1 {
color: #333;
font-weight: 700;
margin-bottom: 10px;
}
.login-header p {
color: #666;
margin: 0;
}
.form-control {
border-radius: 10px;
border: 2px solid #e1e5e9;
padding: 12px 15px;
font-size: 16px;
}
.form-control:focus {
border-color: #667eea;
box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}
.btn-login {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 10px;
padding: 12px;
font-size: 16px;
font-weight: 600;
width: 100%;
margin-top: 20px;
}
.btn-login:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.role-info {
background: #f8f9fa;
border-radius: 10px;
padding: 20px;
margin-top: 30px;
}
.role-info h6 {
color: #333;
font-weight: 600;
margin-bottom: 15px;
}
.role-item {
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 8px 0;
}
.role-icon {
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
font-size: 14px;
color: white;
}
.recon { background: #28a745; }
.analyst { background: #17a2b8; }
.decision { background: #ffc107; color: #333 !important; }
.executor { background: #dc3545; }
</style>
</head>
<body>
<div class="login-container">
<div class="login-header">
<h1><i class="fas fa-shield-alt"></i> 协同调度信息系统</h1>
<p>请登录以访问您的角色界面</p>
</div>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-danger alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<form method="POST">
{{ form.hidden_tag() }}
<div class="mb-3">
<label for="username" class="form-label">
<i class="fas fa-user"></i> 用户名
</label>
{{ form.username(class="form-control", placeholder="请输入用户名") }}
</div>
<div class="mb-3">
<label for="password" class="form-label">
<i class="fas fa-lock"></i> 密码
</label>
{{ form.password(class="form-control", placeholder="请输入密码") }}
</div>
{{ form.submit(class="btn btn-primary btn-login") }}
</form>
<!--
<div class="role-info">
<h6><i class="fas fa-info-circle"></i> 测试账户</h6>
<div class="role-item">
<div class="role-icon recon">
<i class="fas fa-search"></i>
</div>
<div>
<strong>侦察员:</strong> recon1 / recon123
</div>
</div>
<div class="role-item">
<div class="role-icon analyst">
<i class="fas fa-chart-line"></i>
</div>
<div>
<strong>分析员:</strong> analyst1 / analyst123
</div>
</div>
<div class="role-item">
<div class="role-icon decision">
<i class="fas fa-gavel"></i>
</div>
<div>
<strong>决策员:</strong> decision1 / decision123
</div>
</div>
<div class="role-item">
<div class="role-icon executor">
<i class="fas fa-cogs"></i>
</div>
<div>
<strong>执行员:</strong> executor1 / executor123
</div>
</div>
</div> -->
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
|
2201_75665698/planX
|
WebSystemWithChat/templates/login.html
|
HTML
|
unknown
| 5,797
|
{% extends "base.html" %}
{% block title %}系统日志 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-list"></i> 系统日志
</h4>
</div>
<div class="card-body">
{% if logs.items %}
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-dark">
<tr>
<th>时间</th>
<th>级别</th>
<th>操作类型</th>
<th>消息</th>
<th>用户</th>
</tr>
</thead>
<tbody>
{% for log in logs.items %}
<tr>
<td>{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
<td>
{% if log.level == 'info' %}
<span class="badge bg-info">信息</span>
{% elif log.level == 'warning' %}
<span class="badge bg-warning text-dark">警告</span>
{% elif log.level == 'error' %}
<span class="badge bg-danger">错误</span>
{% elif log.level == 'debug' %}
<span class="badge bg-secondary">调试</span>
{% else %}
<span class="badge bg-light text-dark">{{ log.level }}</span>
{% endif %}
</td>
<td>
{% if log.action_type == 'recon' %}
<span class="badge bg-success">侦察</span>
{% elif log.action_type == 'analysis' %}
<span class="badge bg-info">分析</span>
{% elif log.action_type == 'decision' %}
<span class="badge bg-warning text-dark">决策</span>
{% elif log.action_type == 'execution' %}
<span class="badge bg-danger">执行</span>
{% elif log.action_type == 'login' %}
<span class="badge bg-primary">登录</span>
{% elif log.action_type == 'logout' %}
<span class="badge bg-secondary">退出</span>
{% else %}
<span class="badge bg-light text-dark">{{ log.action_type or '系统' }}</span>
{% endif %}
</td>
<td>{{ log.message }}</td>
<td>
{% if log.user_id %}
<span class="badge bg-light text-dark">用户{{ log.user_id }}</span>
{% else %}
<span class="text-muted">系统</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- 分页 -->
{% if logs.pages > 1 %}
<nav aria-label="日志分页">
<ul class="pagination justify-content-center">
{% if logs.has_prev %}
<li class="page-item">
<a class="page-link" href="{{ url_for('logs', page=logs.prev_num) }}">上一页</a>
</li>
{% endif %}
{% for page_num in logs.iter_pages() %}
{% if page_num %}
{% if page_num != logs.page %}
<li class="page-item">
<a class="page-link" href="{{ url_for('logs', page=page_num) }}">{{ page_num }}</a>
</li>
{% else %}
<li class="page-item active">
<span class="page-link">{{ page_num }}</span>
</li>
{% endif %}
{% else %}
<li class="page-item disabled">
<span class="page-link">...</span>
</li>
{% endif %}
{% endfor %}
{% if logs.has_next %}
<li class="page-item">
<a class="page-link" href="{{ url_for('logs', page=logs.next_num) }}">下一页</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% else %}
<div class="text-center py-5">
<i class="fas fa-list fa-3x text-muted mb-3"></i>
<h5 class="text-muted">暂无系统日志</h5>
<p class="text-muted">系统运行后会产生相应的日志记录</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- 日志统计 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-chart-pie"></i> 日志统计
</h6>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-info-circle fa-2x text-info mb-2"></i>
<h4 class="text-info">
{{ logs.items|selectattr('level', 'equalto', 'info')|list|length }}
</h4>
<h6>信息日志</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-exclamation-triangle fa-2x text-warning mb-2"></i>
<h4 class="text-warning">
{{ logs.items|selectattr('level', 'equalto', 'warning')|list|length }}
</h4>
<h6>警告日志</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-times-circle fa-2x text-danger mb-2"></i>
<h4 class="text-danger">
{{ logs.items|selectattr('level', 'equalto', 'error')|list|length }}
</h4>
<h6>错误日志</h6>
</div>
</div>
<div class="col-md-3">
<div class="mb-3">
<i class="fas fa-bug fa-2x text-secondary mb-2"></i>
<h4 class="text-secondary">
{{ logs.items|selectattr('level', 'equalto', 'debug')|list|length }}
</h4>
<h6>调试日志</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 操作类型统计 -->
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h6 class="mb-0">
<i class="fas fa-chart-bar"></i> 操作类型统计
</h6>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-search fa-2x text-success mb-2"></i>
<h4 class="text-success">
{{ logs.items|selectattr('action_type', 'equalto', 'recon')|list|length }}
</h4>
<h6>侦察操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-chart-line fa-2x text-info mb-2"></i>
<h4 class="text-info">
{{ logs.items|selectattr('action_type', 'equalto', 'analysis')|list|length }}
</h4>
<h6>分析操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-gavel fa-2x text-warning mb-2"></i>
<h4 class="text-warning">
{{ logs.items|selectattr('action_type', 'equalto', 'decision')|list|length }}
</h4>
<h6>决策操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-cogs fa-2x text-danger mb-2"></i>
<h4 class="text-danger">
{{ logs.items|selectattr('action_type', 'equalto', 'execution')|list|length }}
</h4>
<h6>执行操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-sign-in-alt fa-2x text-primary mb-2"></i>
<h4 class="text-primary">
{{ logs.items|selectattr('action_type', 'equalto', 'login')|list|length }}
</h4>
<h6>登录操作</h6>
</div>
</div>
<div class="col-md-2">
<div class="mb-3">
<i class="fas fa-sign-out-alt fa-2x text-secondary mb-2"></i>
<h4 class="text-secondary">
{{ logs.items|selectattr('action_type', 'equalto', 'logout')|list|length }}
</h4>
<h6>退出操作</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/logs.html
|
HTML
|
unknown
| 11,807
|
{% extends "base.html" %}
{% block title %}侦察员工作台 - 协同调度信息系统{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="fas fa-search"></i> 侦察员工作台
</h4>
</div>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-6">
<div class="d-grid">
<a href="{{ url_for('add_recon_data') }}" class="btn btn-primary">
<i class="fas fa-plus"></i> 提交新的侦察数据
</a>
</div>
</div>
<div class="col-md-6">
<div class="alert alert-info mb-0">
<i class="fas fa-info-circle"></i>
<strong>当前状态:</strong> 已提交 {{ recon_data|length }} 条侦察数据
</div>
</div>
</div>
{% if recon_data %}
<h5><i class="fas fa-list"></i> 我的侦察数据</h5>
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-dark">
<tr>
<th>标题</th>
<th>目标系统</th>
<th>数据类型</th>
<th>优先级</th>
<th>状态</th>
<th>提交时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for data in recon_data %}
<tr>
<td>
<strong>{{ data.title }}</strong>
</td>
<td>{{ data.target_system }}</td>
<td>
<span class="badge bg-info">
{% if data.data_type == 'network' %}网络信息
{% elif data.data_type == 'system' %}系统信息
{% elif data.data_type == 'vulnerability' %}漏洞信息
{% elif data.data_type == 'user' %}用户信息
{% elif data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %}
</span>
</td>
<td>
<span class="priority-badge priority-{{ data.priority }}">
{% if data.priority == 'low' %}低
{% elif data.priority == 'medium' %}中
{% elif data.priority == 'high' %}高
{% elif data.priority == 'critical' %}紧急
{% endif %}
</span>
</td>
<td>
<span class="status-badge status-{{ data.status }}">
{% if data.status == 'pending' %}待分析
{% elif data.status == 'analyzed' %}已分析
{% elif data.status == 'processed' %}已处理
{% endif %}
</span>
</td>
<td>{{ data.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
<td>
<button class="btn btn-sm btn-outline-primary"
data-bs-toggle="modal"
data-bs-target="#viewModal{{ data.id }}">
<i class="fas fa-eye"></i> 查看
</button>
</td>
</tr>
<!-- 查看详情模态框 -->
<div class="modal fade" id="viewModal{{ data.id }}" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ data.title }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<p><strong>目标系统:</strong> {{ data.target_system }}</p>
<p><strong>数据类型:</strong>
{% if data.data_type == 'network' %}网络信息
{% elif data.data_type == 'system' %}系统信息
{% elif data.data_type == 'vulnerability' %}漏洞信息
{% elif data.data_type == 'user' %}用户信息
{% elif data.data_type == 'service' %}服务信息
{% else %}其他
{% endif %}
</p>
</div>
<div class="col-md-6">
<p><strong>优先级:</strong>
<span class="priority-badge priority-{{ data.priority }}">
{% if data.priority == 'low' %}低
{% elif data.priority == 'medium' %}中
{% elif data.priority == 'high' %}高
{% elif data.priority == 'critical' %}紧急
{% endif %}
</span>
</p>
<p><strong>状态:</strong>
<span class="status-badge status-{{ data.status }}">
{% if data.status == 'pending' %}待分析
{% elif data.status == 'analyzed' %}已分析
{% elif data.status == 'processed' %}已处理
{% endif %}
</span>
</p>
</div>
</div>
<hr>
<h6>侦察内容:</h6>
<div class="bg-light p-3 rounded">
<pre style="white-space: pre-wrap; margin: 0;">{{ data.content }}</pre>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-5">
<i class="fas fa-search fa-3x text-muted mb-3"></i>
<h5 class="text-muted">暂无侦察数据</h5>
<p class="text-muted">点击上方按钮提交您的第一条侦察数据</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
|
2201_75665698/planX
|
WebSystemWithChat/templates/recon_dashboard.html
|
HTML
|
unknown
| 9,445
|