sweetalert2

django搭建一个小型的服务器运维网站-用户登陆与session

試著忘記壹切 提交于 2019-12-05 17:07:44
目录 项目介绍和源码 ; 拿来即用的bootstrap模板 ; 服务器SSH服务配置与python中paramiko的使用 ; 用户登陆与session; 最简单的实践之修改服务器时间 ; 查看和修改服务器配置与数据库的路由 ; 基于websocket的实时日志实现 ; 查看服务器中的日志与前端的datatable的利用 ; 重启服务器进程 。 前言   这篇文章给出了网站的用户登陆模块,用户登录模块的网站后台实现主要通过Django权限系统auth来实现,相关逻辑可与参考 这篇文章 。作为一个网站新手,前后端交互基本上都是自己造轮子,利用javascript和ajax完成,登陆模块包括:用户登陆、用户注册、忘记密码,其中忘记密码是用简单的用户名+邮箱来验证的,时间充裕,可以进一步的通过发邮件链接跳转验证修改密码,图1简单描述了这个系统的结构。除此之外,这篇文章会涉及到第三方模态框sweetalert2的引用、给网页增加icon、对网页增加登陆验证、session保存登陆的用户名等小细节的完善。 功能实现   前面文章已经提到,登陆网站时会优先进入登陆页面,进入app界面是由url控制的。先看下如何显示出登陆界面,这里依然秉承拿来即用的思想,把DASHGUM源文件夹的login.html文件改造下并将其重新命名为loginpage.html放在templates目录下

How to use sweetalert2 in angular2

独自空忆成欢 提交于 2019-12-04 09:21:40
问题 Getting this error after npm start in angular project. app/app.component.ts(12,7): error TS2304: Cannot find name 'swal'. app/app.component.ts(21,7): error TS2304: Cannot find name 'swal'. I created an angular project. Inside app.component.ts I added sweet alert code export class AppComponent { deleteRow() { swal({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33',

More than 2 buttons on sweetalert 2

自作多情 提交于 2019-12-03 06:04:32
问题 I have a sweetalert with 2 buttons but I want to have one more button in it. For example, as of now, I have yes and no I want to add one more button say later. please help $("#close_account").on("click", function(e) { e.preventDefault(); swal({ title: "Are you sure?", text: "You will not be able to open your account!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, close my account!", closeOnConfirm: false }, function(){ window.location.href="

How to use sweetalert2 in angular2

廉价感情. 提交于 2019-12-03 01:55:34
Getting this error after npm start in angular project. app/app.component.ts(12,7): error TS2304: Cannot find name 'swal'. app/app.component.ts(21,7): error TS2304: Cannot find name 'swal'. I created an angular project. Inside app.component.ts I added sweet alert code export class AppComponent { deleteRow() { swal({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then(function() { swal( 'Deleted!', 'Your file has been deleted.', 'success'

Uncaught (in promise) cancel using SweetAlert2

我的梦境 提交于 2019-11-30 07:56:05
问题 how do I properly escape the cancel button without throwing an error when using promises? My code throws an alert confirmation with a required checkbox. the code executes as it should to the user, but it throws an error in the console window: Uncaught (in promise) cancel //validation logic all passes...Now proceed to... else { //determine and parse Discounts var myLookup = document.getElementsByName("myLookup")[0].value; $.post( "findthem.php", {myLookup: myLookup }) .done(function(json_data)

Uncaught (in promise) cancel using SweetAlert2

廉价感情. 提交于 2019-11-29 05:48:18
how do I properly escape the cancel button without throwing an error when using promises? My code throws an alert confirmation with a required checkbox. the code executes as it should to the user, but it throws an error in the console window: Uncaught (in promise) cancel //validation logic all passes...Now proceed to... else { //determine and parse Discounts var myLookup = document.getElementsByName("myLookup")[0].value; $.post( "findthem.php", {myLookup: myLookup }) .done(function(json_data){ var theResponse1 = $.parseJSON(json_data); myDiscountRate = theResponse1['ourDiscountFound']; }).then

SweetAlert2

百般思念 提交于 2019-11-28 01:58:38
1.SweetAlert2 1.1快速部署 国内SweetAlert2cdn https://www.bootcdn.cn/limonte-sweetalert2/ SweetAlert部署文件 https://pan.baidu.com/s/1BFXctrsgE_26HJU3XT1lcg 1.2SweetAlert2官方文档 https://sweetalert2.github.io/#examples 1.3一.前言 SweetAlert2是一款功能强大的纯Js模态消息对话框插件。SweetAlert2用于替代浏览器默认的弹出对话框,它提供各种参数和方法,支持嵌入图片,背景,HTML标签等,SweetAlert2是SweetAlert-js的升级版本,它解决了SweetAlert-js中不能嵌入HTML标签的问题,并对弹出对话框进行了优化,同时提供对各种表单元素的支持,还增加了5种情景模式的模态对话框,功能非常强大。 官方文档: https://sweetalert2.github.io/ 1.4 基本使用 1.对话框 (1) 基础对话框 Swal('hello world') (2)或者多参数设置对话框 swal({ title: '提示', text: "早上好", confirmButtonText: '确认', confirmButtonColor: 'Green',

sweetalert2 弹窗插件

南笙酒味 提交于 2019-11-27 11:58:30
SweetAlert2 是一个漂亮、响应式、可定制、易用的(WAI-ARIA) JavaScript 弹窗 https://www.npmjs.com/package/sweetalert2 更多例子 https://sweetalert2.github.io/ 来源: https://www.cnblogs.com/sulanlan/p/11361625.html