Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
penggy committed Jan 6, 2021
1 parent 6d50e4c commit cd019c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
7 changes: 0 additions & 7 deletions web_src/components/AdminLTE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ export default {
nice: null,
}
},
watch: {
serverInfo(val) {
if (val) {
document.title = val.LogoText || "LiveGBS";
}
}
},
mounted() {
$(document).ajaxError((evt, xhr, opts, ex) => {
if (xhr.status == 401) {
Expand Down
6 changes: 4 additions & 2 deletions web_src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ export default {
...mapState(["userInfo", "serverInfo"])
},
async mounted() {
await this.getServerInfo();
document.title = this.serverInfo.LogoText || "LiveGBS";
var serverInfo = await this.getServerInfo();
if(serverInfo) {
document.title = serverInfo.LogoText || "LiveGBS";
}
var userInfo = await this.getUserInfo();
if(userInfo) {
window.location.href = "/"
Expand Down
16 changes: 8 additions & 8 deletions web_src/components/Play.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default {
shareUrl: "",
snapUrl: "",
ptz: true,
share: true,
share: false,
fluent: true,
stretch: false,
autoplay: true,
Expand All @@ -255,12 +255,17 @@ export default {
this.ctrlStop();
$(document).off("mouseup touchend", this.ctrlStop);
},
created() {
async mounted() {
await this.getServerInfo();
await this.getUserInfo();
document.title = this.serverInfo.LogoText || "LiveGBS";
this.aspect = this.getQueryString("aspect","").replace("x", ":");
this.autoplay = this.getQueryString("autoplay", "yes") == "yes";
this.controls = this.getQueryString("controls", "yes") == "yes";
this.ptz = this.getQueryString("ptz", "yes") == "yes";
this.share = this.getQueryString("share", "yes") == "yes";
var defShare = this.serverInfo.ShowShare ? "yes" : "no";
this.share = this.getQueryString("share", defShare) == "yes";
this.fluent = this.getQueryString("fluent", "yes") == "yes";
this.stretch = this.getQueryString("stretch", "no") == "yes";
this.type = this.getQueryString("type", "stream");
Expand All @@ -276,11 +281,6 @@ export default {
this.talk = this.getQueryString("talk", "no") == "yes";
this.otherParams = this.getOtherParams(["aspect", "autoplay", "controls", "ptz", "share", "fluent", "stretch", "type", "starttime", "endtime", "serial", "code", "channel", "protocol", "muted", "talk", "debug"])
this.shareUrl = location.href;
},
async mounted() {
await this.getServerInfo();
await this.getUserInfo();
document.title = this.serverInfo.LogoText || "LiveGBS";
$(document).ajaxError((evt, xhr, opts, ex) => {
if (xhr.status == 401) {
if (this.serverInfo.IsDemo) {
Expand Down
3 changes: 3 additions & 0 deletions web_src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ const router = new Router({

router.beforeEach(async (to, from, next) => {
var serverInfo = await store.dispatch("getServerInfo");
if(serverInfo) {
document.title = serverInfo.LogoText || "LiveGBS";
}
var userInfo = await store.dispatch("getUserInfo");
// if (serverInfo && serverInfo.APIAuth === false && !userInfo) {
// next();
Expand Down

0 comments on commit cd019c1

Please sign in to comment.