当前位置: 首页 > wzjs >正文

一个网站需要多少空间公众号模板制作精美

一个网站需要多少空间,公众号模板制作精美,erp系统是什么软件有哪些,织梦网站开发语言whttpserver 是一个简单的HTTP服务器,类似于python -m http.server,但增加了文件上传和编辑的功能。 1. 安装 whttpserver 模块 # 临时设置环境变量 PYTHONUTF81,强制 Python 使用 UTF-8 编码 set PYTHONUTF81 pip install whttpserver 2.…

whttpserver 是一个简单的HTTP服务器,类似于python -m http.server,但增加了文件上传和编辑的功能。

1. 安装 whttpserver 模块
# 临时设置环境变量 PYTHONUTF8=1,强制 Python 使用 UTF-8 编码
set PYTHONUTF8=1
pip install whttpserver
2. 启动服务
whttpserver --port <服务器监听的端口号,默认为25000> --dir <"文件上传和下载的根目录"> --debug <True or False>

启动信息如下:

在浏览器地址栏中,输入 http://127.0.0.1:8181/

3. 定制模板

可以看到,默认的页面比较简陋,我们可以修改下模板文件,让它看起来更美观一些。

模板文件路径为:%python安装目录%/Lib/site-packages/whttpserver/templates/index.html

修改后的 index.html 文件内容如下:

