-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
585 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<el-dialog v-model="flushcacheVisible" title="Cache flushed" width="60%"> | ||
<span class="dialog-content"> | ||
The cache has been flushed, next sync will load from Github | ||
</span> | ||
<template #footer> | ||
<span class="dialog-footer"> | ||
<el-button type="primary" @click="flushcacheVisible = false">Ok</el-button> | ||
</span> | ||
</template> | ||
</el-dialog> | ||
test | ||
</template> | ||
|
||
<script> | ||
import Axios from "axios"; | ||
import constants from "@/constants"; | ||
import helpers from "@/helpers/helpers"; | ||
const { handleErr } = helpers; | ||
const { API_URL } = constants; | ||
export default { | ||
name: "DashboardApp", | ||
components: { | ||
}, | ||
data() { | ||
return { | ||
flushcacheVisible: false, | ||
}; | ||
}, | ||
methods: { | ||
flushcache() { | ||
Axios.post(`${API_URL}/flushcache`,{}).then(() => { | ||
this.flushcacheVisible=false | ||
}, handleErr.bind(this)); | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<div class="spinner"></div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "SpinnerApp" | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.spinner { | ||
width: 40px; | ||
height: 40px; | ||
background-color: #74e5e0; | ||
margin: 100px auto; | ||
-webkit-animation: sk-rotateplane 1.2s infinite ease-in-out; | ||
animation: sk-rotateplane 1.2s infinite ease-in-out; | ||
} | ||
@-webkit-keyframes sk-rotateplane { | ||
0% { | ||
-webkit-transform: perspective(120px); | ||
} | ||
50% { | ||
-webkit-transform: perspective(120px) rotateY(180deg); | ||
} | ||
100% { | ||
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg); | ||
} | ||
} | ||
@keyframes sk-rotateplane { | ||
0% { | ||
transform: perspective(120px) rotateX(0deg) rotateY(0deg); | ||
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); | ||
} | ||
50% { | ||
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); | ||
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); | ||
} | ||
100% { | ||
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); | ||
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const API_URL = process.env.VUE_APP_API_URL | ||
|
||
export default { | ||
API_URL, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
function indexBy (arr, prop) { | ||
return arr.reduce((acc, el) => { | ||
acc[el[prop]] = el | ||
return acc | ||
}, {}) | ||
} | ||
|
||
function pluck (arr, prop) { | ||
return arr.map(el => el[prop]) | ||
} | ||
|
||
function sum (arr) { | ||
return arr.reduce((acc, el) => { | ||
acc += el | ||
return acc | ||
}, 0) | ||
} | ||
|
||
function get (obj, path, def) { | ||
const fullPath = path | ||
.replace(/\[/g, '.') | ||
.replace(/]/g, '') | ||
.split('.') | ||
.filter(Boolean) | ||
|
||
return fullPath.every(everyFunc) ? obj : def | ||
|
||
function everyFunc (step) { | ||
return !(step && (obj = obj[step]) === undefined) | ||
} | ||
} | ||
|
||
function handleErr (err) { | ||
let msg = get(err, 'response.data.message', 'request error') | ||
this.$message.error(msg) | ||
if (get(err, 'response.status') === 401) { | ||
let redirectURL = err.response.headers['www-authenticate'].split(`"`)[1] | ||
window.location = redirectURL | ||
return | ||
} | ||
} | ||
|
||
export default { | ||
indexBy, | ||
pluck, | ||
sum, | ||
get, | ||
handleErr | ||
} |
Oops, something went wrong.