Skip to content

Commit

Permalink
fix for css files 404-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterlong committed May 1, 2020
1 parent 82a58cb commit 68df645
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
39 changes: 13 additions & 26 deletions frontend/src/components/Dashboard/ThemeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,15 @@
</div>
</div>
<form v-if="loaded && directory" @submit.prevent="saveAssets" :disabled="pending">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item col text-center">
<a @click.prevent="changeTab('vars')" class="nav-link" :class="{active: tab === 'vars'}" id="pills-vars-tab" data-toggle="pill" href="#pills-vars" role="tab" aria-controls="pills-vars" aria-selected="true">Variables</a>
</li>
<li class="nav-item col text-center">
<a @click.prevent="changeTab('base')" class="nav-link" :class="{active: tab === 'base'}" id="pills-base-tab" data-toggle="pill" href="#pills-base" role="tab" aria-controls="pills-base" aria-selected="false">Base Theme</a>
</li>
<li class="nav-item col text-center">
<a @click.prevent="changeTab('mobile')" class="nav-link" :class="{active: tab === 'mobile'}" id="pills-mobile-tab" data-toggle="pill" href="#pills-mobile" role="tab" aria-controls="pills-mobile" aria-selected="false">Mobile</a>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane show" :class="{active: tab === 'vars'}" id="pills-vars" role="tabpanel" aria-labelledby="pills-vars-tab">
<codemirror v-if="loaded && tab === 'vars'" v-model="vars" ref="vars" :options="cmOptions" class="codemirrorInput"/>
</div>
<div class="tab-pane show" :class="{active: tab === 'base'}" id="pills-base" role="tabpanel" aria-labelledby="pills-base-tab">
<codemirror v-if="loaded && tab === 'base'" v-model="base" ref="base" :options="cmOptions" class="codemirrorInput"/>
</div>
<div class="tab-pane show" :class="{active: tab === 'mobile'}" id="pills-mobile" role="tabpanel" aria-labelledby="pills-mobile-tab">
<codemirror v-if="loaded && tab === 'mobile'" v-model="mobile" ref="mobile" :options="cmOptions" class="codemirrorInput"/>
</div>
</div>
<h3>Variables</h3>
<codemirror v-show="loaded" v-model="vars" ref="vars" :options="cmOptions" class="codemirrorInput"/>

<h3 class="mt-3">Base Theme</h3>
<codemirror v-show="loaded" v-model="base" ref="base" :options="cmOptions" class="codemirrorInput"/>

<h3 class="mt-3">Mobile Overwrites</h3>
<codemirror v-show="loaded" v-model="mobile" ref="mobile" :options="cmOptions" class="codemirrorInput"/>

<div v-if="error" class="alert alert-danger mt-3" style="white-space: pre-line;">{{error}}</div>

<button id="save_assets" @submit.prevent="saveAssets" type="submit" class="btn btn-primary btn-block mt-2" :disabled="pending">{{pending ? "Saving..." : "Save Style"}}</button>
Expand Down Expand Up @@ -66,16 +53,16 @@
},
data () {
return {
base: "",
vars: "",
mobile: "",
base: null,
vars: null,
mobile: null,
error: null,
directory: null,
tab: "vars",
loaded: false,
pending: false,
cmOptions: {
height: 600,
height: 700,
tabSize: 4,
lineNumbers: true,
matchBrackets: true,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Service/ServiceChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
}
this.data = await Api.service_hits(this.service.id, start, end, group, false)
window.console.log(this.data === null && group !== "5m")
if (this.data === null && group !== "5m") {
await this.chartHits("10m")
}
Expand Down
2 changes: 1 addition & 1 deletion handlers/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (
)

func staticAssets(src string) http.Handler {
return http.StripPrefix(basePath+src+"/", http.FileServer(http.Dir(utils.Directory+"/assets/"+src)))
return http.StripPrefix(src+"/", http.FileServer(http.Dir(utils.Directory+"/assets/"+src)))
}

// Router returns all of the routes used in Statping.
Expand Down

0 comments on commit 68df645

Please sign in to comment.