# t_sys_config

name: 账号登录安全设置
key: AccountLoginSecurity
remark: 系统账号登录相关安全设置
permission: all
create_time: 2023-06-17 11:02:11+00:00
creator: admin
update_time: 2023-06-17 14:18:07+00:00
modifier: admin
params:
  [{"name":"登录验证码","model":"useCaptcha","placeholder":"是否启用登录验证码","options":"true,false"},{"name":"双因素校验(OTP)","model":"useOtp","placeholder":"是否启用双因素(OTP)校验","options":"true,false"},{"name":"OTP签发人","model":"otpIssuer","placeholder":"otp签发人"},{"name":"允许失败次数","model":"loginFailCount","placeholder":"登录失败n次后禁止登录"},{"name":"禁止登录时间","model":"loginFailMin","placeholder":"登录失败指定次数后禁止m分钟内再次登录"}]

value:
  {"useCaptcha":"true","useOtp":"false","loginFailCount":"5","loginFailMin":"10","otpIssuer":"mayfly-go"}


name: oauth2登录配置
key: Oauth2Login
remark: oauth2登录相关配置信息
permission: admin,
create_time: 2023-07-22 13:58:51+00:00
creator: admin
update_time: 2023-07-22 19:34:37+00:00
modifier: admin
params:
  [{"name":"是否启用","model":"enable","placeholder":"是否启用oauth2登录","options":"true,false"},{"name":"名称","model":"name","placeholder":"oauth2名称"},{"name":"Client ID","model":"clientId","placeholder":"Client ID"},{"name":"Client Secret","model":"clientSecret","placeholder":"Client Secret"},{"name":"Authorization URL","model":"authorizationURL","placeholder":"Authorization URL"},{"name":"AccessToken URL","model":"accessTokenURL","placeholder":"AccessToken URL"},{"name":"Redirect URL","model":"redirectURL","placeholder":"本系统地址"},{"name":"Scopes","model":"scopes","placeholder":"Scopes"},{"name":"Resource URL","model":"resourceURL","placeholder":"获取用户信息资源地址"},{"name":"UserIdentifier","model":"userIdentifier","placeholder":"用户唯一标识字段;格式为type:fieldPath(string:username)"},{"name":"是否自动注册","model":"autoRegister","placeholder":"","options":"true,false"}]


name: ldap登录配置
key: LdapLogin
remark: ldap登录相关配置
permission: admin,
create_time: 2023-08-25 21:47:20+00:00
creator: admin
update_time: 2023-08-25 22:56:07+00:00
modifier: admin
params:
  [{"name":"是否启用","model":"enable","placeholder":"是否启用","options":"true,false"},{"name":"host","model":"host","placeholder":"host"},{"name":"port","model":"port","placeholder":"port"},{"name":"bindDN","model":"bindDN","placeholder":"LDAP 服务的管理员账号，如: \"cn=admin,dc=example,dc=com\""},{"name":"bindPwd","model":"bindPwd","placeholder":"LDAP 服务的管理员密码"},{"name":"baseDN","model":"baseDN","placeholder":"用户所在的 base DN, 如: \"ou=users,dc=example,dc=com\""},{"name":"userFilter","model":"userFilter","placeholder":"过滤用户的方式, 如: \"(uid=%s)、(&(objectClass=organizationalPerson)(uid=%s))\""},{"name":"uidMap","model":"uidMap","placeholder":"用户id和 LDAP 字段名之间的映射关系,如: cn"},{"name":"udnMap","model":"udnMap","placeholder":"用户姓名(dispalyName)和 LDAP 字段名之间的映射关系,如: displayName"},{"name":"emailMap","model":"emailMap","placeholder":"用户email和 LDAP 字段名之间的映射关系"},{"name":"skipTLSVerify","model":"skipTLSVerify","placeholder":"客户端是否跳过 TLS 证书验证","options":"true,false"},{"name":"安全协议","model":"securityProtocol","placeholder":"安全协议（为Null不使用安全协议），如: StartTLS, LDAPS","options":"Null,StartTLS,LDAPS"}]


name: 系统全局样式设置
key: SysStyleConfig
remark: 系统icon、标题、水印信息等配置
permission: all
create_time: 2024-01-04 15:17:18+00:00
creator: admin
update_time: 2024-01-05 09:40:44+00:00
modifier: admin
params:
  [{"model":"logoIcon","name":"logo图标","placeholder":"系统logo图标（base64编码, 建议svg格式，不超过10k）","required":false},{"model":"title","name":"菜单栏标题","placeholder":"系统菜单栏标题展示","required":false},{"model":"viceTitle","name":"登录页标题","placeholder":"登录页标题展示","required":false},{"model":"useWatermark","name":"是否启用水印","placeholder":"是否启用系统水印","options":"true,false","required":false},{"model":"watermarkContent","name":"水印补充信息","placeholder":"额外水印信息","required":false}]

value:
  {"title":"mayfly-go","viceTitle":"mayfly-go","logoIcon":"","useWatermark":"true","watermarkContent":""}


name: 机器相关配置
key: MachineConfig
value: {"terminalRecPath":"./rec","uploadMaxFileSize":"100MB"}
remark: 机器相关配置，如终端回放路径等
permission: all
create_time: 2023-07-13 16:26:44+00:00
creator: admin
update_time: 2024-01-15 16:30:22+00:00
modifier: admin
params:
  [{"name":"终端回放存储路径","model":"terminalRecPath","placeholder":"终端回放存储路径"},{"name":"uploadMaxFileSize","model":"uploadMaxFileSize","placeholder":"允许上传的最大文件大小(1MB\2GB等)"},{"model":"termOpSaveDays","name":"终端记录保存时间","placeholder":"终端记录保存时间（单位天）"}]


name: Mysql可执行文件
key: MysqlBin
value: {"mysql":"","mysqldump":"","mysqlbinlog":"","path":"./db/mysql/bin"}
permission: admin,
create_time: 2023-12-29 10:01:33+00:00
creator: admin
update_time: 2023-12-29 13:34:40+00:00
modifier: admin
params:
  [{"model":"path","name":"路径","placeholder":"可执行文件路径","required":true},{"model":"mysql","name":"mysql","placeholder":"mysql命令路径(空则为 路径/mysql)","required":false},{"model":"mysqldump","name":"mysqldump","placeholder":"mysqldump命令路径(空则为 路径/mysqldump)","required":false},{"model":"mysqlbinlog","name":"mysqlbinlog","placeholder":"mysqlbinlog命令路径(空则为 路径/mysqlbinlog)","required":false}]


name: DBMS配置
key: DbmsConfig
value: {"querySqlSave":"false","maxResultSet":"0","sqlExecTl":"60"}
remark: DBMS相关配置
permission: admin,
create_time: 2024-03-06 13:30:51+00:00
creator: admin
update_time: 2024-03-06 14:07:16+00:00
modifier: admin
params:
  [{"model":"querySqlSave","name":"记录查询sql","placeholder":"是否记录查询类sql","options":"true,false"},{"model":"maxResultSet","name":"最大结果集","placeholder":"允许sql查询的最大结果集数。注: 0=不限制","options":""},{"model":"sqlExecTl","name":"sql执行时间限制","placeholder":"超过该时间（单位：秒），执行将被取消"}]


# t_machine_script

