liftinstall/static/index.html
2018-01-27 15:31:43 +11:00

145 lines
5.7 KiB
HTML

<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>yuzu Installer</title>
<link rel="stylesheet" href="/css/bulma.css" type="text/css">
<link rel="stylesheet" href="/css/main.css" type="text/css">
</head>
<body>
<div id="app">
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<span class="navbar-item">
<img src="/img/logo.png" v-bind:alt="config.general.name">
</span>
</div>
</nav>
<!-- Main content -->
<section class="section">
<div class="container">
<div class="columns">
<div class="column is-one-third">
<h1 class="title">
Welcome to the {{ config.general.name }} installer!
</h1>
<h2 class="subtitle">
We will have you up and running in just a few moments.
</h2>
</div>
<div class="column" v-if="select_packages">
<h4 class="subtitle">Select your preferred settings:</h4>
<!-- Build options -->
<div class="tile is-ancestor">
<div class="tile is-parent" v-for="package in config.packages" :index="package.name">
<div class="tile is-child">
<div class="box">
<label class="checkbox">
<input type="checkbox" v-bind:checked="package.default" />
{{ package.name }}
</label>
<p>
{{ package.description }}
</p>
</div>
</div>
</div>
</div>
<div class="subtitle is-6">Install Location</div>
<div class="field has-addons">
<div class="control is-expanded">
<input class="input" type="text" v-model="install_location"
placeholder="Enter a install path here">
</div>
<div class="control">
<a class="button is-info" v-on:click="select_file">
Select
</a>
</div>
</div>
<a class="button is-primary is-pulled-right" v-on:click="install">Install!</a>
</div>
<div class="column" v-else-if="is_installing">
<h4 class="subtitle">Installing...</h4>
<div v-html="config.general.installing_message"></div>
<br />
<progress class="progress is-info is-medium" v-bind:value="progress" max="100">
{{ progress }}%
</progress>
</div>
<div class="column" v-else-if="is_finished">
<h4 class="subtitle">Thanks for installing {{ config.general.name }}!</h4>
<a class="button is-primary is-pulled-right" v-on:click="exit">Exit</a>
</div>
<div class="column" v-else>
<h4 class="subtitle">Oh no!</h4>
<div>A error occured during installation. Please retry!</div>
</div>
</div>
</div>
</section>
</div>
<script src="/api/config"></script>
<script src="/js/helpers.js"></script>
<script src="/js/vue.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
config : config,
install_location : "",
select_packages : true,
is_installing : false,
is_finished : false,
progress : 0
},
methods: {
"select_file": function() {
ajax("/api/file-select", function(e) {
if (e.path != null) {
app.install_location = e.path;
}
});
},
"install": function() {
this.select_packages = false;
this.is_installing = true;
setInterval(function() {
app.progress += 5;
if (app.progress >= 100) {
app.is_installing = false;
app.is_finished = true;
}
}, 100);
},
"exit": function() {
ajax("/api/exit", function() {});
}
}
});
ajax("/api/default-path", function(e) {
if (e.path != null) {
app.install_location = e.path;
}
});
</script>
</body>
</html>