Integrate config.js on the frontend
This commit is contained in:
parent
92cb70f1a4
commit
1bcd350b20
1
admin.go
1
admin.go
|
@ -12,7 +12,6 @@ import (
|
|||
|
||||
type configScript struct {
|
||||
RootURL string `json:"rootURL"`
|
||||
UploadURI string `json:"uploadURI"`
|
||||
FromEmail string `json:"fromEmail"`
|
||||
Messengers []string `json:"messengers"`
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ export default Vue.extend({
|
|||
form: {
|
||||
name: '',
|
||||
subject: '',
|
||||
fromEmail: '',
|
||||
fromEmail: window.CONFIG.fromEmail,
|
||||
templateId: 0,
|
||||
lists: [],
|
||||
tags: [],
|
||||
|
|
Loading…
Reference in New Issue