mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-02-06 11:55:37 +08:00
阶段性提交
This commit is contained in:
38
web/views/@default/index/index.css
Normal file
38
web/views/@default/index/index.css
Normal file
@@ -0,0 +1,38 @@
|
||||
.form-box {
|
||||
position: fixed;
|
||||
top: 2.5em;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
form {
|
||||
position: fixed;
|
||||
width: 21em;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -10em;
|
||||
margin-top: -16em;
|
||||
}
|
||||
form .header {
|
||||
text-align: center;
|
||||
font-size: 1em !important;
|
||||
}
|
||||
form p {
|
||||
font-size: 0.8em;
|
||||
margin-top: 0.3em;
|
||||
margin-bottom: 0;
|
||||
font-weight: normal;
|
||||
padding: 0;
|
||||
}
|
||||
form .comment {
|
||||
margin-top: 0.5em;
|
||||
padding: 0.5em;
|
||||
color: gray;
|
||||
}
|
||||
@media screen and (max-width: 512px) {
|
||||
form {
|
||||
width: 80%;
|
||||
margin-left: -40%;
|
||||
}
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
web/views/@default/index/index.css.map
Normal file
1
web/views/@default/index/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACI,eAAA;EACA,UAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;;AAGJ;EACI,eAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,kBAAA;EACA,iBAAA;;AANJ,IAQC;EACC,kBAAA;EACA,yBAAA;;AAVF,IAaC;EACC,gBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,UAAA;;AAlBF,IAqBC;EACC,iBAAA;EACA,cAAA;EACA,WAAA;;AASD,mBALoC;EACjC;IACI,UAAA;IACA,iBAAA","file":"index.css"}
|
||||
58
web/views/@default/index/index.html
Normal file
58
web/views/@default/index/index.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!doctype html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.png"/>
|
||||
<title>登录Edge管理员系统</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
|
||||
{$TEA.VUE}
|
||||
{$TEA.SEMANTIC}
|
||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||
<script type="text/javascript" src="/js/utils.js"></script>
|
||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
{$template "/menu"}
|
||||
|
||||
|
||||
<div class="form-box">
|
||||
<form class="ui form" data-tea-action="$" data-tea-before="submitBefore" data-tea-done="submitDone" data-tea-success="submitSuccess" autocomplete="off">
|
||||
<input type="hidden" name="password" v-model="passwordMd5"/>
|
||||
<input type="hidden" name="token" v-model="token"/>
|
||||
<div class="ui segment stacked">
|
||||
<div class="ui header">
|
||||
登录Edge管理员系统
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<div class="ui left icon input">
|
||||
<i class="ui user icon"></i>
|
||||
<input type="text" name="username" v-model="username" placeholder="请输入用户名" maxlength="200" ref="usernameRef"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<div class="ui left icon input">
|
||||
<i class="ui lock icon"></i>
|
||||
<input type="password" v-model="password" placeholder="请输入密码" maxlength="200" @input="changePassword()" ref="passwordRef"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<a href="" @click.prevent="showMoreOptions()">更多选项 <i class="icon angle" :class="{down:!moreOptionsVisible, up:moreOptionsVisible}"></i> </a>
|
||||
</div>
|
||||
<div class="ui field" v-show="moreOptionsVisible">
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="remember" value="1" checked="checked"/>
|
||||
<label>在这个电脑上记住登录(14天)</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="ui button primary fluid" type="submit" v-if="!isSubmitting">登录</button>
|
||||
<button class="ui button primary fluid disabled" type="submit" v-if="isSubmitting">登录中...</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
39
web/views/@default/index/index.js
Normal file
39
web/views/@default/index/index.js
Normal file
@@ -0,0 +1,39 @@
|
||||
Tea.context(function () {
|
||||
this.username = "";
|
||||
this.password = "";
|
||||
this.passwordMd5 = "";
|
||||
this.encodedFrom = window.encodeURIComponent(this.from);
|
||||
|
||||
this.isSubmitting = false;
|
||||
|
||||
this.$delay(function () {
|
||||
this.$find("form input[name='username']").focus();
|
||||
this.changePassword();
|
||||
});
|
||||
|
||||
this.changePassword = function () {
|
||||
this.passwordMd5 = md5(this.password.trim());
|
||||
};
|
||||
|
||||
// 更多选项
|
||||
this.moreOptionsVisible = false;
|
||||
this.showMoreOptions = function () {
|
||||
this.moreOptionsVisible = !this.moreOptionsVisible;
|
||||
};
|
||||
|
||||
this.submitBefore = function () {
|
||||
this.isSubmitting = true;
|
||||
};
|
||||
|
||||
this.submitDone = function () {
|
||||
this.isSubmitting = false;
|
||||
};
|
||||
|
||||
this.submitSuccess = function () {
|
||||
if (this.from.length == 0) {
|
||||
window.location = "/dashboard";
|
||||
} else {
|
||||
window.location = this.from;
|
||||
}
|
||||
};
|
||||
});
|
||||
42
web/views/@default/index/index.less
Normal file
42
web/views/@default/index/index.less
Normal file
@@ -0,0 +1,42 @@
|
||||
.form-box {
|
||||
position: fixed;
|
||||
top: 2.5em;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
position: fixed;
|
||||
width: 21em;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -10em;
|
||||
margin-top: -16em;
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
font-size: 1em !important;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 0.8em;
|
||||
margin-top: 0.3em;
|
||||
margin-bottom: 0;
|
||||
font-weight: normal;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.comment {
|
||||
margin-top: 0.5em;
|
||||
padding: 0.5em;
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 512px) {
|
||||
form {
|
||||
width: 80%;
|
||||
margin-left: -40%;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user