feat: move /first_install to vue component (#3485)

This commit is contained in:
dni ⚡
2025-11-10 11:17:29 +01:00
committed by GitHub
parent 8755984bd8
commit f8c58aef0e
13 changed files with 205 additions and 166 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+36
View File
@@ -341,3 +341,39 @@ video {
.q-dialog__inner--minimized {
padding: 12px;
}
.first-install {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}
.first-install .grid {
display: block;
}
.first-install .hero-wrapper {
display: none;
}
.first-install .hero {
display: block;
height: 100%;
max-width: 250px;
background-image: url(/static/images/logos/lnbits.svg);
background-position: center;
background-size: contain;
background-repeat: no-repeat;
}
@media (min-width: 992px) {
.first-install .grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 1rem;
}
.first-install .hero-wrapper {
display: block;
position: relative;
height: 100%;
padding: 1rem;
}
}
+5
View File
@@ -188,6 +188,11 @@ const routes = [
path: '/extensions',
name: 'Extensions',
component: PageExtensions
},
{
path: '/first_install',
name: 'FirstInstall',
component: PageFirstInstall
}
]
+37
View File
@@ -0,0 +1,37 @@
window.PageFirstInstall = {
template: '#page-first-install',
mixins: [window.windowMixin],
data() {
return {
loginData: {
isPwd: true,
isPwdRepeat: true,
username: '',
password: '',
passwordRepeat: ''
}
}
},
computed: {
checkPasswordsMatch() {
return this.loginData.password !== this.loginData.passwordRepeat
}
},
methods: {
async setPassword() {
try {
await LNbits.api.request('PUT', '/api/v1/auth/first_install', null, {
username: this.loginData.username,
password: this.loginData.password,
password_repeat: this.loginData.passwordRepeat
})
window.location.href = '/admin'
} catch (e) {
LNbits.utils.notifyApiError(e)
}
}
},
created() {
document.title = 'First Install - LNbits'
}
}
+37
View File
@@ -132,3 +132,40 @@ video {
.q-dialog__inner--minimized {
padding: 12px;
}
.first-install {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
.grid {
display: block;
}
.hero-wrapper {
display: none;
}
.hero {
display: block;
height: 100%;
max-width: 250px;
background-image: url(/static/images/logos/lnbits.svg);
background-position: center;
background-size: contain;
background-repeat: no-repeat;
}
@media (min-width: 992px) {
.grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 1rem;
}
.hero-wrapper {
display: block;
position: relative;
height: 100%;
padding: 1rem;
}
}
}
+1
View File
@@ -45,6 +45,7 @@
"components": [
"js/pages/extensions_builder.js",
"js/pages/extensions.js",
"js/pages/first-install.js",
"js/pages/payments.js",
"js/pages/node.js",
"js/pages/node-public.js",