name: sys_info
description: 获取系统信息
script:
  # 获取系统cpu信息
  function get_cpu_info() {
    Physical_CPUs=$(grep "physical id" /proc/cpuinfo | sort | uniq | wc -l)
    Virt_CPUs=$(grep "processor" /proc/cpuinfo | wc -l)
    CPU_Kernels=$(grep "cores" /proc/cpuinfo | uniq | awk -F ': ' '{print $2}')
    CPU_Type=$(grep "model name" /proc/cpuinfo | awk -F ': ' '{print $2}' | sort | uniq)
    CPU_Arch=$(uname -m)
    echo -e '\n-------------------------- CPU信息 --------------------------'
    cat <<EOF | column -t
  物理CPU个数: $Physical_CPUs
  逻辑CPU个数: $Virt_CPUs
  每CPU核心数: $CPU_Kernels
  CPU型号: $CPU_Type
  CPU架构: $CPU_Arch
  EOF
  }

  # 获取系统信息
  function get_systatus_info() {
    sys_os=$(uname -o)
    sys_release=$(cat /etc/redhat-release)
    sys_kernel=$(uname -r)
    sys_hostname=$(hostname)
    sys_selinux=$(getenforce)
    sys_lang=$(echo $LANG)
    sys_lastreboot=$(who -b | awk '{print $3,$4}')
    echo -e '-------------------------- 系统信息 --------------------------'
    cat <<EOF | column -t
  系统: ${sys_os}
  发行版本:   ${sys_release}
  系统内核:   ${sys_kernel}
  主机名:    ${sys_hostname}
  selinux状态:  ${sys_selinux}
  系统语言:   ${sys_lang}
  系统最后重启时间:   ${sys_lastreboot}
  EOF
  }

  get_systatus_info
  #echo -e "\n"
  get_cpu_info


name: get_process_by_name
params: [{"name": "进程名","model": "processName", "placeholder": "请输入进程名"}]
description: 获取进程运行状态
modifier: admin
update_time: 2021-07-12 15:33:41+00:00
script:
  #! /bin/bash
  # Function: 根据输入的程序的名字过滤出所对应的PID，并显示出详细信息，如果有几个PID，则全部显示
  NAME={{.processName}}
  N=`ps -aux | grep $NAME | grep -v grep | wc -l`    ##统计进程总数
  if [ $N -le 0 ];then
    echo "无该进程！"
  fi
  i=1
  while [ $N -gt 0 ]
  do
    echo "进程PID: `ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $2}'`"
    echo "进程命令：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $11}'`"
    echo "进程所属用户: `ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $1}'`"
    echo "CPU占用率：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $3}'`%"
    echo "内存占用率：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $4}'`%"
    echo "进程开始运行的时刻：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $9}'`"
    echo "进程运行的时间：`  ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $11}'`"
    echo "进程状态：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $8}'`"
    echo "进程虚拟内存：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $5}'`"
    echo "进程共享内存：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $6}'`"
    echo "***************************************************************"
    let N-- i++
  done


