Skip to content

Commit

Permalink
feat: prototype of these helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Jul 30, 2019
1 parent bf676e6 commit 5ea3352
Show file tree
Hide file tree
Showing 4 changed files with 499 additions and 0 deletions.
205 changes: 205 additions & 0 deletions src/renderer/windows/main/components/FolderStruct.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
<template>
<v-treeview
v-model="tree"
:open="open"
:items="items"
activatable
item-key="name"
open-on-click
hoverable
>
<template v-slot:prepend="{ item, open }">
<v-icon v-if="!item.file" :color="item.diff ? 'green lighten-2' : ''">
{{ open ? 'folder_open' : 'folder' }}
</v-icon>
<v-icon v-else :color="item.diff ? 'green lighten-2' : ''">
{{ files[item.file] }}
</v-icon>
</template>
<template v-slot:label="{ item, open }">
<span :class="{ diff: item.diff }">
{{ item.name }}
</span>
</template>
<template v-slot:append=" { item, open } ">
<span style="padding-right: 10px;" :class="{ diff: item.diff }">
{{ item.id ? $t(`intro.struct.${item.id}`) : '' }}
</span>
</template>
</v-treeview>
</template>

<script>
export default {
props: {
value: {
type: Boolean,
default: () => false,
},
},
data: () => ({
e1: 0,
open: ['.minecraft'],
hovered: {},
files: {
jar: 'archive',
liteloader: 'archive',
zip: 'archive',
json: 'description',
txt: 'description',
},
tree: [],
items: [
{
name: '.minecraft',
id: 'root',
children: [
{
name: 'assets',
id: 'assets',
},
{
name: 'libraries',
id: 'libraries',
},
{
name: 'versions',
id: 'versions',
},
{
name: 'temp',
id: 'temp',
diff: true,
},
{
name: 'jre',
id: 'jre',
diff: true,
},
{
name: 'logs',
id: 'logs',
diff: true,
},
{
name: 'profiles',
id: 'profiles',
diff: true,
children: [
{
name: '<some-uuid>',
id: 'profileFolder',
diff: true,
children: [
{
name: 'logs',
id: 'mclogs',
},
{
name: 'profile.json',
id: 'profile',
file: 'json',
diff: true,
},
{
name: 'options.txt',
id: 'options',
file: 'txt',
},
],
},
],
},
{
name: 'mods',
id: 'mods',
children: [
{
name: '<some-forge-mod>.jar',
id: 'modJar',
file: 'jar',
},
{
name: '<some-liteloader-mod>.liteloader',
id: 'modLite',
file: 'liteloader',
},
],
},
{
name: 'resourcepacks',
id: 'resourcepacks',
children: [
{
name: '<some-resource-pack>.zip',
id: 'resourcepack',
file: 'zip',
},
],
},
{
name: 'resources',
id: 'resources',
diff: true,
children: [
{
name: '<sha1-of-mod-or-resource-pack>.json',
id: 'resourceJson',
file: 'json',
diff: true,
},
],
},
{
name: 'config.json',
id: 'config',
diff: true,
file: 'json',
},
{
name: 'version.json',
id: 'config',
diff: true,
file: 'json',
},
{
name: 'forge-versions.json',
id: 'forge-versions',
diff: true,
file: 'json',
},
{
name: 'lite-versions.json',
id: 'lite-versions',
diff: true,
file: 'json',
},
{
name: 'java.json',
id: 'java',
diff: true,
file: 'json',
},
{
name: 'user.json',
id: 'user',
diff: true,
file: 'json',
},
],
},
],
}),
watch: {
},
};
</script>

