mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
Use client-side config files to config things
This commit is contained in:
parent
ca4932e2b4
commit
c6e4ea8349
4 changed files with 18 additions and 30 deletions
|
@ -44,7 +44,7 @@ possible hacks
|
|||
<div id="top-content">
|
||||
<header class="flex border-b border-gray-900 border-solid shadow-md">
|
||||
<h1 class="text-gray-400">
|
||||
😈 Owncast
|
||||
😈 {{title}}
|
||||
</h1>
|
||||
|
||||
<div id="user-options-container" class="flex">
|
||||
|
@ -99,16 +99,8 @@ possible hacks
|
|||
<div id="user-content" class="user-content">
|
||||
|
||||
<!-- USER CONTENT... -->
|
||||
<div>
|
||||
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
|
||||
<br />
|
||||
<div v-html="description"></div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -121,16 +113,7 @@ possible hacks
|
|||
<div id="user-content-touch" class="user-content">
|
||||
|
||||
<!-- USER CONTENT... -->
|
||||
<div>
|
||||
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
|
||||
<br />
|
||||
|
||||
</div>
|
||||
<div>
|
||||
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
|
||||
|
||||
|
||||
</div>
|
||||
<div v-html="description"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function setupApp() {
|
||||
async function setupApp() {
|
||||
Vue.filter('plural', function (string, count) {
|
||||
if (count === 1) {
|
||||
return string;
|
||||
|
@ -15,6 +15,8 @@ function setupApp() {
|
|||
sessionMaxViewerCount: 0,
|
||||
overallMaxViewerCount: 0,
|
||||
messages: [],
|
||||
description: "",
|
||||
title: "",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -25,7 +27,9 @@ function setupApp() {
|
|||
var appMessagingMisc = new Messaging();
|
||||
appMessagingMisc.init();
|
||||
|
||||
const config = new Config();
|
||||
const config = await new Config().init();
|
||||
app.description = autoLink(config.description, { embed: false });
|
||||
app.title = config.title;
|
||||
}
|
||||
|
||||
async function getStatus() {
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
class Config {
|
||||
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
async init() {
|
||||
const configFileLocation = "./js/config.json";
|
||||
|
||||
|
@ -11,6 +6,7 @@ class Config {
|
|||
const response = await fetch(configFileLocation);
|
||||
const configData = await response.json();
|
||||
Object.assign(this, configData);
|
||||
return this;
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
// No config file present. That's ok. It's not required.
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"title": "Title",
|
||||
"logo": "https://vignette.wikia.nocookie.net/animalcrossing/images/b/b3/NH-character-Blathers.png/revision/latest?cb=20200229053519",
|
||||
"color": "#276749"
|
||||
"title": "Owncast Demo Server",
|
||||
"logo": "/img/logo.png",
|
||||
"description": "This is a demo server for Owncast. You can read more about it at owncast.online. You can edit this description in your web config file. <br><br>Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.",
|
||||
"tags": [
|
||||
"music",
|
||||
"software",
|
||||
"animal crossing"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue