Remove assets directory, race condition.

This commit is contained in:
Gabriel Simmer 2022-03-19 13:39:17 +00:00
parent 4964e4e0f4
commit 07969a9338
14 changed files with 1 additions and 603 deletions

View file

@ -1 +0,0 @@
{"Name":"Pogo Podcast","Host":"John Doe","Email":"johndoe@localhost","Description":"A Podcast About Stuff","Image":"localhost:3000/assets/podcastimage.png","PodcastUrl":"http://localhost:3000"}

View file

@ -1,7 +0,0 @@
# What is this?!
This is the _development version_ (DeV) of the web interface for Pogo.
It is not recommended you use this for your own deployment, and instead rely on the auto-setup feature of the binary. If you still insist manually deploying your own binary, please consider downloading the latest `webassets.zip` release from [gmemstr/pogo-vue](https://github.com/gmmestr/pogo-vue/releases/latest), which contains the production version of the Vue.js interface. The interface in this repository should be considered "canary" or "nightly", and for testing routes and features during development. Thanks!
~ Gabe

View file

@ -1 +0,0 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Pogo LAUNCHPAD (Admin)</title><link href=/static/css/app.2c4137b696e2d4b140b031b27d7e5a1a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.f80f6e311dcc9285e615.js></script><script type=text/javascript src=/static/js/vendor.5973cf24864eecc78c48.js></script><script type=text/javascript src=/static/js/app.1261f4d104eef89553c2.js></script></body></html>

View file

@ -1 +0,0 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Pogo (Loading)</title><link href=/static/css/app.d30c73e61cece4af1cf90f7dfb3c4e01.css rel=stylesheet></head><body><div id=app></div><script></script><script type=text/javascript src=/static/js/manifest.d89179d976625d3cea09.js></script><script type=text/javascript src=/static/js/vendor.c5c1444b51671198fd20.js></script><script type=text/javascript src=/static/js/app.415e639459f313d89125.js></script></body></html>

View file

@ -1,25 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login to Pogo Admin Page</title>
<link rel="stylesheet" href="/assets/setup.css">
</head>
<body>
<h1>Login</h1>
<form action="login" method="post" class="setupform">
<label for="username">Username</label>
<input type="text" id="podcastname" name="username">
<label for="userpassword">Password</label>
<input type="password" id="podcasthost" name="password">
<input type="submit" value="Submit">
</form>
</body>
</html>

View file

@ -1,384 +0,0 @@
const episodepublishform = {
template: `<div>
<h3>Publish Episode</h3>
<form enctype="multipart/form-data" action="/admin/publish" method="post" class="publish">
<label for="title">Episode Title</label>
<input type="text" id="title" name="title">
<label for="description">Episode Description</label>
<textarea name="description" id="description" style="resize: none;" class="epdesc"></textarea>
<label for="file">Media File</label>
<input type="file" id="file" name="file">
<label for="date">Publish Date</label>
<input type="date" id="date" name="date"><br /><br />
<input type="submit" value="Publish" class="button">
</form>
</div>`
}
const message = {
template: `<div><h3>{{ this.$route.params.message }}</h3></div>`
}
const userlist = {
template: `<div>
<router-link :to="\'users/new\'" tag="button">New</router-link>
<table>
<tr>
<th>Username</th>
<th>Email</th>
<th></th>
</tr>
<tr v-for="item in items">
<td>{{ item.username }}</td>
<td>{{ item.email }}</td>
<td>
<router-link :to="\'user/\' + item.id" class="button">Edit</router-link>
</td>
</tr>
</table>
</div>`,
data() {
return {
loading: false,
items: null,
error: null
}
},
created() {
// fetch the data when the view is created and the data is
// already being observed
this.fetchData()
},
watch: {
// call again the method if the route changes
'$route': 'fetchData'
},
methods: {
fetchData() {
this.error = this.items = []
this.loading = true
get("/admin/listusers", (err, items) => {
this.loading = false
if (err) {
this.error = err.toString()
} else {
var t = JSON.parse(items).reverse();
for (var i = t.length - 1; i >= 0; i--) {
this.items.push({
id: t[i].id,
username: t[i].username,
email: t[i].email,
})
}
}
})
}
}
}
const usernew = {
template: `<div>
<div>
<h3>New User</h3>
<form enctype="multipart/form-data" action="/admin/adduser" method="post">
<label for="username">Username</label>
<input type="text" id="username" name="username">
<label for="email">Email</label>
<input type="text" id="email" name="email">
<label for="realname">Real Name</label>
<input type="text" id="realname" name="realname">
<label for="password">New Password</label>
<input type="password" id="password" name="password">
<label for="permissions">Permission Level</label>
<select name="permissions">
<option value="0">Publishing only</option>
<option value="1">Publishing and Episode Management</option>
<option value="2">Publishing, Episode and User management</option>
</select>
<br /><br />
<input type="submit" class="button" value="Save"></form>
</div>
</div>`
}
const useredit = {
template: `<div>
<div>
<h3>Edit User</h3>
<form enctype="multipart/form-data" action="/admin/edituser" method="post">
<label for="username">Username</label>
<input type="text" id="username" name="username" :value="user.username">
<label for="email">Email</label>
<input type="text" id="email" name="email" :value="user.email">
<label for="realname">Real Name</label>
<input type="text" id="realname" name="realname" :value="user.realname">
<label for="newpw1">New Password</label>
<input type="password" id="newpw1" name="newpw1">
<label for="newpw2">Repeat New Password</label>
<input type="password" id="newpw2" name="newpw2">
<label for="oldpw">Old Password</label>
<input type="password" id="oldpw" name="oldpw">
<br/><br/>
<select name="permissions">
<option value="0">Publishing only</option>
<option value="1">Publishing and Episode Management</option>
<option value="2">Publishing, Episode and User management</option>
</select>
<input name="id" id="id" :value="user.id" type="hidden">
<br /><br />
<input type="submit" class="button" value="Save" class="button"></form>
<a v-bind:href="'/admin/deleteuser/'+user.id+''" class="button">Delete User</a>
</div>
</div>`,
data() {
return {
loading: false,
user: null,
error: null
}
},
created() {
// fetch the data when the view is created and the data is
// already being observed
this.fetchData()
},
watch: {
// call again the method if the route changes
'$route': 'fetchData'
},
methods: {
fetchData() {
this.error = this.user = []
this.loading = true
get("/admin/listusers", (err, items) => {
this.loading = false
if (err) {
this.error = err.toString()
} else {
var t = JSON.parse(items)
for (var i = t.length - 1; i >= 0; i--) {
if (t[i].id == this.$route.params.id) {
this.user = {
id: t[i].id,
username: t[i].username,
email: t[i].email,
realname: t[i].realname
}
}
}
}
})
}
}
}
const episodemanagement = {
template: `<div>
<table style="width:100%">
<tr>
<th>Title</th>
<th>URL</th>
<th></th>
</tr>
<tr v-for="item in items">
<td>{{ item.id }}: {{ item.title }}</td><td>{{ item.url }}</td><td><router-link class="button" :to="\'edit/\' + item.id">Edit</router-link></td>
</tr>
</table>
</div>`,
data() {
return {
loading: false,
items: null,
error: null
}
},
created() {
// fetch the data when the view is created and the data is
// already being observed
this.fetchData()
},
watch: {
// call again the method if the route changes
'$route': 'fetchData'
},
methods: {
fetchData() {
this.error = this.items = []
this.loading = true
get("/json", (err, items) => {
this.loading = false
if (err) {
this.error = err.toString()
} else {
var t = JSON.parse(items).items
for (var i = t.length - 1; i >= 0; i--) {
console.log(i)
this.items.push({
title: t[i].title,
url: t[i].url,
id: t[i].id
})
}
}
})
}
}
}
const episodeedit = {
template: `<div>
<div>
<h3>Edit Episode</h3>
<form enctype="multipart/form-data" action="/admin/edit" method="post">
<label for="title">Episode Title</label>
<input type="text" id="title" name="title" :value="episode.title">
<label for="description">Episode Description</label>
<textarea name="description" id="description" cols="100" rows="20" style="resize: none;">{{ episode.description }}</textarea>
<label for="date">Publish Date</label>
<input type="date" id="date" name="date" :value="episode.time">
<input name="previousfilename" id="previousfilename" :value="episode.previousfilename" type="hidden">
<input type="submit" class="button" value="Publish"></form>
</div>
</div>`,
data() {
return {
loading: false,
episode: null,
error: null
}
},
created() {
// fetch the data when the view is created and the data is
// already being observed
this.fetchData()
},
watch: {
// call again the method if the route changes
'$route': 'fetchData'
},
methods: {
fetchData() {
this.error = this.episode = {}
this.loading = true
get("/json", (err, items) => {
this.loading = false
if (err) {
this.error = err.toString()
} else {
var t = JSON.parse(items).items
for (var i = t.length - 1; i >= 0; i--) {
if (t[i].id == this.$route.params.id) {
time = t[i].date_published.split("T")
var prev = time[0] + "_" + t[i].title
this.episode = {
title: t[i].title,
description: t[i].summary,
url: t[i].url,
id: t[i].id,
time: time[0],
previousfilename: prev
}
}
}
}
console.log(this.episode)
})
}
}
}
const customcss = {
template: `<div>
<h3>Theme</h3>
<form action="/admin/css" method="post" enctype="multipart/form-data">
<textarea spellcheck="false" name="css" id="css" cols="120" rows="20" class="css">{{ css }}</textarea>
<br /><br />
<input type="submit" class="button" value="Submit" class="button">
</form>
</div>`,
data() {
return {
loading: false,
css: null,
error: null
}
},
created() {
// fetch the data when the view is created and the data is
// already being observed
this.fetchData()
},
watch: {
// call again the method if the route changes
'$route': 'fetchData'
},
methods: {
fetchData() {
this.error = this.css = null
this.loading = true
get("/admin/css", (err, css) => {
this.loading = false
if (css == "{}") {
this.css = "You aren't allowed to edit this CSS!"
} else {
if (err) {
this.error = err.toString()
} else {
this.css = css
}
}
})
}
}
}
const routes = [
{path: '/', redirect: '/publish'},
{ path: '/publish', component: episodepublishform },
{ path: '/manage', component: episodemanagement },
{ path: '/theme', component: customcss },
{ path: '/edit/:id', component: episodeedit },
{ path: '/users/', component: userlist },
{ path: '/msg/:message', component: message },
{ path: '/user/:id', component: useredit },
{ path: '/users/new', component: usernew }
]
const router = new VueRouter({
routes
})
const app = new Vue({
router,
data: {
header: 'Pogo Admin',
}
}).$mount('#app')
function get(url,callback) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
if (xmlHttp.responseText == "Unauthorized") {
callback(null, "{}")
} else {
callback(null, xmlHttp.responseText)
}
}
}
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
function logout() {
document.cookie = "POGO_SESSION=;expires=Thu, 01 Jan 1970 00:00:01 GMT";
window.location = "/";
}

