Skip to content

Commit

Permalink
Add prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
sn123 committed Apr 5, 2020
1 parent c034562 commit 9eafb1c
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 160 deletions.
39 changes: 20 additions & 19 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint"
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
}
};
root: true,
env: {
node: true
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint"
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"@typescript-eslint/ban-ts-ignore": "off"
}
};
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"prod": "vue-cli-service build --prod && cp -r dist/js/ ../ && cp -r dist/css/ .. && cp dist/index.html ../views/index.html"
},
"dependencies": {
"apexcharts": "3.17.1",
Expand Down
Binary file added client/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions client/src/components/SlideshowWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ export default class SlideshowWidget extends Vue {
}
get containerStyle() {
return {
background: this.item.url ? `url(${this.item.url}) no-repeat` : "#1446a0"
background: this.item && this.item.url ? `url(${this.item.url}) no-repeat` : "#1446a0"
};
}
cycle() {
console.log("model is", this.model);
if (!this.model || !this.model.items || this.model.items.length === 0) {
return;
}
Expand All @@ -49,8 +48,7 @@ export default class SlideshowWidget extends Vue {
if (!item) {
return;
}
console.log("item is", item);
Vue.set(this.item, "url", item.url);
this.item = {...item};
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion client/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const BaseUrl = "http://localhost:8090/";
export const BaseUrl = "/";
3 changes: 1 addition & 2 deletions client/src/eventsink/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from "vue";
import { VueConstructor } from "vue/types/umd";
import { BaseUrl } from "../constants";
const eventUrl = `${BaseUrl}events/dunno`;
const eventUrl = `${BaseUrl}events/dashboard`;
type VueSSE = VueConstructor<Vue> & {
SSE: (
url: string,
Expand All @@ -21,7 +21,6 @@ export class EventSink {
withCredentials: true
});
this.server.subscribe("", (message: any) => {
console.log("received ", message);
onMessage(message);
});
}
Expand Down
1 change: 1 addition & 0 deletions client/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vue from "vue";
import App from "./App.vue";
import store from "./store/";
// @ts-ignore
import VueSSE from "vue-sse";
import VueApexCharts from "vue-apexcharts";

Expand Down
1 change: 1 addition & 0 deletions client/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default new VueX.Store({
},
mutations: {
change(state, payload: eventType<object>) {
// @ts-ignore
state[payload.event] = payload.data;
}
},
Expand Down
4 changes: 2 additions & 2 deletions core/sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func SseInit(e *echo.Echo) {
}

/*
SseNotify does nothing (for now)
SseNotify sends SSE with payload
*/
func SseNotify(payload EventData) {
if server == nil {
Expand All @@ -38,7 +38,7 @@ func SseNotify(payload EventData) {
go func() {
payload, _ := json.Marshal(payload)
fmt.Println(string(payload))
server.SendMessage(fmt.Sprintf("/events/%s", "dunno"), sse.SimpleMessage(string(payload)))
server.SendMessage(fmt.Sprintf("/events/%s", "dashboard"), sse.SimpleMessage(string(payload)))
}()
}

Expand Down
1 change: 1 addition & 0 deletions css/app.232f7ab8.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9eafb1c

Please sign in to comment.