mirror of https://github.com/layui/layui
贤心
11 months ago
committed by
GitHub
30 changed files with 747 additions and 87 deletions
@ -0,0 +1,30 @@ |
|||||||
|
name: Issue Close Require |
||||||
|
|
||||||
|
on: |
||||||
|
schedule: |
||||||
|
- cron: "0 0 * * *" |
||||||
|
|
||||||
|
permissions: |
||||||
|
contents: read |
||||||
|
|
||||||
|
jobs: |
||||||
|
issue-close-require: |
||||||
|
permissions: |
||||||
|
issues: write |
||||||
|
pull-requests: write |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- name: need reproduce |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'close-issues' |
||||||
|
labels: 'need reproduce' |
||||||
|
inactive-day: 5 |
||||||
|
body: | |
||||||
|
由于超过 5 天仍未收到相关重现,该 issue 已被自动关闭。 |
||||||
|
- name: resolved |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'close-issues' |
||||||
|
labels: 'resolved' |
||||||
|
inactive-day: 3 |
@ -0,0 +1,82 @@ |
|||||||
|
name: Issue Labeled |
||||||
|
|
||||||
|
on: |
||||||
|
issues: |
||||||
|
types: [labeled] |
||||||
|
|
||||||
|
permissions: |
||||||
|
contents: read |
||||||
|
|
||||||
|
jobs: |
||||||
|
issue-labeled: |
||||||
|
permissions: |
||||||
|
issues: write |
||||||
|
pull-requests: write |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- name: bug |
||||||
|
if: github.event.label.name == 'bug' |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'create-comment' |
||||||
|
token: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
issue-number: ${{ github.event.issue.number }} |
||||||
|
body: | |
||||||
|
@${{ github.event.issue.user.login }} 你好。团队已初步确认该 Bug,我们将在后续版本进行详细的排查和修复,感谢您的积极反馈 👍 |
||||||
|
|
||||||
|
- name: help wanted |
||||||
|
if: github.event.label.name == 'help wanted' |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'create-comment' |
||||||
|
token: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
body: | |
||||||
|
@${{ github.event.issue.user.login }} 很棒 👋 |
||||||
|
我们有意愿采纳这项议题,欢迎您创建 [Pull Request](https://github.com/layui/layui/pulls) 来协助实现,若变更内容涉及到 API 新增和改动,除了提交核心代码外,还需包含:[文档](https://github.com/layui/layui/tree/main/docs)、测试用例等相关文件,以便我们更好地进行 Review。期待您的贡献! |
||||||
|
|
||||||
|
- name: invalid |
||||||
|
if: github.event.label.name == 'invalid' |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'create-comment,close-issue' |
||||||
|
token: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
body: | |
||||||
|
@${{ github.event.issue.user.login }} 你好,为了提升沟通效率,我们对 Issue 制定了规范要求,你的 Issue 因不符合规范而被自动关闭。 |
||||||
|
建议您在下次创建 Issue 时,遵循表单模板规范填写。谢谢。 |
||||||
|
> 相关延伸:👉 [**提问的智慧**](https://github.com/tvvocold/How-To-Ask-Questions-The-Smart-Way) |
||||||
|
|
||||||
|
- name: need reproduce |
||||||
|
if: github.event.label.name == 'need reproduce' |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'create-comment' |
||||||
|
token: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
body: | |
||||||
|
@${{ github.event.issue.user.login }} 您好,请提供一个最小化的重现,以便我们为您协助排查问题。良好的重现应当包括但不仅限于: |
||||||
|
- 产生问题的详细步骤 |
||||||
|
- 与问题相关的完整代码 |
||||||
|
- 在线 Demo (推荐通过 [stackblitz](https://stackblitz.com/) 或 [codepen](https://codepen.io/) 创建) |
||||||
|
> 相关延伸:👉 [为什么要提供最小化重现?](https://antfu.me/posts/why-reproductions-are-required-zh) |
||||||
|
|
||||||
|
- name: discussion |
||||||
|
if: github.event.label.name == 'discussion' |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'create-comment,close-issue' |
||||||
|
token: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
body: | |
||||||
|
@${{ github.event.issue.user.login }} 你好,Issue 一般只接受「Bug 报告」和「新功能请求」,而您的议题涉及到基础用法和功能疑惑等业务相关的讨论,这并不适合作为 Issue 讨论。建议您通过以下方式寻求解决方案: |
||||||
|
- 仔细查阅 Layui 官方文档:https://layui.dev |
||||||
|
- 搜索相关技术资料或咨询人工智能大模型 |
||||||
|
- [Discussions](https://github.com/layui/layui/discussions) |
||||||
|
|
||||||
|
- name: unrelated |
||||||
|
if: github.event.label.name == 'unrelated' |
||||||
|
uses: actions-cool/issues-helper@v3 |
||||||
|
with: |
||||||
|
actions: 'create-comment,close-issue' |
||||||
|
token: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
body: | |
||||||
|
@${{ github.event.issue.user.login }} 经过确认,您提出的问题与 Layui 不存在相关联。建议通过以下方式寻求解决方案: |
||||||
|
- 搜索相关技术资料或咨询人工智能大模型 |
||||||
|
- [Discussions](https://github.com/layui/layui/discussions) |
@ -0,0 +1,18 @@ |
|||||||
|
name: Publish to NPM |
||||||
|
|
||||||
|
on: |
||||||
|
release: |
||||||
|
types: [created] |
||||||
|
|
||||||
|
jobs: |
||||||
|
publish-npm: |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- uses: actions/checkout@v3 |
||||||
|
- uses: actions/setup-node@v3 |
||||||
|
with: |
||||||
|
node-version: 16 |
||||||
|
registry-url: https://registry.npmjs.org |
||||||
|
- run: npm publish |
||||||
|
env: |
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
@ -0,0 +1,82 @@ |
|||||||
|
on: |
||||||
|
push: |
||||||
|
tags: |
||||||
|
- 'v*' |
||||||
|
|
||||||
|
name: Create Release |
||||||
|
|
||||||
|
jobs: |
||||||
|
build: |
||||||
|
name: Create Release |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- name: Checkout code |
||||||
|
uses: actions/checkout@v3 |
||||||
|
|
||||||
|
- name: Get the version |
||||||
|
id: get_version |
||||||
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
||||||
|
|
||||||
|
# 获取当前版本贡献者 |
||||||
|
- name: Fetch Contributors |
||||||
|
id: contributors |
||||||
|
run: | |
||||||
|
USERNAME_LIST="" |
||||||
|
|
||||||
|
# 获取完整的提交历史 |
||||||
|
git fetch --prune --unshallow |
||||||
|
|
||||||
|
# 按日期排序标签,获取上一个标签 |
||||||
|
PREVIOUS_TAG=$(git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags | sed -n 2p) |
||||||
|
|
||||||
|
# 获取当前标签 |
||||||
|
CURRENT_TAG=${GITHUB_REF#refs/tags/} |
||||||
|
|
||||||
|
echo "Previous Tag: $PREVIOUS_TAG" |
||||||
|
echo "Current Tag: $CURRENT_TAG" |
||||||
|
|
||||||
|
for COMMIT_SHA in $(git log ${PREVIOUS_TAG}...$CURRENT_TAG --pretty=format:"%H") |
||||||
|
do |
||||||
|
USER=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
||||||
|
https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/$COMMIT_SHA \ |
||||||
|
| jq -r '.author.login') |
||||||
|
if [ "$USER" != "null" ] && [ ! -z "$USER" ]; then |
||||||
|
USERNAME_LIST="$USERNAME_LIST @$USER" |
||||||
|
fi |
||||||
|
done |
||||||
|
USERNAME_LIST=$(echo $USERNAME_LIST | tr ' ' '\n' | sort -u | tr '\n' ' ') |
||||||
|
echo "usernames=$USERNAME_LIST" >> $GITHUB_OUTPUT |
||||||
|
|
||||||
|
- name: Determine Prerelease |
||||||
|
id: prerelease |
||||||
|
run: | |
||||||
|
if [[ ${{ github.ref }} =~ - ]]; then |
||||||
|
echo "Setting prerelease to true" |
||||||
|
echo "prerelease=true" >> $GITHUB_OUTPUT |
||||||
|
else |
||||||
|
echo "Setting prerelease to false" |
||||||
|
echo "prerelease=false" >> $GITHUB_OUTPUT |
||||||
|
fi |
||||||
|
|
||||||
|
- name: Create Zip File |
||||||
|
id: asset |
||||||
|
run: | |
||||||
|
DIR_NAME="layui-${{ env.VERSION }}" |
||||||
|
mkdir -p $DIR_NAME/layui |
||||||
|
mv dist layui |
||||||
|
mv layui $DIR_NAME/ |
||||||
|
mv examples/introduce/* $DIR_NAME/ |
||||||
|
zip -r $DIR_NAME.zip $DIR_NAME |
||||||
|
echo "filename=$DIR_NAME" >> $GITHUB_OUTPUT |
||||||
|
|
||||||
|
- name: GH Release |
||||||
|
id: create_release |
||||||
|
uses: softprops/action-gh-release@v0.1.15 |
||||||
|
env: |
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
||||||
|
with: |
||||||
|
body: | |
||||||
|
- **更新日志**: https://layui.dev/docs/2/versions.html#${{ env.VERSION }} |
||||||
|
- **本次贡献**: ${{ steps.contributors.outputs.usernames }} 🎉 |
||||||
|
prerelease: ${{ steps.prerelease.outputs.prerelease }} |
||||||
|
files: ${{ steps.asset.outputs.filename }}.zip |
@ -0,0 +1,20 @@ |
|||||||
|
# Security Policy |
||||||
|
|
||||||
|
## Supported Versions |
||||||
|
|
||||||
|
Use this section to tell people about which versions of your project are |
||||||
|
currently being supported with security updates. |
||||||
|
|
||||||
|
| Version | Supported | |
||||||
|
| ------- | ------------------ | |
||||||
|
| 2.9.x | :white_check_mark: | |
||||||
|
| 2.8.x | :white_check_mark: | |
||||||
|
| < 2.8.0 | :x: | |
||||||
|
|
||||||
|
## Reporting a Vulnerability |
||||||
|
|
||||||
|
Use this section to tell people how to report a vulnerability. |
||||||
|
|
||||||
|
Tell them where to go, how often they can expect to get an update on a |
||||||
|
reported vulnerability, what to expect if the vulnerability is accepted or |
||||||
|
declined, etc. |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,102 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||||
|
<title>测试 - Layui</title> |
||||||
|
<link rel="stylesheet" href="layui/css/layui.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<div class="layui-container"> |
||||||
|
<div class="layui-progress" style="margin: 15px 0 30px;"> |
||||||
|
<div class="layui-progress-bar" lay-percent="100%"></div> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
<div class="layui-btn-container"> |
||||||
|
<button class="layui-btn" test-active="test-form">一个按钮</button> |
||||||
|
<button class="layui-btn layui-btn-normal" id="test2">当前日期</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
<blockquote class="layui-elem-quote" style="margin-top: 30px;"> |
||||||
|
<div class="layui-text"> |
||||||
|
<ul> |
||||||
|
<li>您当前预览的是:<span>Layui-v<span id="version"></span></span></li> |
||||||
|
<li>Layui 是一套开源免费的 Web UI(界面)组件库。这是一个极其简洁的演示页面</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</blockquote> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- body 末尾处引入 layui --> |
||||||
|
<script src="layui/layui.js"></script> |
||||||
|
<script> |
||||||
|
layui.use(function(){ |
||||||
|
var layer = layui.layer; |
||||||
|
var form = layui.form; |
||||||
|
var laydate = layui.laydate; |
||||||
|
var util = layui.util; |
||||||
|
|
||||||
|
// 欢迎信息 |
||||||
|
layer.msg('Hello World', {icon: 6}); |
||||||
|
|
||||||
|
// 输出版本号 |
||||||
|
lay('#version').html(layui.v); |
||||||
|
|
||||||
|
// 日期 |
||||||
|
laydate.render({ |
||||||
|
elem: '#test2', |
||||||
|
value: new Date(), |
||||||
|
isInitValue: true |
||||||
|
}); |
||||||
|
|
||||||
|
// 触发事件 |
||||||
|
util.on('test-active', { |
||||||
|
'test-form': function(){ |
||||||
|
layer.open({ |
||||||
|
type: 1, |
||||||
|
resize: false, |
||||||
|
shadeClose: true, |
||||||
|
area: '350px', |
||||||
|
title: 'layer + form', |
||||||
|
content: ['<ul class="layui-form layui-form-pane" style="margin: 15px;">', |
||||||
|
'<li class="layui-form-item">', |
||||||
|
'<label class="layui-form-label">输入框</label>', |
||||||
|
'<div class="layui-input-block">', |
||||||
|
'<input class="layui-input" lay-verify="required" name="field1">', |
||||||
|
'</div>', |
||||||
|
'</li>', |
||||||
|
'<li class="layui-form-item">', |
||||||
|
'<label class="layui-form-label">选择框</label>', |
||||||
|
'<div class="layui-input-block">', |
||||||
|
'<select name="field2">', |
||||||
|
'<option value="A">A</option>', |
||||||
|
'<option value="B">B</option>', |
||||||
|
'<select>', |
||||||
|
'</div>', |
||||||
|
'</li>', |
||||||
|
'<li class="layui-form-item" style="text-align:center;">', |
||||||
|
'<button type="submit" lay-submit lay-filter="*" class="layui-btn">提交</button>', |
||||||
|
'</li>', |
||||||
|
'</ul>'].join(''), |
||||||
|
success: function(layero, index){ |
||||||
|
layero.find('.layui-layer-content').css('overflow', 'visible'); |
||||||
|
|
||||||
|
form.render().on('submit(*)', function(data){ |
||||||
|
var field = data.field; |
||||||
|
|
||||||
|
// 显示填写的表单 |
||||||
|
layer.msg(util.escape(JSON.stringify(field)), { |
||||||
|
icon: 1 |
||||||
|
}); |
||||||
|
// layer.close(index); //关闭层 |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,11 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||||
|
<title>免责声明</title> |
||||||
|
<script>location.href = 'https://gitee.com/layui/layui/blob/main/DISCLAIMER.md';</script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,11 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||||
|
<title>官方文档</title> |
||||||
|
<script>location.href = 'https://layui.github.io';</script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
</body> |
||||||
|
</html> |
Loading…
Reference in new issue