View file

@ -1,39 +0,0 @@
/*
* This is the file of custom CSS styling that
* can be set by the publisher.
*
* If you're writing the custom CSS, please see the reference:
* https://github.com/gmemstr/Pogo/wiki/Custom-CSS/
*/
.container {} /* Basic container from styles.css */
.title {} /* Page title */
.adminlink { /* Link to admin interface */
margin-left:100%;
display:inline-block;
margin-bottom: 10px;
background-color: #397AD6;
border: none;
color: white;
padding: 5px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
-webkit-transition:.52s;
-moz-transition: .5s;
-o-transition: .5s;
-ms-transition: .5s;
transition:.5s;
}
.adminlink:hover {
background-color: #50B7D5;
}
.podcastlist {} /* Chronological podcast list */
.podcastitem {} /* Single podcast item (group of elements) */
.podcasttitle {} /* Title of podcast item */
.podcastdate {} /* Date podcast item was published */
.podcastdesc {} /* Podcast item description */
.podcastaudio {} /* Podcast <audio> tag */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View file

@ -1,24 +0,0 @@
body {
font-family: 'Roboto', Monospace;
background-color: #3c3c3c;
color: white;
}
.setupform {
text-align: center;
}
label {
display: block;
}
input,textarea {
margin-bottom: 10px;
padding: 10px;
border: 1px;
border-radius: 5px;
}
textarea {
resize: none;
}

