Not really sure this is the best structure

This commit is contained in:
MattIPv4
2020-04-27 22:07:31 +01:00
parent 6467d10f85
commit 4c22ba571a
13 changed files with 222 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world https</div>
</template>
<script>
export default {
name: 'DomainHTTPS',
};
</script>

View File

@@ -0,0 +1,8 @@
export { default as Presets } from './presets';
export { default as Server } from './server';
export { default as HTTPS } from './https';
export { default as PHP } from './php';
export { default as Python } from './python';
export { default as ReverseProxy } from './reverse_proxy';
export { default as Routing } from './routing';
export { default as Logging } from './logging';

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world logging</div>
</template>
<script>
export default {
name: 'DomainLogging',
};
</script>

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world php</div>
</template>
<script>
export default {
name: 'DomainPHP',
};
</script>

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world presets</div>
</template>
<script>
export default {
name: 'DomainPresets',
};
</script>

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world python</div>
</template>
<script>
export default {
name: 'DomainPython',
};
</script>

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world reverse proxy</div>
</template>
<script>
export default {
name: 'DomainReverseProxy',
};
</script>

View File

@@ -0,0 +1,9 @@
<template>
<div>Hello world routing</div>
</template>
<script>
export default {
name: 'DomainRouting',
};
</script>

View File

@@ -0,0 +1,71 @@
<template>
<div>Hello world server</div>
</template>
<script>
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
// Create the store of values
const store = new Vuex.Store({
state: {
path: {
default: '',
},
documentRoot: {
default: '',
},
wwwSubdomain: {
default: false,
},
cdnSubdomain: {
default: false,
},
redirectSubdomains: {
default: true,
},
},
mutations: {
setPath(state, value) {
state.path.value = value;
},
setDocumentRoot(state, value) {
state.documentRoot.value = value;
},
setWwwSubdomain(state, value) {
state.wwwSubdomain.value = value;
},
setCdnSubdomain(state, value) {
state.cdnSubdomain.value = value;
},
setRedirectSubdomains(state, value) {
state.redirectSubdomains.value = value;
},
},
});
// Set the values to defaults
Object.keys(store.state).forEach(key => {
store.state[key].value = store.state[key].value || store.state[key].default;
});
export default {
name: 'DomainServer',
store,
computed: {
...Object.keys(store.state).reduce((prev, current) => {
prev[current] = {
get () {
return this.$store.state[current].value;
},
set (value) {
this.$store.commit(`set${current.slice(0, 1).toUpperCase()}${current.slice(1)}`, value);
},
};
return prev;
}, {}),
},
};
</script>