bunch of API changes
This commit is contained in:
45
res/include/script/form.vue
Normal file
45
res/include/script/form.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
Vue.component("vform", {
|
||||
template: `
|
||||
<h2>TEST FORM</h2>
|
||||
<form class="highlight_dark" method="POST">
|
||||
<table class="form">
|
||||
<tbody>
|
||||
<tr class="form">
|
||||
<td>Old Password</td>
|
||||
<td>
|
||||
<input id="input_old_password" name="old_password" value="" type="password" autocomplete="current-password" class="form_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form"></tr>
|
||||
<td>New Password</td>
|
||||
<td>
|
||||
<input id="input_new_password1" name="new_password1" value="" type="password" autocomplete="new-password" class="form_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form">
|
||||
<td>New Password again</td>
|
||||
<td>
|
||||
<input id="input_new_password2" name="new_password2" value="" type="password" autocomplete="new-password" class="form_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form">
|
||||
<td colspan="2">
|
||||
we need you to repeat your password so you won't be locked out of your account if you make a typing error
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form">
|
||||
<td colspan="2" style="text-align: right;">
|
||||
<input type="submit" value="Submit" class="button_highlight" style="float: right;">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
`
|
||||
})
|
||||
|
||||
Vue.component("form_field", {
|
||||
template: `
|
||||
|
||||
`
|
||||
})
|
3
res/include/script/user_settings.vue
Normal file
3
res/include/script/user_settings.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
const appTestForm = new Vue({
|
||||
el: "#test_form"
|
||||
})
|
11965
res/static/script/vue.js
Normal file
11965
res/static/script/vue.js
Normal file
File diff suppressed because it is too large
Load Diff
6
res/static/script/vue.min.js
vendored
Normal file
6
res/static/script/vue.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -49,15 +49,21 @@
|
||||
|
||||
let breadcrumbs = document.querySelector("#nav_bar > .breadcrumbs")
|
||||
|
||||
if (window.location.href.endsWith("?files")) {
|
||||
breadcrumbs.value = "/{{.Username}}/Files"
|
||||
fm.getUserFiles()
|
||||
} else if (window.location.href.endsWith("?lists")) {
|
||||
breadcrumbs.value = "/{{.Username}}/Lists"
|
||||
fm.getUserLists()
|
||||
} else {
|
||||
alert("invalid file manager type")
|
||||
let hashChange = () => {
|
||||
if (window.location.hash === "#files") {
|
||||
breadcrumbs.value = "/{{.Username}}/Files"
|
||||
fm.getUserFiles()
|
||||
} else if (window.location.hash === "#lists") {
|
||||
breadcrumbs.value = "/{{.Username}}/Lists"
|
||||
fm.getUserLists()
|
||||
} else {
|
||||
alert("invalid file manager type")
|
||||
}
|
||||
}
|
||||
|
||||
hashChange()
|
||||
|
||||
window.addEventListener("hashchange", hashChange)
|
||||
})
|
||||
</script>
|
||||
{{template "analytics"}}
|
||||
|
57
res/template/account/user_settings_vue_test.html
Normal file
57
res/template/account/user_settings_vue_test.html
Normal file
@@ -0,0 +1,57 @@
|
||||
{{define "user_settings_vue_test"}}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" .Username}}
|
||||
{{template "user_style" .}}
|
||||
<script>var apiEndpoint = '{{.APIEndpoint}}';</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<h1>{{.Title}}</h1>
|
||||
<div class="page_content"><div class="limit_width">
|
||||
<h2>TEST FORM</h2>
|
||||
<form id="test_form" class="highlight_dark" method="POST">
|
||||
<table class="form">
|
||||
<tr class="form">
|
||||
<td>Old Password</td>
|
||||
<td>
|
||||
<input id="input_old_password" name="old_password" value="" type="password" autocomplete="current-password" class="form_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form"></tr>
|
||||
<td>New Password</td>
|
||||
<td>
|
||||
<input id="input_new_password1" name="new_password1" value="" type="password" autocomplete="new-password" class="form_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form">
|
||||
<td>New Password again</td>
|
||||
<td>
|
||||
<input id="input_new_password2" name="new_password2" value="" type="password" autocomplete="new-password" class="form_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form">
|
||||
<td colspan="2">
|
||||
we need you to repeat your password so you won't be locked out of your account if you make a typing error
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form">
|
||||
<td colspan="2" style="text-align: right;">
|
||||
<input type="submit" value="Submit" class="button_highlight" style="float: right;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{{template "form" .Other.PasswordForm}}
|
||||
{{template "form" .Other.EmailForm}}
|
||||
{{template "form" .Other.UsernameForm}}
|
||||
</div></div>
|
||||
{{template "page_bottom" .}}
|
||||
{{template "analytics"}}
|
||||
|
||||
{{template "vue"}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
@@ -52,17 +52,17 @@
|
||||
{{end}}
|
||||
</td>
|
||||
{{end}}
|
||||
{{if or (ne $field.Description "") (eq $field.Separator true)}}
|
||||
<tr class="form">
|
||||
<td colspan="2">
|
||||
{{$field.Description}}
|
||||
{{if eq $field.Separator true}}
|
||||
<hr/>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{if or (ne $field.Description "") (eq $field.Separator true)}}
|
||||
<tr class="form">
|
||||
<td colspan="2">
|
||||
{{$field.Description}}
|
||||
{{if eq $field.Separator true}}
|
||||
<hr/>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<tr class="form">
|
||||
{{if eq .BackLink ""}}
|
||||
|
@@ -1,10 +0,0 @@
|
||||
{{define "tpl_file_button"}}
|
||||
<template id="tpl_file_button">
|
||||
<a class="file_button" target="_blank">
|
||||
<img src="/api/file/xWwGvj9f/thumbnail?width=80&height=80" alt="24000.jpg" />
|
||||
<span style="color: var(--highlight_color);">24000.jpg</span>
|
||||
<br/>
|
||||
2020-01-20 10:06:56
|
||||
</a>
|
||||
</template>
|
||||
{{end}}
|
@@ -18,3 +18,8 @@ pixeldrain also supports previews for images, videos, audio, PDFs and much more.
|
||||
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
{{end}}
|
||||
{{define "vue"}}{{if debugMode}}
|
||||
<script src="/res/script/vue.js"></script>
|
||||
{{else}}
|
||||
<script src="/res/script/vue.min.js"></script>
|
||||
{{end}}{{end}}
|
||||
|
@@ -4,8 +4,8 @@
|
||||
<a href="/">Home</a>
|
||||
<hr />
|
||||
{{if .Authenticated}}<a href="/user">{{.Username}}</a>
|
||||
<a href="/user/filemanager?files">My Files</a>
|
||||
<a href="/user/filemanager?lists">My Lists</a>
|
||||
<a href="/user/filemanager#files">My Files</a>
|
||||
<a href="/user/filemanager#lists">My Lists</a>
|
||||
<a href="/logout">Log out</a>
|
||||
{{else}}
|
||||
<a href="/login">Login</a>
|
||||
|
Reference in New Issue
Block a user