name: sys_run_info
description: 获取cpu、内存等系统运行状态
update_time: 2021-04-25 15:07:16+00:00
script:
  #!/bin/bash
  # 获取要监控的本地服务器IP地址
  IP=`ifconfig | grep inet | grep -vE 'inet6|127.0.0.1' | awk '{print $2}'`
  echo "IP地址："$IP
   
  # 获取cpu总核数
  cpu_num=`grep -c "model name" /proc/cpuinfo`
  echo "cpu总核数："$cpu_num
   
  # 1、获取CPU利用率
  ################################################
  #us 用户空间占用CPU百分比
  #sy 内核空间占用CPU百分比
  #ni 用户进程空间内改变过优先级的进程占用CPU百分比
  #id 空闲CPU百分比
  #wa 等待输入输出的CPU时间百分比
  #hi 硬件中断
  #si 软件中断
  #################################################
  # 获取用户空间占用CPU百分比
  cpu_user=`top -b -n 1 | grep Cpu | awk '{print $2}' | cut -f 1 -d "%"`
  echo "用户空间占用CPU百分比："$cpu_user
   
  # 获取内核空间占用CPU百分比
  cpu_system=`top -b -n 1 | grep Cpu | awk '{print $4}' | cut -f 1 -d "%"`
  echo "内核空间占用CPU百分比："$cpu_system
   
  # 获取空闲CPU百分比
  cpu_idle=`top -b -n 1 | grep Cpu | awk '{print $8}' | cut -f 1 -d "%"`
  echo "空闲CPU百分比："$cpu_idle
   
  # 获取等待输入输出占CPU百分比
  cpu_iowait=`top -b -n 1 | grep Cpu | awk '{print $10}' | cut -f 1 -d "%"`
  echo "等待输入输出占CPU百分比："$cpu_iowait
   
  #2、获取CPU上下文切换和中断次数
  # 获取CPU中断次数
  cpu_interrupt=`vmstat -n 1 1 | sed -n 3p | awk '{print $11}'`
  echo "CPU中断次数："$cpu_interrupt
   
  # 获取CPU上下文切换次数
  cpu_context_switch=`vmstat -n 1 1 | sed -n 3p | awk '{print $12}'`
  echo "CPU上下文切换次数："$cpu_context_switch
   
  #3、获取CPU负载信息
  # 获取CPU15分钟前到现在的负载平均值
  cpu_load_15min=`uptime | awk '{print $11}' | cut -f 1 -d ','`
  echo "CPU 15分钟前到现在的负载平均值："$cpu_load_15min
   
  # 获取CPU5分钟前到现在的负载平均值
  cpu_load_5min=`uptime | awk '{print $10}' | cut -f 1 -d ','`
  echo "CPU 5分钟前到现在的负载平均值："$cpu_load_5min
   
  # 获取CPU1分钟前到现在的负载平均值
  cpu_load_1min=`uptime | awk '{print $9}' | cut -f 1 -d ','`
  echo "CPU 1分钟前到现在的负载平均值："$cpu_load_1min
   
  # 获取任务队列(就绪状态等待的进程数)
  cpu_task_length=`vmstat -n 1 1 | sed -n 3p | awk '{print $1}'`
  echo "CPU任务队列长度："$cpu_task_length
   
  #4、获取内存信息
  # 获取物理内存总量
  mem_total=`free -h | grep Mem | awk '{print $2}'`
  echo "物理内存总量："$mem_total
   
  # 获取操作系统已使用内存总量
  mem_sys_used=`free -h | grep Mem | awk '{print $3}'`
  echo "已使用内存总量(操作系统)："$mem_sys_used
   
  # 获取操作系统未使用内存总量
  mem_sys_free=`free -h | grep Mem | awk '{print $4}'`
  echo "剩余内存总量(操作系统)："$mem_sys_free
   
  # 获取应用程序已使用的内存总量
  mem_user_used=`free | sed -n 3p | awk '{print $3}'`
  echo "已使用内存总量(应用程序)："$mem_user_used
   
  # 获取应用程序未使用内存总量
  mem_user_free=`free | sed -n 3p | awk '{print $4}'`
  echo "剩余内存总量(应用程序)："$mem_user_free
   
  # 获取交换分区总大小
  mem_swap_total=`free | grep Swap | awk '{print $2}'`
  echo "交换分区总大小："$mem_swap_total
   
  # 获取已使用交换分区大小
  mem_swap_used=`free | grep Swap | awk '{print $3}'`
  echo "已使用交换分区大小："$mem_swap_used
   
  # 获取剩余交换分区大小
  mem_swap_free=`free | grep Swap | awk '{print $4}'`
  echo "剩余交换分区大小："$mem_swap_free


# t_sys_resource

ui_path: 12sSjal1/lskeiql1/
name: 机器列表
code: machines
creator: admin
modifier: admin
create_time: 2021-05-25 16:50:04+00:00
update_time: 2023-03-15 17:14:44+00:00
meta:
  {"component":"ops/machine/MachineList","icon":"Monitor","isKeepAlive":true,"routeName":"MachineList"}


ui_path: Xlqig32x/UGxla231/
name: 资源管理
code: resources
creator: admin
modifier: admin
create_time: 2021-05-26 15:23:07+00:00
update_time: 2023-03-14 15:44:34+00:00
meta:
  {"component":"system/resource/ResourceList","icon":"Menu","isKeepAlive":true,"routeName":"ResourceList"}


ui_path: Xlqig32x/sfslfel/
name: 账号管理
code: accounts
creator: admin
modifier: admin
create_time: 2021-05-28 14:56:25+00:00
update_time: 2023-03-14 15:44:10+00:00
meta:
  {"component":"system/account/AccountList","icon":"Menu","isKeepAlive":true,"routeName":"AccountList"}


