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 {
RootURL string `json:"rootURL"`
UploadURI string `json:"uploadURI"`
FromEmail string `json:"fromEmail"`
Messengers []string `json:"messengers"`
}

View File

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

View File

@ -77,6 +77,16 @@
<div class="main">
<router-view :key="$route.fullPath" />
</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>
</template>
@ -90,6 +100,7 @@ export default Vue.extend({
return {
activeItem: {},
activeGroup: {},
isLoaded: window.CONFIG,
};
},

View File

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