Skip to content

Commit

Permalink
ncp-web: integrate ncp-wizard with ncp-web
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Oct 20, 2017
1 parent a5ce511 commit bd74eb4
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 3 deletions.
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

[v0.31.12](https://github.com/nextcloud/nextcloudpi/commit/487e06e) (2017-10-05) fail2ban: email notification
[v0.31.14](https://github.com/nextcloud/nextcloudpi/commit/7e40933) (2017-10-09) ncp-web: integrate ncp-wizard with ncp-web

[v0.31.13](https://github.com/nextcloud/nextcloudpi/commit/583d1b6) (2017-10-07) letsencrypt: fix workaround for old images

[v0.31.12](https://github.com/nextcloud/nextcloudpi/commit/f30c470) (2017-10-05) fail2ban: email notification (Closes #232)

[v0.31.11](https://github.com/nextcloud/nextcloudpi/commit/3fc4d3c) (2017-10-04) nc-backup: fix excludes

Expand Down
File renamed without changes
66 changes: 66 additions & 0 deletions ncp-web/img/view-close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions ncp-web/img/wizard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions ncp-web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@
?>
</div>

<?php
if ( !file_exists( 'wizard.cfg' ) )
{
echo <<<HTML
<div id="first-run-wizard">
<div>
<br>
<h2 id="config-box-title">NextCloudPi First Run</h2>
<p>Click to start the configuration wizard</p>
<br>
<a href="wizard"><img id="ncp-welcome-logo" src="wizard/img/ncp-logo.png" class="wizard"></a>
<br>
<a href="wizard"><button type="button" class="wizard">run</button></a>
<button type="button" class="first-run-close" id="skip-wizard">skip</button>
<button type="button" class="first-run-close" id="close-wizard">close</button>
<br><br>
</div>
</div>
HTML;
touch( 'wizard.cfg' );
}
?>

<header role="banner"><div id="header">
<div id="header-left">
<a href="https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/"
Expand All @@ -66,6 +89,11 @@
</a>
</div>
<div id="header-right">
<div id="wizard">
<div id="expand">
<div id="expandDisplayName" class="icon-wizard-white"></div>
</div>
</div>
<div id="poweroff">
<div id="expand">
<div id="expandDisplayName" class="icon-power-white"></div>
Expand Down
41 changes: 39 additions & 2 deletions ncp-web/ncp.css
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,12 @@ select {
}

.icon-power-white {
background-image: url('poweroff.svg');
background-image: url('img/poweroff.svg');
}

.icon-wizard-white {
background-image: url('img/wizard.svg');
}
.icon-red-circle {
background-image: url('red-circle.svg');
padding: 8px;
Expand Down Expand Up @@ -1154,5 +1157,39 @@ a#versionlink{

/* lower version link */
#header #header-left {
align-items:baseline
align-items:baseline
}

#first-run-wizard {
position:fixed;
top:0;
bottom:0;
height:100%;
width:100%;
background-color:rgba(0, 0, 0, 0.5);
z-index:9000;
text-align:center;
cursor:pointer;
}

#first-run-wizard div {
display:block;
background: white;
position:relative;
width:50%;
top:25%;
margin:0px auto;
}

#close-wizard {
position: absolute;
top: 5px;
right: 5px;
display: block;
background: none;
background-image:url('img/view-close.svg');
width: 38px;
height: 19px;
text-indent: -9999px;
border: none;
}
17 changes: 17 additions & 0 deletions ncp-web/ncp.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,28 @@ $(function()
}).error( errorMsg );
} );

// Wizard button
$( '#wizard' ).on('click', function(e)
{
window.location = 'wizard';
} );

// close notification icon
$( '.icon-close' ).on('click', function(e)
{
$( '#notification' ).hide();
} );

// close first run box
$( '.first-run-close' ).on('click', function(e)
{
$( '#first-run-wizard' ).hide();
} );
$( '#first-run-wizard' ).on('click', function(e)
{
if( e.target.id == 'first-run-wizard' )
$( '#first-run-wizard' ).hide();
} );
});

// License
Expand Down

0 comments on commit bd74eb4

Please sign in to comment.