ui_path: sl3as23x/
name: 个人中心
code: /personal
creator: admin
modifier: admin
create_time: 2021-06-03 14:25:35+00:00
update_time: 2023-03-14 14:28:36+00:00
meta:
  {"component":"personal/index","icon":"UserFilled","isHide":true,"isKeepAlive":true,"routeName":"Personal"}


ui_path: RedisXq4/Exitx4al/
name: 数据操作
code: data-operation
creator: admin
modifier: admin
create_time: 2021-07-19 20:17:29+00:00
update_time: 2023-03-15 16:37:50+00:00
meta:
  {"component":"ops/redis/DataOperation","icon":"iconfont icon-redis","isKeepAlive":true,"routeName":"DataOperation"}


ui_path: RedisXq4/Eoaljc12/
name: redis管理
code: manage
creator: admin
modifier: admin
create_time: 2021-07-20 10:48:04+00:00
update_time: 2023-03-15 16:38:00+00:00
meta:
  {"component":"ops/redis/RedisList","icon":"iconfont icon-redis","isKeepAlive":true,"routeName":"RedisList"}


ui_path: Mongo452/eggago31/
name: 数据操作
code: mongo-data-operation
creator: admin
modifier: admin
create_time: 2022-05-13 14:03:58+00:00
update_time: 2023-03-15 17:15:02+00:00
meta:
  {"component":"ops/mongo/MongoDataOp","icon":"iconfont icon-mongo","isKeepAlive":true,"routeName":"MongoDataOp"}


ui_path: Mongo452/ghxagl43/
name: Mongo管理
code: mongo-manage
creator: admin
modifier: admin
create_time: 2022-05-16 18:13:06+00:00
update_time: 2023-03-15 17:26:55+00:00
meta:
  {"component":"ops/mongo/MongoList","icon":"iconfont icon-mongo","isKeepAlive":true,"routeName":"MongoList"}


ui_path: Xlqig32x/Ulxaee23/
name: 系统配置
code: configs
creator: admin
modifier: admin
create_time: 2022-08-25 22:18:55+00:00
update_time: 2023-03-15 11:06:07+00:00
meta:
  {"component":"system/config/ConfigList","icon":"Setting","isKeepAlive":true,"routeName":"ConfigList"}


ui_path: Tag3fhad/glxajg23/
name: 标签树
code: tag-trees
creator: admin
modifier: admin
create_time: 2022-10-24 15:19:40+00:00
update_time: 2023-03-14 14:30:51+00:00
meta:
  {"component":"ops/tag/TagTreeList","icon":"CollectionTag","isKeepAlive":true,"routeName":"TagTreeList"}


ui_path: 12sSjal1/exahgl32/
name: 授权凭证
code: authcerts
creator: admin
modifier: admin
create_time: 2023-02-23 11:36:26+00:00
update_time: 2023-03-14 14:33:28+00:00
meta:
  {"component":"ops/machine/authcert/AuthCertList","icon":"Unlock","isKeepAlive":true,"routeName":"AuthCertList"}


ui_path: 12sSjal1/W9XKiabq/
name: 计划任务
code: /machine/cron-job
creator: admin
modifier: admin
create_time: 2023-07-18 10:13:16+00:00
update_time: 2023-07-18 10:14:06+00:00
meta:
  {"component":"ops/machine/cronjob/CronJobList","icon":"AlarmClock","isKeepAlive":true,"routeName":"CronJobList"}


ui_path: 6egfEVYr/3r3hHEub/
name: 我的任务
code: procinst-tasks
creator: admin
modifier: admin
create_time: 2024-02-27 22:55:35+00:00
update_time: 2024-02-27 22:56:35+00:00
meta:
  {"component":"flow/ProcinstTaskList","icon":"Tickets","isKeepAlive":true,"routeName":"ProcinstTaskList"}


