Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
views: add previous/next buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu committed Jul 24, 2022
1 parent 6bd1c54 commit f698a12
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 29 deletions.
10 changes: 5 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
"root": true,
"extends": [
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-prettier"
]
}
"@vue/eslint-config-prettier",
],
};
15 changes: 11 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ export default {
<main>
<div style="height: 100%; overflow-y: auto; margin-right: 3rem">
<RouterView />
<!-- <div style="display: flex; float: right; margin-right: 1em">
<DKArrowButton :left="true">Previous</DKArrowButton>
<DKArrowButton>Next</DKArrowButton>
</div> -->
</div>
</main>
</div>
Expand All @@ -79,6 +75,11 @@ export default {
max="100"
class="progress-bar"
></progress>
<span class="info-box" v-if="page_number > 1 && page_number < 4"
><i
>Step 5/7: Generating initramfs (initial RAM filesystem)... (91%)</i
></span
>
<label for="progressbar" class="eta-box"
>25 - 30 minutes remaining...</label
>
Expand Down Expand Up @@ -125,6 +126,12 @@ export default {
background: var(--dk-accent);
}
.info-box {
margin-top: 0.5em;
float: left;
margin-left: 0.3rem;
}
.eta-box {
float: right;
margin-top: 0.5em;
Expand Down
10 changes: 10 additions & 0 deletions src/components/DKBottomSteps.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup>
import DKStepButtons from "./DKStepButtons.vue";
import DKBottomActions from "@/components/DKBottomActions.vue";
</script>

<template>
<DKBottomActions>
<DKStepButtons />
</DKBottomActions>
</template>
2 changes: 1 addition & 1 deletion src/components/DKFilterSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ div.select::after {
color: #1f1f1f;
display: block;
text-align: left;
line-height: 1.5;
line-height: 1;
}
.dropdown-content a:hover {
Expand Down
9 changes: 7 additions & 2 deletions src/components/DKStepButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import DKBottomRightButtons from "./DKBottomRightButtons.vue";

<template>
<DKBottomRightButtons>
<button class="button">Previous</button>
<button class="button">Next</button>
<button class="button" @click="$router.back()">Previous</button>
<button
class="button"
@click="$router.push($router.currentRoute.value.meta.next)"
>
Next
</button>
</DKBottomRightButtons>
</template>
22 changes: 11 additions & 11 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ const router = createRouter({
path: "/",
name: "home",
component: WelcomeView,
meta: { steps: 0 },
meta: { steps: 0, next: "/variants" },
},
{
path: "/rescue",
name: "rescue",
component: RescueKitView,
meta: { steps: 0 },
meta: { steps: 0, next: "/partitions" },
},
{
path: "/users",
name: "users",
component: UserView,
meta: { steps: 1 },
meta: { steps: 1, next: "/hostname" },
},
{
path: "/abort",
Expand All @@ -56,49 +56,49 @@ const router = createRouter({
path: "/swapfile",
name: "swapfile",
component: SwapFileView,
meta: { steps: 1 },
meta: { steps: 1, next: "/confirm" },
},
{
path: "/mirrors",
name: "mirrors",
component: MirrorView,
meta: { steps: 0 },
meta: { steps: 0, next: "/rescue" },
},
{
path: "/mirrors-sel",
name: "mirrors-sel",
component: MirrorSelectView,
meta: { steps: 0 },
meta: { steps: 0, next: "/rescue" },
},
{
path: "/locales",
name: "locales",
component: LocaleView,
meta: { steps: 1 },
meta: { steps: 1, next: "/swapfile" },
},
{
path: "/confirm",
name: "confirm",
component: ConfirmView,
meta: { steps: 1 },
meta: { steps: 1, next: "/install" },
},
{
path: "/hostname",
name: "hostname",
component: HostnameView,
meta: { steps: 1 },
meta: { steps: 1, next: "/locales" },
},
{
path: "/partitions",
name: "partitions",
component: PartitionView,
meta: { steps: 0 },
meta: { steps: 0, next: "/users" },
},
{
path: "/variants",
name: "variants",
component: VariantView,
meta: { steps: 0 },
meta: { steps: 0, next: "/mirrors" },
},
{
path: "/install",
Expand Down
2 changes: 1 addition & 1 deletion src/slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const slides_data = [
},
{
title: "You Ready",
body: "At AOSC, we pride ourselves with friendly and ready support for our users. Warranty and merchantability notwithstanding,we believe that our users should be respected of their time and energy spent on adapting to a new work environment.\nAt Telegram, Discord, IRC, or Matrix, our maintainers,contributors, and friends are ready to offer help. We wish you much joy at our community and great success with AOSC OS.\nEnjoy!",
body: "At AOSC, we pride ourselves with friendly and ready support for our users. Warranty and merchantability notwithstanding, we believe that our users should be respected of their time and energy spent on adapting to a new work environment.\nAt Telegram, Discord, IRC, or Matrix, our maintainers, contributors, and friends are ready to offer help. We wish you much joy at our community and great success with AOSC OS.\nEnjoy!",
},
];

Expand Down
3 changes: 3 additions & 0 deletions src/views/ConfirmView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import DKBottomSteps from "../components/DKBottomSteps.vue";
export default {
props: {
part: String,
Expand All @@ -11,6 +12,7 @@ export default {
rtc_utc: Boolean,
rescue_size: Number,
},
components: { DKBottomSteps },
};
</script>

Expand Down Expand Up @@ -59,6 +61,7 @@ export default {
</i>
</p>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
5 changes: 4 additions & 1 deletion src/views/HostnameView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup></script>
<script setup>
import DKBottomSteps from "../components/DKBottomSteps.vue";
</script>

<template>
<div>
Expand All @@ -14,6 +16,7 @@
</form>
<p class="error-msg"></p>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
2 changes: 2 additions & 0 deletions src/views/LocaleView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import DKFilterSelect from "@/components/DKFilterSelect.vue";
import DKBottomSteps from "../components/DKBottomSteps.vue";
</script>

<script>
Expand Down Expand Up @@ -53,6 +54,7 @@ export default {
</p>
</form>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
2 changes: 2 additions & 0 deletions src/views/MirrorSelectView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import DKBottomActions from "@/components/DKBottomActions.vue";
import DKStepButtons from "@/components/DKStepButtons.vue";
</script>

<template>
Expand All @@ -16,6 +17,7 @@ import DKBottomActions from "@/components/DKBottomActions.vue";
</div>
<DKBottomActions>
<button class="button">Benchmark...</button>
<DKStepButtons />
</DKBottomActions>
</template>

Expand Down
5 changes: 4 additions & 1 deletion src/views/MirrorView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script></script>
<script setup>
import DKBottomSteps from "../components/DKBottomSteps.vue";
</script>

<template>
<div>
Expand All @@ -13,6 +15,7 @@
</button>
</section>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
2 changes: 2 additions & 0 deletions src/views/RescueKitView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import DKListSelect from "@/components/DKListSelect.vue";
import DKBottomSteps from "../components/DKBottomSteps.vue";
const options = [
{
Expand Down Expand Up @@ -27,6 +28,7 @@ const options = [
<DKListSelect :options="options" />
</section>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
3 changes: 3 additions & 0 deletions src/views/SwapFileView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script>
import DKBottomSteps from "../components/DKBottomSteps.vue";
export default {
props: {},
computed: {
max_size: function () {
return this.rec_size * 2;
},
},
components: { DKBottomSteps },
data: function () {
return {
type: 0,
Expand Down Expand Up @@ -98,6 +100,7 @@ export default {
</p>
</form>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
5 changes: 4 additions & 1 deletion src/views/UserView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup></script>
<script setup>
import DKBottomSteps from "../components/DKBottomSteps.vue";
</script>

<template>
<div>
Expand All @@ -19,6 +21,7 @@
</form>
<p class="error-msg"></p>
</div>
<DKBottomSteps />
</template>

<style scoped>
Expand Down
2 changes: 2 additions & 0 deletions src/views/VariantView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import DKListSelect from "@/components/DKListSelect.vue";
import DKBottomSteps from "../components/DKBottomSteps.vue";
const options = [
{
Expand All @@ -25,4 +26,5 @@ const options = [
<DKListSelect :options="options" />
</section>
</div>
<DKBottomSteps />
</template>
5 changes: 4 additions & 1 deletion src/views/WelcomeView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup></script>
<script setup>
import DKBottomSteps from "../components/DKBottomSteps.vue";
</script>

<template>
<div>
Expand All @@ -14,4 +16,5 @@
more time on slower hardware.
</p>
</div>
<DKBottomSteps />
</template>
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node */
import { fileURLToPath, URL } from "url";

import path from "path";
Expand All @@ -9,7 +10,6 @@ import vueI18n from "@intlify/vite-plugin-vue-i18n";
export default defineConfig({
plugins: [
vue(),
// eslint-disable-next-line no-undef
vueI18n({ include: path.resolve(__dirname, "./src/locales/**") }),
],
resolve: {
Expand Down

0 comments on commit f698a12

Please sign in to comment.