<style>
.diff {
color: #81c784;
font-style: italic;
}
</style>
93 changes: 93 additions & 0 deletions src/renderer/windows/main/components/HelperDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<template>
<v-dialog :value="value" hide-overlay transition="dialog-bottom-transition" @input="$emit('input', false)">
<v-toolbar dark>
<v-btn icon dark @click="$emit('input', false)">
<v-icon>close</v-icon>
</v-btn>
<v-toolbar-title> Help Me </v-toolbar-title>
<v-spacer />
<v-toolbar-items>
<v-btn dark flat>
{{ $t('intro.feedback') }}
</v-btn>
</v-toolbar-items>
<!-- <template v-slot:extension> -->
<!-- <v-tabs v-model="model" centered color="cyan"> -->
<!-- <v-tab :key="i" :href="`#tab-${i}`"/> -->
<!-- </v-tabs> -->
<!-- </template> -->
</v-toolbar>
<v-list three-line subheader>
<v-subheader>User Controls</v-subheader>
<v-list-tile avatar>
<v-list-tile-content>
<v-list-tile-title>Content filtering</v-list-tile-title>
<v-list-tile-sub-title>Set the content filtering level to restrict apps that can be downloaded</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile avatar>
<v-list-tile-content>
<v-list-tile-title>Password</v-list-tile-title>
<v-list-tile-sub-title>Require password for purchase or use password to restrict purchase</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
</v-list>
<v-divider />
<v-list three-line subheader>
<v-subheader>General</v-subheader>
<v-list-tile avatar>
<v-list-tile-action>
<v-checkbox />
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>Notifications</v-list-tile-title>
<v-list-tile-sub-title>Notify me about updates to apps or games that I downloaded</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile avatar>
<v-list-tile-action>
<v-checkbox />
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>Sound</v-list-tile-title>
<v-list-tile-sub-title>Auto-update apps at any time. Data charges may apply</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile avatar>
<v-list-tile-action>
<v-checkbox />
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>Auto-add widgets</v-list-tile-title>
<v-list-tile-sub-title>Automatically add home screen widgets</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
</v-list>
</v-dialog>
</template>

<script>
export default {
props: {
value: {
type: Boolean,
default: () => false,
},
},
data: () => ({
hovered: {},
}),
watch: {
value() {
this.$emit('value', this.value);
},
},
};
</script>

<style>
.diff {
color: #81c784;
font-style: italic;
}
</style>
87 changes: 87 additions & 0 deletions src/renderer/windows/main/components/UpdateInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<template>
<v-dialog :value="value" @input="$emit('input', $event)">
<v-card v-if="updateInfo" dark>
<v-card-title style="display: block;">
<h1>
<a href="https://github.com/voxelum/VoxeLauncher/releases">
{{ updateInfo.releaseName }}
</a>
</h1>
<v-layout>
<v-flex>
<span class="grey--text">
{{ updateInfo.releaseDate }}
</span>
</v-flex>
<v-spacer />
<v-flex shrink>
<v-chip small label>
v{{ updateInfo.version }}
</v-chip>
</v-flex>
</v-layout>
</v-card-title>
<v-divider />
<v-card-text style="overflow: auto;" v-html="updateInfo.releaseNotes" />
<v-card-actions>
<v-btn v-if="!readyToUpdate" block color="primary" flat :loading="downloadingUpdate" :disabled="downloadingUpdate" @click="downloadThisUpdate">
<v-icon color="white" left>
cloud_download
</v-icon>
{{ $t('setting.updateToThisVersion') }}
</v-btn>
<v-btn v-else block color="primary" @click="installThisUpdate">
<v-icon color="white" left>
refresh
</v-icon>
{{ $t('setting.installAndQuit') }}
</v-btn>
</v-card-actions>
</v-card>
<v-card v-else hover dark style="width: 100%" to="https://github.com/voxelum/VoxeLauncher/releases"
replace>
<v-container fill-height>
<v-layout fill-height justify-space-around align-center>
<h3 v-if="!checkingUpdate">
{{ $t('setting.noUpdateAvailable') }}
</h3>
<v-progress-circular v-else indeterminate />
</v-layout>
</v-container>
</v-card>
</v-dialog>
</template>

<script>
export default {
props: {
value: {
type: Boolean,
default: false,
},
},
computed: {
checkingUpdate() { return this.$repo.state.config.checkingUpdate; },
downloadingUpdate() { return this.$repo.state.config.downloadingUpdate; },
updateInfo() { return this.$repo.state.config.updateInfo; },
readyToUpdate() { return this.$repo.state.config.readyToUpdate; },
},
methods: {
downloadThisUpdate() {
this.$repo.dispatch('downloadUpdate');
this.$notify('info', this.$t('setting.startDownloadUpdate'));
},
installThisUpdate() {
this.$repo.dispatch('quitAndInstall');
},
checkUpdate() {
this.$repo.dispatch('checkUpdate').then((result) => {
console.log(result);
});
},
},
};
</script>

<style>
</style>
Loading

0 comments on commit 5ea3352

Please sign in to comment.