首页 文章 精选 留言 我的

精选列表

搜索[模板引擎],共10000篇文章
优秀的个人博客,低调大师

django-adminlte-ui 1.4.0 发布, 基于 adminlte 的 Django 后台模板

django-adminlte-ui 1.4.0 发布啦 1.4.0 该版本新增了`ADMINLTE_SETTINGS`,详细配置参考:https://github.com/wuyue92tree/django-adminlte-ui/pull/6 文档地址:https://django-adminlte-ui.readthedocs.io/en/latest/guide/ 默认配置: ADMINLTE_SETTINGS = { 'demo': True, 'search_form': True, # 'skin': 'blue', # 'copyright': '<a href="https://github.com/wuyue92tree/django-adminlte-ui/tree/'+version+'">django-adminlte-ui '+version+'</a>', # 'navigation_expanded': True, # if you are use custom menu, which will not effective below! # 'show_apps': ['django_admin_settings', 'auth', 'main'], # 'main_navigation_app': 'django_admin_settings', # 'icons': { # 'myapp': { # 'shops': 'fa-shopping-cart', # 'products': 'fa-dollar', # } # } } 更新日志: feature#6addADMINLTE_SETTINGS; update menu render logic.

优秀的个人博客,低调大师

pyqt5 登录界面的实现模板(加强版2)

说明 本例,在登录界面第二版的基础上,增加了登录界面的记住密码功能和自动登录功能。 在实现这两个功能的时候,需要用到QSettings这个知识点。QSettings用起来还是很方便,很简单的,不细说了,直接看代码吧。 保存登录信息 # 保存登录信息 def save_login_info(self): settings = QSettings("config.ini", QSettings.IniFormat) #方法1:使用配置文件 #settings = QSettings("mysoft","myapp") #方法2:使用注册表 settings.setValue("account",self.lineEdit_account.text()) settings.setValue("password", self.lineEdit_password.text()) settings.setValue("remeberpassword", self.checkBox_remeberpassword.isChecked()) settings.setValue("autologin", self.checkBox_autologin.isChecked()) 初始化登录信息 # 初始化登录信息 def init_login_info(self): settings = QSettings("config.ini", QSettings.IniFormat) #方法1:使用配置文件 #settings = QSettings("mysoft","myapp") #方法2:使用注册表 the_account =settings.value("account") the_password = settings.value("password") the_remeberpassword = settings.value("remeberpassword") the_autologin = settings.value("autologin") ######## self.lineEdit_account.setText(the_account) if the_remeberpassword=="true" or the_remeberpassword==True: self.checkBox_remeberpassword.setChecked(True) self.lineEdit_password.setText(the_password) if the_autologin=="true" or the_autologin==True: self.checkBox_autologin.setChecked(True) if the_autologin == "true": #防止注销时,自动登录 threading.Timer(1, self.on_pushButton_enter_clicked).start() #self.on_pushButton_enter_clicked() 完整代码 【如下代码,完全复制,直接运行,即可使用】 import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import threading ################################################ #######创建主窗口 ################################################ class MainWindow(QMainWindow): windowList = [] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.setWindowTitle('主界面') self.showMaximized() # 创建菜单栏 self.createMenus() def createMenus(self): # 创建动作 注销 self.printAction1 = QAction(self.tr("注销"), self) self.printAction1.triggered.connect(self.on_printAction1_triggered) # 创建动作 退出 self.printAction2 = QAction(self.tr("退出"), self) self.printAction2.triggered.connect(self.on_printAction2_triggered) # 创建菜单,添加动作 self.printMenu = self.menuBar().addMenu(self.tr("注销和退出")) self.printMenu.addAction(self.printAction1) self.printMenu.addAction(self.printAction2) # 动作一:注销 def on_printAction1_triggered(self): self.close() dialog = logindialog(mode=1) if dialog.exec_()==QDialog.Accepted: the_window = MainWindow() self.windowList.append(the_window) #这句一定要写,不然无法重新登录 the_window.show() # 动作二:退出 def on_printAction2_triggered(self): self.close() # 关闭界面触发事件 def closeEvent(self, event): print(999999999) pass ################################################ #######对话框 ################################################ class logindialog(QDialog): def __init__(self,mode=0, *args, **kwargs): super().__init__(*args, **kwargs) self.mode = mode self.setWindowTitle('登录界面') self.resize(200, 200) self.setFixedSize(self.width(), self.height()) self.setWindowFlags(Qt.WindowCloseButtonHint) ###### 设置界面控件 self.frame = QFrame(self) self.verticalLayout = QVBoxLayout(self.frame) self.lineEdit_account = QLineEdit() self.lineEdit_account.setPlaceholderText("请输入账号") self.verticalLayout.addWidget(self.lineEdit_account) self.lineEdit_password = QLineEdit() self.lineEdit_password.setPlaceholderText("请输入密码") self.verticalLayout.addWidget(self.lineEdit_password) self.checkBox_remeberpassword = QCheckBox() self.checkBox_remeberpassword.setText("记住密码") self.verticalLayout.addWidget(self.checkBox_remeberpassword) self.checkBox_autologin = QCheckBox() self.checkBox_autologin.setText("自动登录") self.verticalLayout.addWidget(self.checkBox_autologin) self.pushButton_enter = QPushButton() self.pushButton_enter.setText("确定") self.verticalLayout.addWidget(self.pushButton_enter) self.pushButton_quit = QPushButton() self.pushButton_quit.setText("取消") self.verticalLayout.addWidget(self.pushButton_quit) ###### 绑定按钮事件 self.pushButton_enter.clicked.connect(self.on_pushButton_enter_clicked) self.pushButton_quit.clicked.connect(QCoreApplication.instance().quit) ####初始化登录信息 self.init_login_info() ####自动登录 self.timer = QTimer(self) self.timer.timeout.connect(self.goto_autologin) self.timer.setSingleShot(True) self.timer.start(1000) # 自动登录 def goto_autologin(self): if self.checkBox_autologin.isChecked()==True and self.mode == 0 : self.on_pushButton_enter_clicked() def on_pushButton_enter_clicked(self): # 账号判断 if self.lineEdit_account.text() == "": return # 密码判断 if self.lineEdit_password.text() == "": return ####### 保存登录信息 self.save_login_info() # 通过验证,关闭对话框并返回1 self.accept() # 保存登录信息 def save_login_info(self): settings = QSettings("config.ini", QSettings.IniFormat) #方法1:使用配置文件 #settings = QSettings("mysoft","myapp") #方法2:使用注册表 settings.setValue("account",self.lineEdit_account.text()) settings.setValue("password", self.lineEdit_password.text()) settings.setValue("remeberpassword", self.checkBox_remeberpassword.isChecked()) settings.setValue("autologin", self.checkBox_autologin.isChecked()) # 初始化登录信息 def init_login_info(self): settings = QSettings("config.ini", QSettings.IniFormat) #方法1:使用配置文件 #settings = QSettings("mysoft","myapp") #方法2:使用注册表 the_account =settings.value("account") the_password = settings.value("password") the_remeberpassword = settings.value("remeberpassword") the_autologin = settings.value("autologin") ######## self.lineEdit_account.setText(the_account) if the_remeberpassword=="true" or the_remeberpassword==True: self.checkBox_remeberpassword.setChecked(True) self.lineEdit_password.setText(the_password) if the_autologin=="true" or the_autologin==True: self.checkBox_autologin.setChecked(True) ################################################ #######程序入门 ################################################ if __name__ == "__main__": app = QApplication(sys.argv) dialog = logindialog(mode=0) if dialog.exec_()==QDialog.Accepted: the_window = MainWindow() the_window.show() sys.exit(app.exec_()) 本文如有帮助,敬请留言鼓励。本文如有错误,敬请留言改进。 更新备注 2019.3.6更新 优化了自动登录机制,老的自动登录机制存在BUG

