layui 使用cron可视化组件
layui版本一定是最新版
123456789101112131415161718layui .config({ base: "../static/layui_exts/", // 扩展组件跟路径 }) .extend({ cron: "cron/cron" // 扩展组件 }) .use(["cron"], function () { var $ = layui.$, cron = layui.cron; cron.render({ elem: "#cron", // 绑定元素 run: "../static/json/run.json", // 获取最近运行时间的接口 done: function(cronStr) { console.log(cronStr); } }); }); ...
IDEA快速部署到docker中
服务器上部署docker12345678910111213# step 1: 安装必要的一些系统工具sudo yum install -y yum-utils device-mapper-persistent-data lvm2# Step 2: 添加软件源信息sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo# Step 3sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo# Step 4: 更新并安装Docker-CEsudo yum makecache fastsudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin# Step 4: 开 ...
Python将print输出重定向到tkinter页面
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import sysfrom tkinter import Text, ENDclass StdoutRedirector: def __init__(self, text_widget: Text): self.text_widget = text_widget self.last_line_start = 0 # 跟踪最后一行的起始位置 def write(self, output: str): if output.startswith('/r'): # 去除前缀 '/r' output = output[2:] # 删除最后一行内容 if self.last_line_start ...
YUM安装docker-compose
添加 epel 源1yum install -y epel-release
安装docker-compose1yum install -y docker-compose
查看 docker-compose 版本1docker-compose --version
富文本及formatter的使用
先看效果图:该饼图统计总共的数据,其中每块饼图旁边显示了3条相应的详细数据
其中后端提供的数据结构如下123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869{ "code": 0, "randomSelectedList": [ { "username": "a1", "newsName": "北京大学-悉尼大学食物安全和农业可持续发展联合中心揭牌仪式暨学术研讨会举行" }, { "username": "a1", "newsName": "“沉浸式传播视域下传统文化+虚拟现实的创新路径”研讨会在 ...
通用dockerfile文件
先写项目的启动脚本,命名为run.sh1234567891011121314151617181920212223#!/bin/shif [ -z $JAVA_OPTS ];then JAVA_OPTS="-Xms256m -Xmx512m"fiif [ -z $JAR_PATH ];then JAR_PATH="/opt/server"fiif [ -z $EXAM_ENV ];then EXAM_ENV="prod"fiif [ x$LOG != "xfalse" ];then mkdir -p logs LOGGING_OPT="--logging.path=./logs"fiecho $JAVA_OPTS -Dlogging.path=./logs -DSpring.profiles.active=$EXAM_ENV -jar ${JAR_PATH}/*.jarjava $JAVA_OPTS -Dlogging.path=./log ...
使用electron打包静态页面
先到静态页面包外面安装electron-packager
123npm install electron
再安装electron-packager
12npm install electron-packager
到静态页面文件夹里面创建main.js 文件
12345678910111213141516171819202122232425262728293031const {app,BrowserWindow} = require('electron'); //引入electronlet win;let windowConfig = { width: 800, height: 600}; //窗口配置程序运行窗口的大小function createWindow() { win = new BrowserWindow(windowConfig); //创建一个窗口 win.loadURL(`file://${__dirname}/index.html`); ...
加密yml文件
1. 低版本2.x引入依赖12345<dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <version>2.1.0</version></dependency>
手动引入依赖(内网环境)
12345678910<dependency> <groupId>org.jasypt</groupId> <artifactId>jasypt</artifactId> <version>1.9.2</version></dependency><dependency> <groupId>com.github.ulisesbocchio</groupId> < ...
Vue2设置通知提醒框
可自定义设置以下属性:
自动关闭的延时时长(duration),单位ms,默认4500ms
消息从顶部弹出时,距离顶部的位置(top),单位px,默认24px
消息从底部弹出时,距离底部的位置(bottom),单位px,默认24px
消息弹出位置(placement),可选:左上topLeft,右上topRight(默认),左下bottomLeft,右下bottomRight
调用时可选以下五个方法对应五种不同样式:
this.$refs.notification.open(notification) // 默认使用
this.$refs.notification.info(notification) // info调用
this.$refs.notification.success(notification) // success调用
this.$refs.notification.error(notification) // error调用
this.$refs.notification.warn ...
Layui实现放大图片的效果
需要在表格里面添加查看图片的模板
123<div style="width: 400px;height: 200px" onclick="showLarge('../images/lidong.jpg')"> <img height="100%" width="100%" src="../images/lidong.jpg" alt=""></div>
放大的function
123456789101112131415161718192021222324252627<script type="text/javascript" >//查看大图 function showLarge(src) { layer.photos({ photos: { "title&quo ...