add login page of oaer
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2019 light <veypi@light-laptop>
|
||||
*
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
import user from './user'
|
||||
import app from './app'
|
||||
import cfg from '../cfg'
|
||||
import ajax from './axios'
|
||||
import nats from './nats'
|
||||
import tsdb from './tsdb'
|
||||
|
||||
|
||||
const api = {
|
||||
nats: nats,
|
||||
tsdb: tsdb,
|
||||
user: user,
|
||||
app: app,
|
||||
info: () => {
|
||||
return ajax.get(cfg.BaseUrl() + '/info')
|
||||
},
|
||||
refresh_token: () => {
|
||||
ajax.post(cfg.BaseUrl() + '/app/' + cfg.uuid + '/token/', { app_id: cfg.uuid, token: cfg.refresh }).then(e => {
|
||||
cfg.token = e
|
||||
// bus.emit('sync', e)
|
||||
}).catch(e => {
|
||||
console.warn(e)
|
||||
// bus.emit('logout', 'get token failed ' + e)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export { api }
|
||||
export default api
|
||||
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* nats.ts
|
||||
* Copyright (C) 2023 veypi <i@veypi.com>
|
||||
* 2023-10-19 21:36
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
|
||||
import cfg from '../cfg'
|
||||
import ajax from './axios'
|
||||
|
||||
export default {
|
||||
local: () => cfg.BaseUrl() + '/nats/',
|
||||
general() {
|
||||
return ajax.get(this.local() + 'varz')
|
||||
},
|
||||
conns() {
|
||||
return ajax.get(this.local() + 'connz', { subs: true })
|
||||
},
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* tsdb.ts
|
||||
* Copyright (C) 2023 veypi <i@veypi.com>
|
||||
* 2023-10-20 23:21
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
|
||||
import cfg from '../cfg'
|
||||
import ajax from './axios'
|
||||
|
||||
export default {
|
||||
local: () => cfg.BaseUrl() + '/ts/',
|
||||
range(query: string, props?: { start?: string, end?: string, step?: string, query?: string }) {
|
||||
if (query !== undefined) {
|
||||
// @ts-ignore
|
||||
props.query = query
|
||||
} else {
|
||||
props = { query: query }
|
||||
}
|
||||
return ajax.get(this.local() + 'query_range', props)
|
||||
},
|
||||
query(query: string) {
|
||||
return ajax.get(this.local() + 'query', { query: query })
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* user.ts
|
||||
* Copyright (C) 2023 veypi <i@veypi.com>
|
||||
* 2023-10-05 15:37
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
import ajax from './axios'
|
||||
import cfg from '../cfg'
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
local: () => cfg.BaseUrl() + '/user/',
|
||||
search(q: string) {
|
||||
return ajax.get(this.local(), { username: q })
|
||||
},
|
||||
get(id: number) {
|
||||
return ajax.get(this.local() + id)
|
||||
},
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* animate.css
|
||||
* Copyright (C) 2024 veypi
|
||||
*
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
@keyframes scale-up {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scale-off {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-in {
|
||||
0% {
|
||||
transform: translateX(200%) scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0) scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,242 @@
|
||||
/*
|
||||
* oaer.css
|
||||
* Copyright (C) 2024 veypi
|
||||
*
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
@import "./animate.scss";
|
||||
|
||||
.voa {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.voa-off {
|
||||
}
|
||||
.voa-on {
|
||||
border-radius: 100%;
|
||||
background: #999;
|
||||
animation: scale-up 100ms ease-out forwards;
|
||||
}
|
||||
:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.voa-scale-off {
|
||||
transform-origin: center center;
|
||||
animation: scale-off 200ms ease-out forwards !important;
|
||||
}
|
||||
.voa-scale-up {
|
||||
animation: scale-up 200ms ease-in;
|
||||
}
|
||||
|
||||
.hover-line-b {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0.1em;
|
||||
background-color: #000;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
&:hover::after {
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.voa-modal {
|
||||
user-select: none;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
translate: -50% -50%;
|
||||
padding: 2rem;
|
||||
z-index: 10000;
|
||||
width: 40%;
|
||||
min-width: 20rem;
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 2rem;
|
||||
background-color: rgba(240, 240, 240, 0.5);
|
||||
backdrop-filter: blur(20px); /* 模糊效果 */
|
||||
z-index: -1;
|
||||
}
|
||||
.header {
|
||||
line-height: 2rem;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
.voa-logo {
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
}
|
||||
.txt {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
.username,
|
||||
.password {
|
||||
margin: 2rem 0;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
input {
|
||||
height: 2.5rem;
|
||||
line-height: 2.5rem;
|
||||
font-size: 1.5rem;
|
||||
width: 100%;
|
||||
margin: 0 1rem;
|
||||
border: none;
|
||||
outline: none;
|
||||
background: none;
|
||||
}
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 1rem;
|
||||
width: calc(100% - 2rem);
|
||||
height: 0.1em;
|
||||
background-color: #000;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
&:hover::after {
|
||||
left: 0%;
|
||||
width: 100%;
|
||||
background-color: #00ffff;
|
||||
}
|
||||
}
|
||||
.ok {
|
||||
cursor: pointer;
|
||||
line-height: 3rem;
|
||||
font-size: 1.5rem;
|
||||
height: 3rem;
|
||||
margin: 2rem auto;
|
||||
width: 40%;
|
||||
background: #0a0;
|
||||
border-radius: 1.5rem;
|
||||
}
|
||||
.last {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 1rem;
|
||||
height: 3rem;
|
||||
.icos {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
div {
|
||||
opacity: 0.5;
|
||||
cursor: pointer;
|
||||
height: 2rem;
|
||||
width: 2rem;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.github {
|
||||
background-image: url("../img/github.svg");
|
||||
}
|
||||
.google {
|
||||
background-image: url("../img/google.svg");
|
||||
}
|
||||
.wechat {
|
||||
background-image: url("../img/wechat.svg");
|
||||
}
|
||||
}
|
||||
.txt {
|
||||
height: 1.5rem;
|
||||
line-height: 1.5rem;
|
||||
font-size: 1rem;
|
||||
div {
|
||||
cursor: pointer;
|
||||
opacity: 0.5;
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.close {
|
||||
height: 2rem;
|
||||
width: 2rem;
|
||||
position: absolute;
|
||||
opacity: 0.5;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
cursor: pointer;
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#voa-mask {
|
||||
position: fixed;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 999;
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255, 255, 255, 0.01); /* 半透明白色遮罩 */
|
||||
backdrop-filter: blur(1px); /* 模糊效果 */
|
||||
}
|
||||
}
|
||||
|
||||
.voa-logo {
|
||||
background-image: url("../favicon.svg");
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.voa-btn {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
display: block;
|
||||
border: none;
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
transition: 0.3s;
|
||||
}
|
||||
&:active::after {
|
||||
box-shadow: 0 1px 0px 0px rgba(0, 0, 0, 0.5);
|
||||
/* opacity: 0; */
|
||||
}
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,6 @@
|
||||
<svg t="1721966078152" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="2830" width="200" height="200">
|
||||
<path
|
||||
d="M768 256h-85.333333v384c0 42.666667-7.68 69.973333-42.666667 83.2L405.333333 810.666667V256c0-29.866667 10.24-81.066667 64-75.093333L768 213.333333V161.706667L384 90.026667C368.64 87.04 356.693333 85.333333 341.333333 85.333333c-54.613333 0-85.333333 33.28-85.333333 85.333334v698.453333c0 67.413333 58.453333 80.64 85.333333 69.546667l384-157.013334c42.666667-17.493333 42.666667-56.32 42.666667-98.986666V256z"
|
||||
fill="#00ffff" p-id="2831"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 623 B |
@ -0,0 +1,6 @@
|
||||
<svg t="1722237445743" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="2681" width="200" height="200">
|
||||
<path
|
||||
d="M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9 23.5 23.2 38.1 55.4 38.1 91v112.5c0.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"
|
||||
p-id="2682"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 852 B |
@ -0,0 +1,6 @@
|
||||
<svg t="1722237398153" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="2534" width="200" height="200">
|
||||
<path
|
||||
d="M881 442.4H519.7v148.5h206.4c-8.9 48-35.9 88.6-76.6 115.8-34.4 23-78.3 36.6-129.9 36.6-99.9 0-184.4-67.5-214.6-158.2-7.6-23-12-47.6-12-72.9s4.4-49.9 12-72.9c30.3-90.6 114.8-158.1 214.7-158.1 56.3 0 106.8 19.4 146.6 57.4l110-110.1c-66.5-62-153.2-100-256.6-100-149.9 0-279.6 86-342.7 211.4-26 51.8-40.8 110.4-40.8 172.4S151 632.8 177 684.6C240.1 810 369.8 896 519.7 896c103.6 0 190.4-34.4 253.8-93 72.5-66.8 114.4-165.2 114.4-282.1 0-27.2-2.4-53.3-6.9-78.5z"
|
||||
p-id="2535"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 652 B |
@ -0,0 +1,9 @@
|
||||
<svg t="1722237471862" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="2828" width="200" height="200">
|
||||
<path
|
||||
d="M690.1 377.4c5.9 0 11.8 0.2 17.6 0.5-24.4-128.7-158.3-227.1-319.9-227.1C209 150.8 64 271.4 64 420.2c0 81.1 43.6 154.2 111.9 203.6 5.5 3.9 9.1 10.3 9.1 17.6 0 2.4-0.5 4.6-1.1 6.9-5.5 20.3-14.2 52.8-14.6 54.3-0.7 2.6-1.7 5.2-1.7 7.9 0 5.9 4.8 10.8 10.8 10.8 2.3 0 4.2-0.9 6.2-2l70.9-40.9c5.3-3.1 11-5 17.2-5 3.2 0 6.4 0.5 9.5 1.4 33.1 9.5 68.8 14.8 105.7 14.8 6 0 11.9-0.1 17.8-0.4-7.1-21-10.9-43.1-10.9-66 0-135.8 132.2-245.8 295.3-245.8z m-194.3-86.5c23.8 0 43.2 19.3 43.2 43.1s-19.3 43.1-43.2 43.1c-23.8 0-43.2-19.3-43.2-43.1s19.4-43.1 43.2-43.1z m-215.9 86.2c-23.8 0-43.2-19.3-43.2-43.1s19.3-43.1 43.2-43.1 43.2 19.3 43.2 43.1-19.4 43.1-43.2 43.1z"
|
||||
p-id="2829"></path>
|
||||
<path
|
||||
d="M866.7 792.7c56.9-41.2 93.2-102 93.2-169.7 0-124-120.8-224.5-269.9-224.5-149 0-269.9 100.5-269.9 224.5S540.9 847.5 690 847.5c30.8 0 60.6-4.4 88.1-12.3 2.6-0.8 5.2-1.2 7.9-1.2 5.2 0 9.9 1.6 14.3 4.1l59.1 34c1.7 1 3.3 1.7 5.2 1.7 2.4 0 4.7-0.9 6.4-2.6 1.7-1.7 2.6-4 2.6-6.4 0-2.2-0.9-4.4-1.4-6.6-0.3-1.2-7.6-28.3-12.2-45.3-0.5-1.9-0.9-3.8-0.9-5.7 0.1-5.9 3.1-11.2 7.6-14.5zM600.2 587.2c-19.9 0-36-16.1-36-35.9 0-19.8 16.1-35.9 36-35.9s36 16.1 36 35.9c0 19.8-16.2 35.9-36 35.9z m179.9 0c-19.9 0-36-16.1-36-35.9 0-19.8 16.1-35.9 36-35.9s36 16.1 36 35.9c-0.1 19.8-16.2 35.9-36 35.9z"
|
||||
p-id="2830"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* animate.css
|
||||
* Copyright (C) 2024 veypi
|
||||
*
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
@keyframes scale-up {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scale-off {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* oaer.css
|
||||
* Copyright (C) 2024 veypi
|
||||
*
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
@import './animate.scss';
|
||||
|
||||
.voa {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.voa-off{
|
||||
}
|
||||
.voa-on {
|
||||
border-radius: 100%;
|
||||
background: #999;
|
||||
animation: scale-up 100ms ease-out forwards;
|
||||
}
|
||||
:hover{
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.voa-animate-off-scale-off {
|
||||
animation: scale-off 100ms ease-out forwards;
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
<svg t="1721966078152" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="2830" width="200" height="200">
|
||||
<path
|
||||
d="M768 256h-85.333333v384c0 42.666667-7.68 69.973333-42.666667 83.2L405.333333 810.666667V256c0-29.866667 10.24-81.066667 64-75.093333L768 213.333333V161.706667L384 90.026667C368.64 87.04 356.693333 85.333333 341.333333 85.333333c-54.613333 0-85.333333 33.28-85.333333 85.333334v698.453333c0 67.413333 58.453333 80.64 85.333333 69.546667l384-157.013334c42.666667-17.493333 42.666667-56.32 42.666667-98.986666V256z"
|
||||
fill="#00ffff" p-id="2831"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 623 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |