Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

资源组中增加上线checklist属性 #2103

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class ResourceGroupAdmin(admin.ModelAdmin):
"ding_webhook",
"feishu_webhook",
"qywx_webhook",
"group_checklist",
"is_deleted",
)
exclude = (
Expand Down
1 change: 1 addition & 0 deletions sql/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ResourceGroup(models.Model):
ding_webhook = models.CharField("钉钉webhook地址", max_length=255, blank=True)
feishu_webhook = models.CharField("飞书webhook地址", max_length=255, blank=True)
qywx_webhook = models.CharField("企业微信webhook地址", max_length=255, blank=True)
group_checklist = models.TextField("上线checklist", default="")
is_deleted = models.IntegerField("是否删除", choices=((0, "否"), (1, "是")), default=0)
create_time = models.DateTimeField(auto_now_add=True)
sys_time = models.DateTimeField(auto_now=True)
Expand Down
33 changes: 31 additions & 2 deletions sql/templates/sqlsubmit.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
data-live-search="true" data-live-search-placeholder="搜索您所在的组" required>
{% for group in group_list %}
<option value="{{ group.group_name }}"
group-cklist="{{ group.group_checklist }}"
group-id="{{ group.group_id }}">{{ group.group_name }}</option>
{% endfor %}
</select>
Expand Down Expand Up @@ -147,7 +148,27 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" data-dismiss="modal">取消</button>
<button id="submitsqlconfirm" type="button" class="btn btn-danger" data-dismiss="modal">确定提交
<!-- button id="submitsqlconfirm" type="button" class="btn btn-danger" data-dismiss="modal">确定提交
</button -->
</div>
</div>
</div>
</div>
<!-- 上线checklist确认 -->
<div class="modal fade" id="checklistConfirm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title text-danger">上线checklist确认</h4>
</div>
<div class="modal-body">
<p>请确认完成以下上线check<pre id="CheckList" style="background-color: white; color: red;font-size: 20px"></pre></font><br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" data-dismiss="modal">取消</button>
<button id="submitcheckconfirm" type="button" class="btn btn-danger" data-dismiss="modal">确定提交
</button>
</div>
</div>
Expand Down Expand Up @@ -401,16 +422,24 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
//判断是否需要弹出提示
var CheckWarningCount = sessionStorage.getItem('CheckWarningCount');
var CheckErrorCount = sessionStorage.getItem('CheckErrorCount');
$("#CheckList").text($("#group_name option:selected").attr("group-cklist"));
$("#CheckWarningCount").text(CheckWarningCount);
$("#CheckErrorCount").text(CheckErrorCount);
if (CheckWarningCount > 0 || CheckErrorCount > 0) {
$('#submitConfirm').modal('show');
} else {
} else if ($("#group_name option:selected").attr("group-cklist").length > 0) {
$('#checklistConfirm').modal('show');
}
else {
sqlSubmit()
}
}
});

// 上线check确认
$("#submitcheckconfirm").click(function () {
sqlSubmit()
});
//提交二次确认
$("#submitsqlconfirm").click(function () {
sqlSubmit()
Expand Down
Loading