Integrate config.js on the frontend

This commit is contained in:
Kailash Nadh 2020-07-04 23:37:23 +05:30
parent 92cb70f1a4
commit 1bcd350b20
4 changed files with 13 additions and 2 deletions

View File

@ -12,7 +12,6 @@ import (
type configScript struct { type configScript struct {
RootURL string `json:"rootURL"` RootURL string `json:"rootURL"`
UploadURI string `json:"uploadURI"`
FromEmail string `json:"fromEmail"` FromEmail string `json:"fromEmail"`
Messengers []string `json:"messengers"` Messengers []string `json:"messengers"`
} }

View File

@ -7,6 +7,7 @@
<link rel="icon" href="<%= BASE_URL %>frontend/favicon.png" /> <link rel="icon" href="<%= BASE_URL %>frontend/favicon.png" />
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" rel="stylesheet" />
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script src="<%= BASE_URL %>api/config.js"></script>
</head> </head>
<body> <body>
<noscript> <noscript>

View File

@ -77,6 +77,16 @@
<div class="main"> <div class="main">
<router-view :key="$route.fullPath" /> <router-view :key="$route.fullPath" />
</div> </div>
<b-loading v-if="!isLoaded" active>
<div class="has-text-centered">
<h1 class="title">Oops</h1>
<p>
Can't connect to the listmonk backend.<br />
Make sure it is running and refresh this page.
</p>
</div>
</b-loading>
</div> </div>
</template> </template>
@ -90,6 +100,7 @@ export default Vue.extend({
return { return {
activeItem: {}, activeItem: {},
activeGroup: {}, activeGroup: {},
isLoaded: window.CONFIG,
}; };
}, },

View File

@ -159,7 +159,7 @@ export default Vue.extend({
form: { form: {
name: '', name: '',
subject: '', subject: '',
fromEmail: '', fromEmail: window.CONFIG.fromEmail,
templateId: 0, templateId: 0,
lists: [], lists: [],
tags: [], tags: [],