优秀的个人博客,低调大师

openstack 命令行管理九 - flavor管理[主机模板] (备忘)

 帮助 [root@station140 tmp(keystone_admin)]# nova help | grep flavor flavor-access-add Add flavor access for the given tenant. flavor-access-list Print access information about the given flavor. flavor-access-remove Remove flavor access for the given tenant. flavor-create Create a new flavor flavor-delete Delete a specific flavor flavor-key Set or unset extra_spec for a flavor. flavor-list Print a list of available 'flavors' (sizes of flavor-show Show details about the given flavor. volume-type-delete Delete a specific flavor 创建自定义 flavor [root@station140 tmp(keystone_admin)]# nova flavor-create m1.vcomputer 6 2048 20 1 +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+ | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+ | 6 | m1.vcomputer | 2048 | 20 | 0 | | 1 | 1.0 | True | +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+ 列出 [root@station140 tmp(keystone_admin)]# nova flavor-list +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+ | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+ | 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True | | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True | | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True | | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True | | 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True | | 6 | m1.vcomputer | 2048 | 10 | 0 | | 1 | 1.0 | True | +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+ 查询一下 tenant ID [root@station140 ~(keystone_admin)]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | 9467f30b8bba4770a06a687e4584636b | cloud | True | +----------------------------------+----------+---------+ 创建后需要分配到对应的 project [root@station140 tmp(keystone_admin)]# nova flavor-access-add 6 9467f30b8bba4770a06a687e4584636b +-----------+----------------------------------+ | Flavor_ID | Tenant_ID | +-----------+----------------------------------+ | 6 | 9467f30b8bba4770a06a687e4584636b | +-----------+----------------------------------+ 注意下面错误信息 [root@station140 tmp(keystone_admin)]# nova flavor-access-list --flavor 6 <- 不针对 public 哟 ERROR: Failed to get access list for public flavor type.

优秀的个人博客,低调大师

标杆客户实践提炼:CFlow 版本价值流模板实战指南

随着数字化转型加深,软件研发涉及越来越多业务和跨部门协作场景,企业希望通过有效的工具和方法管理软件价值交付流程。传统看板工具只能体现需求状态,流程覆盖不全无法体现实际交付过程。市面上大多数产品价值流与工具链脱节仅基于状态生成图表无法管理交付过程。企业需要从零开始搭建价值流,缺乏经验借鉴和基础框架。将价值流与现有工具链集成成本高昂,建设时间长。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册