mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-09-21 19:29:22 +08:00
Not really sure this is the best structure
This commit is contained in:
9
src/nginxconfig/templates/domain_sections/https.vue
Normal file
9
src/nginxconfig/templates/domain_sections/https.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world https</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainHTTPS',
|
||||
};
|
||||
</script>
|
8
src/nginxconfig/templates/domain_sections/index.js
Normal file
8
src/nginxconfig/templates/domain_sections/index.js
Normal 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';
|
9
src/nginxconfig/templates/domain_sections/logging.vue
Normal file
9
src/nginxconfig/templates/domain_sections/logging.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world logging</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainLogging',
|
||||
};
|
||||
</script>
|
9
src/nginxconfig/templates/domain_sections/php.vue
Normal file
9
src/nginxconfig/templates/domain_sections/php.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world php</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainPHP',
|
||||
};
|
||||
</script>
|
9
src/nginxconfig/templates/domain_sections/presets.vue
Normal file
9
src/nginxconfig/templates/domain_sections/presets.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world presets</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainPresets',
|
||||
};
|
||||
</script>
|
9
src/nginxconfig/templates/domain_sections/python.vue
Normal file
9
src/nginxconfig/templates/domain_sections/python.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world python</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainPython',
|
||||
};
|
||||
</script>
|
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world reverse proxy</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainReverseProxy',
|
||||
};
|
||||
</script>
|
9
src/nginxconfig/templates/domain_sections/routing.vue
Normal file
9
src/nginxconfig/templates/domain_sections/routing.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div>Hello world routing</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DomainRouting',
|
||||
};
|
||||
</script>
|
71
src/nginxconfig/templates/domain_sections/server.vue
Normal file
71
src/nginxconfig/templates/domain_sections/server.vue
Normal 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>
|
Reference in New Issue
Block a user