work
This commit is contained in:
parent
9a5d97caad
commit
d78b0fe8a2
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"node": true,
|
||||
"esversion": 8
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"trailingComma": "none",
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"proseWrap": "always"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
baseURL = "http://example.org/"
|
||||
languageCode = "en-us"
|
||||
title = "cdadmin"
|
||||
disableKinds = ["RSS"]
|
||||
|
||||
[permalinks]
|
||||
pages = "/:filename/"
|
|
@ -0,0 +1,119 @@
|
|||
---
|
||||
title: Sign In
|
||||
type: page
|
||||
---
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-box;
|
||||
display: flex;
|
||||
-ms-flex-align: center;
|
||||
-ms-flex-pack: center;
|
||||
-webkit-box-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: center;
|
||||
justify-content: center;
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.app {
|
||||
width: 100%;
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.form-signin .checkbox {
|
||||
font-weight: 400;
|
||||
}
|
||||
.form-signin .form-control {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.form-signin .form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
.form-signin input[type='email'] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.form-signin input[type='password'] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="app">
|
||||
<form class="form-signin text-center" @submit="submit($event)">
|
||||
<label for="inputEmail" class="sr-only">Email address</label>
|
||||
<input
|
||||
type="email"
|
||||
id="inputEmail"
|
||||
class="form-control"
|
||||
placeholder="Email address"
|
||||
required
|
||||
autofocus
|
||||
v-model="email"
|
||||
/>
|
||||
<br />
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">
|
||||
Sign in
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script src="/axios.js"></script>
|
||||
<script src="/vue.js"></script>
|
||||
<script src="/messages.js"></script>
|
||||
<script>
|
||||
var app = new Vue({
|
||||
data: {
|
||||
email: ''
|
||||
},
|
||||
methods: {
|
||||
submit: function (ev) {
|
||||
var _this = this;
|
||||
if (ev) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
axios
|
||||
.post('/api/authentication/signin', {
|
||||
email: _this.email
|
||||
})
|
||||
.then(function (response) {})
|
||||
.catch(function (error) {
|
||||
console.log(_this.email);
|
||||
window.postMessage('Something went wrong. Please try again.');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
var token = window.localStorage.getItem('token');
|
||||
if (token) {
|
||||
axios
|
||||
.get('/api/authentication/me', {
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + token
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
window.location.href = '/';
|
||||
})
|
||||
.catch(function (error) {
|
||||
window.localStorage.removeItem('token');
|
||||
app.$mount('.app');
|
||||
});
|
||||
} else {
|
||||
app.$mount('.app');
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}">
|
||||
{{ partial "head.html" . }}
|
||||
<body>
|
||||
<!-- prettier-ignore -->
|
||||
{{ block "main" . }}
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
list
|
|
@ -0,0 +1 @@
|
|||
default single
|
|
@ -0,0 +1 @@
|
|||
{{ define "main" }} {{ .Content }} {{ end }}
|
|
@ -0,0 +1 @@
|
|||
<link rel="stylesheet" href="/bootstrap.min.css" />
|
|
@ -0,0 +1,5 @@
|
|||
<header class="header">
|
||||
<div class="container">
|
||||
<h1>cdadmin</h1>
|
||||
</div>
|
||||
</header>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "html",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "^0.20.0",
|
||||
"bootstrap": "^4.5.2",
|
||||
"vue": "^2.6.12"
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
list
|
|
@ -0,0 +1 @@
|
|||
list
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<url>
|
||||
<loc>http://example.org/categories/</loc>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>http://example.org/</loc>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>http://example.org/signin/</loc>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>http://example.org/tags/</loc>
|
||||
</url>
|
||||
|
||||
</urlset>
|
|
@ -0,0 +1 @@
|
|||
list
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,14 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
var app = new Vue({
|
||||
data: {
|
||||
messages: []
|
||||
}
|
||||
});
|
||||
|
||||
window.cdadmin = window.cdadmin || {};
|
||||
window.cdadmin.pushMessage = function (str) {
|
||||
window.alert(str);
|
||||
};
|
||||
})();
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue