Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from unarxiv/dashboard
Dashboard
- Loading branch information
Showing
31 changed files
with
729 additions
and
56 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
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,16 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
func isExists(path string) bool { | ||
_, err := os.Stat(path) | ||
if err != nil { | ||
if os.IsExist(err) { | ||
return true | ||
} | ||
return false | ||
} | ||
return true | ||
} |
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
Empty file.
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,59 @@ | ||
<template> | ||
<v-card class="cvpm-news-card"> | ||
<v-card-title primary-title> | ||
<h2>Latest News</h2> | ||
</v-card-title> | ||
<v-list two-line dense> | ||
<template v-for="(item, index) in news"> | ||
<v-card-title primary-title v-if="item.title" :key="index"> | ||
<h4><a :href=item.url target="_blank">{{ item.title }} </a></h4> | ||
</v-card-title> | ||
<v-list-tile-content :key="item.id" class="cvpm-news-content"> | ||
<vue-markdown>{{item.body}}</vue-markdown> | ||
</v-list-tile-content> | ||
</template> | ||
</v-list> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import { discovery } from '@/services/discovery' | ||
import VueMarkdown from 'vue-markdown' | ||
export default { | ||
data: () => ({ | ||
news: [] | ||
}), | ||
methods: { | ||
getNews () { | ||
let self = this | ||
discovery.fetchNews().then(function (res) { | ||
self.news = res.data.map(function (each) { | ||
each.title = each.body.split('\n\n')[0] | ||
each.url = 'https://write.as/autoai/' + each.slug | ||
if (each.body.length > 300) { | ||
each.body = each.body.substring(0, 300) + '...' | ||
} | ||
return each | ||
}) | ||
console.log(self.news) | ||
}) | ||
} | ||
}, | ||
created () { | ||
this.getNews() | ||
}, | ||
components: { | ||
'vue-markdown': VueMarkdown | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.cvpm-news-content { | ||
padding-left: 2em; | ||
padding-right: 1em; | ||
} | ||
.cvpm-news-card { | ||
width: 90%; | ||
} | ||
</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,42 @@ | ||
<template> | ||
<v-card class="cvpm-status-card"> | ||
<v-card-title primary-title> | ||
<h2>Status</h2> | ||
</v-card-title> | ||
<v-card-text > | ||
<p class="cvpm-status-content">Installed: {{status.installed}}</p> | ||
<p class="cvpm-status-content">Running: {{status.running}} </p> | ||
<p class="cvpm-status-content">System Status: {{status.status}}</p> | ||
</v-card-text> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import { systemService } from '@/services/system' | ||
export default { | ||
data: () => ({ | ||
status: {} | ||
}), | ||
methods: { | ||
getStatus () { | ||
this.status = systemService.getStatus() | ||
console.log(this.status) | ||
} | ||
}, | ||
created () { | ||
this.getStatus() | ||
}, | ||
components: { | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.cvpm-status-card { | ||
width: 95%; | ||
} | ||
.cvpm-status-content { | ||
padding-left: 2em; | ||
padding-right: 1em; | ||
} | ||
</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,25 @@ | ||
import i18n from '@/i18n' | ||
import map from '@/i18n/map' | ||
|
||
function setLang (lang) { | ||
localStorage.setItem('lang', lang) | ||
console.log(map[lang]) | ||
i18n.locale = map[lang] | ||
} | ||
|
||
function loadDefautlLang (lang) { | ||
if (localStorage.getItem('lang') === null) { | ||
localStorage.setItem('lang', 'English') | ||
} | ||
i18n.locale = map[localStorage.getItem('lang')] | ||
} | ||
|
||
function getLang () { | ||
return localStorage.getItem('lang') | ||
} | ||
|
||
export { | ||
getLang, | ||
loadDefautlLang, | ||
setLang | ||
} |
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 @@ | ||
{} |
Oops, something went wrong.