feat: 初始化导航网站项目
添加 Flask 导航站应用,包含 Docker 部署配置、SQLite 数据库、静态资源及 CI/CD 流水线。
这个提交包含在:
@@ -0,0 +1,118 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% block content %}
|
||||
<div class="ui vertical stripe segment">
|
||||
<div class="ui container">
|
||||
{% block customize_header %}
|
||||
{% endblock%}
|
||||
<table id="model_table" class="ui stackable celled padded long table sortable small striped">
|
||||
<thead>
|
||||
<tr>
|
||||
{% block customize_table_th %}
|
||||
{% endblock%}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% block customize_table_tr %}
|
||||
{% endblock%}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui modal model_form">
|
||||
<div class="header">Look at the Actions</div>
|
||||
<div class="content">
|
||||
<form class="ui equal width form">
|
||||
{% block customize_form %}
|
||||
{% endblock%}
|
||||
</form>
|
||||
</div>
|
||||
<div class="basic actions">
|
||||
<div class="ui negative button btn_cancel">Cancel</div>
|
||||
<div class="ui positive button btn_submit">Submit</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input id="page_type" value="{{ page_type }}" hidden/>
|
||||
{% endblock %}
|
||||
{% block footer_script %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
console.log("start")
|
||||
var page_type = $("#page_type").val()
|
||||
$(".url").popup();
|
||||
$("#model_table").tablesort()
|
||||
$('#status_switch').checkbox({
|
||||
onChecked: function () {statusChange(true)},
|
||||
onUnchecked: function () { statusChange(false) }
|
||||
});
|
||||
function statusChange(flag){
|
||||
$('#status_switch').children('input').attr('checked',flag)
|
||||
if(flag){
|
||||
$("#status").val(1);
|
||||
$('#status_switch').children('label').html('启用')
|
||||
}else{
|
||||
$("#status").val(0);
|
||||
$('#status_switch').children('label').html('禁用')
|
||||
}
|
||||
}
|
||||
$('.btn_add').click(function () {
|
||||
console.log("add")
|
||||
$('.model_form').modal('show');
|
||||
})
|
||||
$('.btn_submit').click(function () {
|
||||
let json = $('.form').serialize();
|
||||
// console.log(json)
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/customize/"+page_type,
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
data: json,
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
$('.btn_edit').click(function () {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/customize/"+page_type+"?id=" + $(this).attr("data-id"),
|
||||
success: function (res) {
|
||||
var data = res.data
|
||||
if (res.code === 1) {
|
||||
$('.form').find('input').each(function (i, n) {
|
||||
var obj = $(n)
|
||||
obj.val(data[obj.attr("name")])
|
||||
});
|
||||
statusChange(data['status']==1?true:false)
|
||||
$('.model_form').modal('show');
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
$('.btn_delete').click(function () {
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/customize/"+page_type+"?id=" + $(this).attr("data-id"),
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{% extends '/customize/base-customize.html' %}
|
||||
{% block customize_header %}
|
||||
|
||||
{% endblock%}
|
||||
{% block customize_table_th %}
|
||||
|
||||
{% endblock%}
|
||||
{% block customize_table_tr %}
|
||||
|
||||
{% endblock%}
|
||||
{% block customize_form %}
|
||||
|
||||
{% endblock%}
|
||||
@@ -0,0 +1,106 @@
|
||||
{% extends '/customize/base-customize.html' %}
|
||||
{% block customize_header %}
|
||||
<div class="ui warning message">
|
||||
<div class="header">温馨提示</div>
|
||||
<ul>
|
||||
<li>该定制化服务仍处于测试与迭代研发阶段。</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2 class="ui header">仓库收录</h2>
|
||||
<a class="ui mini negative left labeled icon button btn_add"><i class="undo icon"></i>新增</a>
|
||||
{% endblock%}
|
||||
{% block customize_table_th %}
|
||||
<th>图标</th>
|
||||
<th>名称</th>
|
||||
<th>地址</th>
|
||||
<th>分类</th>
|
||||
<th>标签</th>
|
||||
<th>类型</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
{% endblock%}
|
||||
{% block customize_table_tr %}
|
||||
{% for item in data_list %}
|
||||
<tr>
|
||||
<td class="left {{ item.color }} marked">
|
||||
<i class="{{ item.icon }}"></i>
|
||||
</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>
|
||||
<a class="ui icon button url" data-content="{{ item.url }}" href="{{ item.url }}" target="_blank">
|
||||
<i class="linkify icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ item.cate }}</td>
|
||||
<td>{{ item.tags }}</td>
|
||||
<td>{{ item.type }}</td>
|
||||
<td>{{ item.sort }}</td>
|
||||
<td>
|
||||
{% if item.status == 0 %}
|
||||
<i class="icon close red"></i>
|
||||
{% else %}
|
||||
<i class="icon checkmark green"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<!-- <button class="btn_add" data-id="{{ item.id }}">添加</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock%}
|
||||
{% block customize_form %}
|
||||
<input type="text" name="id" hidden>
|
||||
<input type="text" name="user_id" hidden>
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
<label>图标 <a class="ui mini blue text" href="/icon.html" target="_blank">图标选择</a></label>
|
||||
<input type="text" name="icon">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>颜色</label>
|
||||
<input type="text" name="color">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>名称</label>
|
||||
<input type="text" name="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>图片</label>
|
||||
<input type="text" name="img">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>地址</label>
|
||||
<input type="text" name="url">
|
||||
</div>
|
||||
<div class="fields">
|
||||
<input type="text" name="type" hidden>
|
||||
<div class="field">
|
||||
<label>分类</label>
|
||||
<input type="text" name="cate">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>标签</label>
|
||||
<input type="text" name="tags">
|
||||
</div>
|
||||
</div>
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
<label>排序</label>
|
||||
<input type="text" name="sort">
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui toggle checkbox" id="status_switch">
|
||||
<input type="checkbox" name="status_switch" checked="1">
|
||||
<label>状态</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" id="status" name="status" hidden>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>简介</label>
|
||||
<textarea rows="2" name="summary"></textarea>
|
||||
</div>
|
||||
|
||||
{% endblock%}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends '/customize/base-customize.html' %}
|
||||
{% block customize_header %}
|
||||
<div class="ui warning message">
|
||||
<div class="header">温馨提示</div>
|
||||
<ul>
|
||||
<li>该定制化服务仍处于测试与迭代研发阶段。</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2 class="ui header">便捷监控</h2>
|
||||
{% endblock%}
|
||||
{% block customize_table_th %}
|
||||
|
||||
{% endblock%}
|
||||
{% block customize_table_tr %}
|
||||
|
||||
{% endblock%}
|
||||
{% block customize_form %}
|
||||
|
||||
{% endblock%}
|
||||
@@ -0,0 +1,107 @@
|
||||
{% extends '/customize/base-customize.html' %}
|
||||
{% block customize_header %}
|
||||
<div class="ui warning message">
|
||||
<div class="header">温馨提示</div>
|
||||
<ul>
|
||||
<li>该定制化服务仍处于测试与迭代研发阶段。</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2 class="ui header">便捷导航</h2>
|
||||
<a class="ui mini negative left labeled icon button btn_add"><i class="undo icon"></i>新增</a>
|
||||
{% endblock%}
|
||||
{% block customize_table_th %}
|
||||
<th>图标</th>
|
||||
<th>名称</th>
|
||||
<th>地址</th>
|
||||
<th>分类</th>
|
||||
<th>标签</th>
|
||||
<th>类型</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
{% endblock%}
|
||||
{% block customize_table_tr %}
|
||||
{% for item in data_list %}
|
||||
<tr>
|
||||
<td class="left {{ item.color }} marked">
|
||||
<i class="{{ item.icon }}"></i>
|
||||
</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>
|
||||
<a class="ui icon button url" data-content="{{ item.url }}" href="{{ item.url }}" target="_blank">
|
||||
<i class="linkify icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ item.cate }}</td>
|
||||
<td>{{ item.tags }}</td>
|
||||
<td>{{ item.type }}</td>
|
||||
<td>{{ item.sort }}</td>
|
||||
<td>
|
||||
{% if item.status == 0 %}
|
||||
<i class="icon close red"></i>
|
||||
{% else %}
|
||||
<i class="icon checkmark green"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn_edit" data-id="{{ item.id }}">编辑</button>
|
||||
<button class="btn_delete" data-id="{{ item.id }}">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock%}
|
||||
{% block customize_form %}
|
||||
<input type="text" name="id" hidden>
|
||||
<input type="text" name="user_id" hidden>
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
<label>图标 <a class="ui mini blue text" href="/icon.html" target="_blank">图标选择</a></label>
|
||||
<input type="text" name="icon">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>颜色</label>
|
||||
<input type="text" name="color">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>名称</label>
|
||||
<input type="text" name="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>图片</label>
|
||||
<input type="text" name="img">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>地址</label>
|
||||
<input type="text" name="url">
|
||||
</div>
|
||||
<div class="fields">
|
||||
<input type="text" name="type" hidden>
|
||||
<div class="field">
|
||||
<label>分类</label>
|
||||
<input type="text" name="cate">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>标签</label>
|
||||
<input type="text" name="tags">
|
||||
</div>
|
||||
</div>
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
<label>排序</label>
|
||||
<input type="text" name="sort">
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui toggle checkbox" id="status_switch">
|
||||
<input type="checkbox" name="status_switch" checked="1">
|
||||
<label>状态</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" id="status" name="status" hidden>
|
||||
</div>
|
||||
<div class=" field">
|
||||
<label>简介</label>
|
||||
<textarea rows="2" name="summary"></textarea>
|
||||
</div>
|
||||
|
||||
{% endblock%}
|
||||
@@ -0,0 +1,77 @@
|
||||
{% extends '/customize/base-customize.html' %}
|
||||
{% block customize_header %}
|
||||
<div class="ui warning message">
|
||||
<div class="header">温馨提示</div>
|
||||
<ul>
|
||||
<li>该定制化服务仍处于测试与迭代研发阶段。</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2 class="ui header">快捷搜索</h2>
|
||||
<a class="ui mini negative left labeled icon button btn_add"><i class="undo icon"></i>新增</a>
|
||||
{% endblock%}
|
||||
{% block customize_table_th %}
|
||||
<th>图标</th>
|
||||
<th>名称</th>
|
||||
<th>地址</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
{% endblock%}
|
||||
{% block customize_table_tr %}
|
||||
{% for item in data_list %}
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ item.icon }}"></i>
|
||||
</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>
|
||||
<a class="ui icon button url" data-content="{{ item.url }}" href="{{ item.url }}" target="_blank">
|
||||
<i class="linkify icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ item.sort }}</td>
|
||||
<td>
|
||||
{% if item.status == 0 %}
|
||||
<i class="icon close red"></i>
|
||||
{% else %}
|
||||
<i class="icon checkmark green"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn_edit" data-id="{{ item.id }}">编辑</button>
|
||||
<button class="btn_delete" data-id="{{ item.id }}">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock%}
|
||||
{% block customize_form %}
|
||||
<input type="text" name="id" hidden>
|
||||
<input type="text" name="user_id" hidden>
|
||||
<div class="fields">
|
||||
<div class=" field">
|
||||
<label>图标 <a class="ui mini blue text" href="/icon.html" target="_blank">图标选择</a></label>
|
||||
<input type="text" name="icon">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>名称</label>
|
||||
<input type="text" name="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>地址</label>
|
||||
<input type="text" name="url">
|
||||
</div>
|
||||
<div class="fields">
|
||||
<div class=" field">
|
||||
<label>排序</label>
|
||||
<input type="text" name="sort">
|
||||
</div>
|
||||
<div class=" field">
|
||||
<div class="ui toggle checkbox" id="status_switch">
|
||||
<input type="checkbox" name="status_switch" checked="1">
|
||||
<label>状态</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" id="status" name="status" hidden>
|
||||
</div>
|
||||
{% endblock%}
|
||||
在新工单中引用
屏蔽一个用户