<!DOCTYPE html>
<html lang="zh">
<head><title>Directory listing for {{the_path}}</title><style>* {margin: 0;padding: 0;box-sizing: border-box;}body {font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);color: #2c3e50;min-height: 100vh;padding: 20px;overflow: hidden; /* 确保整个页面无滚动条 */display: flex;flex-direction: column;}.header {display: flex;justify-content: space-between;align-items: center;margin-bottom: 25px;padding-bottom: 15px;border-bottom: 1px solid rgba(44, 62, 80, 0.1);}.breadcrumb {display: flex;align-items: center;gap: 8px;font-size: 18px;}.breadcrumb a {color: #3498db;text-decoration: none;transition: all 0.3s ease;padding: 5px 10px;border-radius: 4px;}.breadcrumb a:hover {background: rgba(52, 152, 219, 0.1);transform: translateY(-2px);}.breadcrumb span {color: #7f8c8d;}.upload-section {background: white;border-radius: 12px;padding: 20px;box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);margin-bottom: 25px;}.upload-form {display: flex;gap: 15px;align-items: center;}.file-input {flex: 1;padding: 12px 15px;border: 2px dashed #3498db;border-radius: 8px;background: rgba(52, 152, 219, 0.05);font-size: 16px;cursor: pointer;}.refresh-btn {background: #009688;color: white;border: none;padding: 12px 25px;border-radius: 8px;font-weight: 600;cursor: pointer;transition: all 0.3s ease;box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);}.upload-btn {background: #3498db;color: white;border: none;padding: 12px 25px;border-radius: 8px;font-weight: 600;cursor: pointer;transition: all 0.3s ease;box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);}.upload-btn:hover {background: #2980b9;transform: translateY(-2px);box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);}.messages {margin-top: 15px;padding: 10px;border-radius: 6px;background: rgba(46, 204, 113, 0.1);color: #27ae60;display: none;}.uploading-message {margin-top: 10px;color: #3498db;font-style: italic;}.table-container {background: white;border-radius: 12px;overflow: hidden;box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);flex: 1;display: flex;flex-direction: column;max-height: calc(100vh - 300px); /* 确保表格高度适应屏幕 */}.table-header {padding: 20px;border-bottom: 1px solid rgba(44, 62, 80, 0.1);}.table-header h3 {font-size: 22px;color: #2c3e50;}.table-scroll {overflow-y: auto;max-height: calc(100vh - 320px); /* 确保表格内容不超出视口 */}/* 隐藏滚动条但保留功能 */.table-scroll::-webkit-scrollbar {width: 0;height: 0;}table {width: 100%;border-collapse: separate;border-spacing: 0;font-size: 15px;}th {background: #f8f9fa;color: #7f8c8d;font-weight: 600;text-align: left;padding: 15px 20px;position: sticky;top: 0;border-bottom: 2px solid #ecf0f1;}td {padding: 12px 20px;border-bottom: 1px solid #ecf0f1;}tr:hover td {background: rgba(236, 240, 241, 0.5);}.file a {color: #27ae60;text-decoration: none;font-weight: 500;transition: all 0.2s ease;}.dir a {color: #3498db;text-decoration: none;font-weight: 500;transition: all 0.2s ease;}.file a:hover, .dir a:hover {text-decoration: underline;opacity: 0.9;}.footer {text-align: center;padding: 20px;color: #7f8c8d;font-size: 14px;margin-top: 20px;border-top: 1px solid rgba(44, 62, 80, 0.1);}</style>
</head>
<body><div class="header"><div class="breadcrumb"><a href="/">根目录</a><span>›</span><a href="{{ parent_path }}">上一级</a></div><h3><input type="button" value="刷 新" class="refresh-btn" onclick="javascript: location.href = location.href;"></h3><h3>文件目录管理器</h3></div><div class="upload-section"><form class="upload-form" method="post" action="/upload?path={{req_path}}" enctype="multipart/form-data" target="hidden_iframe" onsubmit="return addMessage();"><input type="file" name="file" class="file-input"><input type="submit" value="上传文件" class="upload-btn" onclick="showUploadingMessage();"></form><div id="messages" class="messages"></div><div id="uploadingMessage" class="uploading-message" style="display:none;">正在上传文件,请稍候...</div></div><div class="table-container"><div class="table-header"><h4>当前目录: {{the_path}}</h4></div><div class="table-scroll"><table><thead><tr><th>文件名称</th><th>文件类别</th><th>文件大小</th><th>访问权限</th><th>所属用户</th><th>所属组</th>                <th>最后修改时间</th></tr></thead><tbody>{% for item in data %}<tr class="{{ item.type }}"><td><a href="{{ item.href }}" class="{{ item.type }}">{{ item.name }}</a></td><td>{{ item.type }}</td><td>{{ item.size }}</td><td>{{ item.permissions }}</td><td>{{ item.owner }}</td><td>{{ item.group }}</td><td>{{ item.mtime }}</td></tr>{% endfor %}</tbody></table></div></div><div class="footer"><p>文件目录管理系统 | 优雅简洁的文件浏览体验</p></div><iframe name="hidden_iframe" id="hidden_iframe" style="display:none;"></iframe><script type="text/javascript">function showUploadingMessage() {document.getElementById('uploadingMessage').style.display = 'block';}function addMessage() {var iframe = document.getElementById('hidden_iframe');iframe.onload = function() {var content = iframe.contentDocument || iframe.contentWindow.document;var message = content.body.innerHTML;var messagesDiv = document.getElementById('messages');messagesDiv.innerHTML = '<p>' + message + '</p>';messagesDiv.style.display = 'block';document.getElementById('uploadingMessage').style.display = 'none';// 3秒后隐藏消息setTimeout(function() {messagesDiv.style.display = 'none';location.href = location.href;}, 3000);};return true;}</script>
</body>
</html>

新模板的页面效果如下:

 

🏷️ 如有疑问,可以关注 我的知识库,直接提问即可。 

http://www.dtcms.com/wzjs/796806.html

相关文章:

  • 传奇电脑版知名seo公司
  • 360网页游戏哈尔滨seo优化教程
  • p2p做网站视频制作平台
  • 大庆市让胡路区规划建设局网站湖南省建设工程造价管理站网站
  • 如何降低网站跳出率网络下载的网站模板能直接上传到虚拟主机
  • wordpress站点图标精准软件
  • 做内贸要在哪个网站找客户百度广州给做网站公司
  • 网站建设哪个公司做得好wordpress 手机端
  • 吉林省招标网官方网站wordpress右边小工具栏
  • 注册德国网站域名网站优化关键词
  • 什么软件做网站做好如何建设正规彩票网站
  • 网站建设公众号管理网站创意
  • 苏州做网站公司找苏州聚尚网络公众号开发者密钥有什么用
  • 温州企业网站排名优化郑州app制作开发
  • 网站建设一般多少钱比较合适网站建设与网页设计从入门到精通 素材下载
  • 重庆大学建设管理与房地产学院网站杭州建设信用平台
  • 厦门企业网站建设公司用vs2012怎么做网站
  • ip下的网站吗山东建设管理局网站
  • 做外贸需要有自己的网站吗网站建站授权模板下载
  • 微网站建设价格百度下载app下载
  • 查网站空间商怎样利用互联网进行网络推广
  • 网站建设专家论证会网站做淘宝客
  • 数据交易网站开发中国建设银行英语网站
  • 天津网站营销建设部资质申报网站
  • 如何做好网站关键词布局asp net做购物网站
  • 室内设计网站大全网站简单的网站设计开发
  • 网站建设确认函seo的课谁讲的好
  • 免费网站统计工具百度营销后台
  • h5网站还有哪些深圳建材公司app
  • 买完域名后怎么搭建个人网站长春网络公司营销模式