Browse Source

MySQL configure form

Vova Tkach 6 years ago
parent
commit
de5b694f43

+ 2 - 1
backend.go

@@ -7,5 +7,6 @@ import (
 )
 
 func handleBackEnd(e *wrapper.Wrapper) bool {
-	return e.TmplBackEnd(Templates.CpLogin, nil)
+	//return e.TmplBackEnd(Templates.CpLogin, nil)
+	return e.TmplBackEnd(Templates.CpMySQL, nil)
 }

+ 11 - 9
engine/wrapper/resources/styles/assets.cp.styles.css

@@ -1,4 +1,6 @@
-body.cp-login {
+/* Login/MySQL form */
+body.cp-login,
+body.cp-mysql {
 	height: 100%;
 	display: -ms-flexbox;
 	display: -webkit-box;
@@ -14,22 +16,21 @@ body.cp-login {
 	background-color: #f5f5f5;
 }
 
-.cp-login .form-signin {
+.cp-login .form-signin,
+.cp-mysql .form-signin {
 	width: 100%;
 	max-width: 330px;
 	padding: 15px;
 	margin: 0 auto;
 }
 
-.cp-login .form-signin label {
+.cp-login .form-signin label,
+.cp-mysql .form-signin label {
 	cursor: pointer;
 }
 
-.cp-login .form-signin .checkbox {
-	font-weight: 400;
-}
-
-.cp-login .form-signin .form-control {
+.cp-login .form-signin .form-control,
+.cp-mysql .form-signin .form-control {
 	position: relative;
 	box-sizing: border-box;
 	height: auto;
@@ -37,7 +38,8 @@ body.cp-login {
 	font-size: 16px;
 }
 
-.cp-login .form-signin .form-control:focus {
+.cp-login .form-signin .form-control:focus,
+.cp-mysql .form-signin .form-control:focus {
 	z-index: 2;
 }
 

+ 1 - 1
engine/wrapper/resources/styles/assets.cp.styles.css.go

@@ -1,3 +1,3 @@
 package styles
 
-var File_assets_cp_styles_css = []byte(`body.cp-login{height:100%;display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-align:center;-ms-flex-pack:center;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;padding-top:40px;padding-bottom:40px;background-color:#f5f5f5}.cp-login .form-signin{width:100%;max-width:330px;padding:15px;margin:0 auto}.cp-login .form-signin label{cursor:pointer}.cp-login .form-signin .checkbox{font-weight:400}.cp-login .form-signin .form-control{position:relative;box-sizing:border-box;height:auto;padding:10px;font-size:16px}.cp-login .form-signin .form-control:focus{z-index:2}.cp-login .form-signin input[type="email"]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.cp-login .form-signin input[type="password"]{margin-bottom:10px;border-top-left-radius:0;border-top-right-radius:0}`)
+var File_assets_cp_styles_css = []byte(`body.cp-login,body.cp-mysql{height:100%;display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-align:center;-ms-flex-pack:center;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;padding-top:40px;padding-bottom:40px;background-color:#f5f5f5}.cp-login .form-signin,.cp-mysql .form-signin{width:100%;max-width:330px;padding:15px;margin:0 auto}.cp-login .form-signin label,.cp-mysql .form-signin label{cursor:pointer}.cp-login .form-signin .form-control,.cp-mysql .form-signin .form-control{position:relative;box-sizing:border-box;height:auto;padding:10px;font-size:16px}.cp-login .form-signin .form-control:focus,.cp-mysql .form-signin .form-control:focus{z-index:2}.cp-login .form-signin input[type="email"]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.cp-login .form-signin input[type="password"]{margin-bottom:10px;border-top-left-radius:0;border-top-right-radius:0}`)

+ 3 - 0
engine/wrapper/resources/templates/cp.mysql.go

@@ -0,0 +1,3 @@
+package templates
+
+var CpMySQL = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Configure MySQL</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-mysql text-center"><form class="form-signin" action="/cp/" method="post"><h1 class="h3 mb-3 font-weight-normal">Configure MySQL</h1><label for="host" class="sr-only">Host</label><input type="text" id="host" name="host" class="form-control mb-3" placeholder="Host" value="localhost" required><label for="name" class="sr-only">Name</label><input type="text" id="name" name="name" class="form-control mb-3" placeholder="Name" required autofocus><label for="user" class="sr-only">User</label><input type="text" id="user" name="user" class="form-control mb-3" placeholder="User" required><label for="password" class="sr-only">Password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="Password"><button class="btn btn-lg btn-primary btn-block" type="submit">Configure</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script></body></html>`)

+ 30 - 0
engine/wrapper/resources/templates/cp.mysql.html

@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8">
+		<meta name="theme-color" content="#205081" />
+		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+		<title>Configure MySQL</title>
+		<link rel="stylesheet" href="{{$.System.PathCssBootstrap}}">
+		<link rel="stylesheet" href="{{$.System.PathCssCpStyles}}">
+		<link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" />
+		<style type="text/css">html{height:100%;}</style>
+	</head>
+	<body class="cp-mysql text-center">
+		<form class="form-signin" action="/cp/" method="post">
+			<h1 class="h3 mb-3 font-weight-normal">Configure MySQL</h1>
+			<label for="host" class="sr-only">Host</label>
+			<input type="text" id="host" name="host" class="form-control mb-3" placeholder="Host" value="localhost" required>
+			<label for="name" class="sr-only">Name</label>
+			<input type="text" id="name" name="name" class="form-control mb-3" placeholder="Name" required autofocus>
+			<label for="user" class="sr-only">User</label>
+			<input type="text" id="user" name="user" class="form-control mb-3" placeholder="User" required>
+			<label for="password" class="sr-only">Password</label>
+			<input type="password" id="password" name="password" class="form-control mb-3" placeholder="Password">
+			<button class="btn btn-lg btn-primary btn-block" type="submit">Configure</button>
+		</form>
+		<script src="{{$.System.PathJsJquery}}"></script>
+		<script src="{{$.System.PathJsPopper}}"></script>
+		<script src="{{$.System.PathJsBootstrap}}"></script>
+	</body>
+</html>