View file

@ -1,120 +0,0 @@
/*
* Basic CSS styling for frontend and admin interface.
* Overridden by styles in custom.css for the podcast list.
*/
@import url('https://fonts.googleapis.com/css?family=Muli');
body {
font-family: 'Muli', sans-serif;
margin:0; padding:0;
}
h1,h2,h3,h4,h5 {
font-weight: 400;
}
.podcastlist {
padding-bottom: 10%;
}
.container {
margin: 0 auto;
padding: 0 2.0rem;
position: relative;
width: 60vw;
height: 100%;
}
button, .button {
margin-bottom: 10px;
background-color: #397AD6;
border: none;
color: white;
padding: 5px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
-webkit-transition:.52s;
-moz-transition: .5s;
-o-transition: .5s;
-ms-transition: .5s;
transition:.5s;
}
button:hover, .button:hover {
background-color: #50B7D5;
}
footer {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: .25rem;
color: #f9f9f9;
background-color: #397AD6;
text-align: center;
}
table {
text-align: left;
width: 100%;
}
nav a {
margin-bottom: 10px;
background-color: #397AD6;
border: none;
color: white;
padding: 5px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
-webkit-transition:.52s;
-moz-transition: .5s;
-o-transition: .5s;
-ms-transition: .5s;
transition:.5s;
}
nav a:hover {
background-color: #50B7D5;
}
.podcast {
width:70%;
}
label {
display: block;
}
.admin {
text-align: center;
}
hr {
max-width: 40%;
}
.notifications {
margin:0; padding:10px;
font-size: 130%;
height: 1.5vw;
text-align: center;
}
.css {
font-family: Monospace;
}
input[type=text], input[type=date], input[type=file], input[type=password],textarea, select {
padding:10px;
border-radius: 4px;
box-sizing: border-box;
border: 1px solid #397AD6;
}
.publish [type=text],
.publish input[type=date],
.publish input[type=file],
.publish input[type=password],
.publish textarea {
width: 100%;
}
.publish textarea {
height: 30vh;
}
.epdesc {
font-family: 'Muli', sans-serif;
}

View file

@ -37,7 +37,7 @@ func Setup() {
WriteSkeletonConfig()
// Generate neccesary feed files
go GenerateRss()
GenerateRss()
// Create "first run" lockfile when function exits
// defer LockFile()