1.4.5.2
This commit is contained in:
72
EdgeAdmin/web/views/@default/setup/confirm/index.css
Normal file
72
EdgeAdmin/web/views/@default/setup/confirm/index.css
Normal file
@@ -0,0 +1,72 @@
|
||||
.install-box {
|
||||
width: 50em;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -25em;
|
||||
top: 1em;
|
||||
bottom: 1em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.install-box .button.margin {
|
||||
margin-top: 1em;
|
||||
}
|
||||
.install-box .button.primary {
|
||||
float: right;
|
||||
}
|
||||
.install-box .button.disabled {
|
||||
float: right;
|
||||
}
|
||||
.install-box table td.title {
|
||||
width: 10em;
|
||||
}
|
||||
.install-box .radio {
|
||||
margin-right: 1em;
|
||||
}
|
||||
.install-box .radio label {
|
||||
cursor: pointer !important;
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
.install-box h4 {
|
||||
font-weight: normal;
|
||||
}
|
||||
.install-box .content-box {
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
top: 5em;
|
||||
bottom: 5em;
|
||||
left: 50%;
|
||||
width: 50em;
|
||||
padding-right: 1em;
|
||||
margin-left: -25em;
|
||||
z-index: 1;
|
||||
}
|
||||
.install-box .content-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.install-box .button-group {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -25em;
|
||||
z-index: 1;
|
||||
width: 50em;
|
||||
bottom: 1em;
|
||||
}
|
||||
.install-box .button-group button {
|
||||
z-index: 10;
|
||||
}
|
||||
.install-box .button-group .status-box {
|
||||
position: absolute;
|
||||
top: 3em;
|
||||
left: 15em;
|
||||
right: 15em;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
.install-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.label span {
|
||||
color: #999 !important;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
EdgeAdmin/web/views/@default/setup/confirm/index.css.map
Normal file
1
EdgeAdmin/web/views/@default/setup/confirm/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EAGC,WAAA;EACA,eAAA;EACA,SAAA;EACA,kBAAA;EACA,QAAA;EACA,WAAA;EACA,gBAAA;;AATD,YAWC,QAAO;EACN,eAAA;;AAZF,YAeC,QAAO;EACN,YAAA;;AAhBF,YAmBC,QAAO;EACN,YAAA;;AApBF,YAuBC,MACC,GAAE;EACD,WAAA;;AAzBH,YA6BC;EACC,iBAAA;;AA9BF,YA6BC,OAGC;EACC,0BAAA;EACA,gBAAA;;AAlCH,YAsCC;EACC,mBAAA;;AAvCF,YA0CC;EACC,gBAAA;EACA,eAAA;EACA,QAAA;EACA,WAAA;EACA,SAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,UAAA;;AAnDF,YAsDC,aAAY;EACX,UAAA;;AAvDF,YA0DC;EACC,eAAA;EACA,SAAA;EACA,kBAAA;EACA,UAAA;EACA,WAAA;EACA,WAAA;;AAhEF,YA0DC,cAQC;EACC,WAAA;;AAnEH,YA0DC,cAYC;EACC,kBAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,kBAAA;EACA,UAAA;;AAKH,YAAY;EACX,UAAA;;AAGD,MACC;EACC,WAAA","file":"index.css"}
|
||||
57
EdgeAdmin/web/views/@default/setup/confirm/index.html
Normal file
57
EdgeAdmin/web/views/@default/setup/confirm/index.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.png"/>
|
||||
<title>确认GoEdge管理系统</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
|
||||
{$TEA.VUE}
|
||||
{$TEA.SEMANTIC}
|
||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||
<script type="text/javascript" src="/js/utils.min.js"></script>
|
||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||
<script type="text/javascript" src="/js/components.js"></script>
|
||||
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="install-box">
|
||||
<h4>系统发现你可能将管理系统迁移到了新的服务器,为了让系统能正常运行,请做以下确认:</h4>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-before="before" data-tea-done="done" data-tea-success="success">
|
||||
<table class="ui table definition selectable">
|
||||
<tbody v-for="(endpoint, index) in endpoints">
|
||||
<tr>
|
||||
<td class="title">新的API节点地址<span v-if="endpoints.length > 1">{{index+1}}</span> *</td>
|
||||
<td>
|
||||
<input type="text" name="endpoints" v-model="endpoints[index]"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>管理系统NodeId *</td>
|
||||
<td>
|
||||
<input type="text" name="nodeId" v-model="nodeId" maxlength="64"/>
|
||||
<p class="comment">可以在安装时的管理系统目录下<code-label><span>edge-admin/</span>configs/api.yaml</code-label>文件中找到,通常不需要修改。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>管理系统Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="secret" v-model="secret" maxlength="64"/>
|
||||
<p class="comment">可以在安装时的管理系统目录下<code-label><span>edge-admin/</span>configs/api.yaml</code-label>文件中找到,通常不需要修改。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="margin" style="margin-top: 2em"></div>
|
||||
<a href="/setup" class="ui button" type="button" v-if="canInstall">重新安装</a>
|
||||
<button class="ui button primary" type="submit" v-if="!isRequesting">确认</button>
|
||||
<button class="ui button disabled" type="button" v-if="isRequesting">检查中...</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
17
EdgeAdmin/web/views/@default/setup/confirm/index.js
Normal file
17
EdgeAdmin/web/views/@default/setup/confirm/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
Tea.context(function () {
|
||||
this.isRequesting = false
|
||||
|
||||
this.success = function () {
|
||||
teaweb.success("完成确认,现在跳转到首页", function () {
|
||||
window.location = "/"
|
||||
})
|
||||
}
|
||||
|
||||
this.before = function () {
|
||||
this.isRequesting = true
|
||||
}
|
||||
|
||||
this.done = function () {
|
||||
this.isRequesting = false
|
||||
}
|
||||
})
|
||||
91
EdgeAdmin/web/views/@default/setup/confirm/index.less
Normal file
91
EdgeAdmin/web/views/@default/setup/confirm/index.less
Normal file
@@ -0,0 +1,91 @@
|
||||
.install-box {
|
||||
@width: 50em;
|
||||
|
||||
width: @width;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -(@width/2);
|
||||
top: 1em;
|
||||
bottom: 1em;
|
||||
overflow-y: auto;
|
||||
|
||||
.button.margin {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.button.primary {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.button.disabled {
|
||||
float: right;
|
||||
}
|
||||
|
||||
table {
|
||||
td.title {
|
||||
width: 10em;
|
||||
}
|
||||
}
|
||||
|
||||
.radio {
|
||||
margin-right: 1em;
|
||||
|
||||
label {
|
||||
cursor: pointer !important;
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.content-box {
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
top: 5em;
|
||||
bottom: 5em;
|
||||
left: 50%;
|
||||
width: @width;
|
||||
padding-right: 1em;
|
||||
margin-left: -(@width/2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.content-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -(@width/2);
|
||||
z-index: 1;
|
||||
width: @width;
|
||||
bottom: 1em;
|
||||
|
||||
button {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.status-box {
|
||||
position: absolute;
|
||||
top: 3em;
|
||||
left: 15em;
|
||||
right: 15em;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.install-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.label {
|
||||
span {
|
||||
color: #999!important;
|
||||
}
|
||||
}
|
||||
72
EdgeAdmin/web/views/@default/setup/index.css
Normal file
72
EdgeAdmin/web/views/@default/setup/index.css
Normal file
@@ -0,0 +1,72 @@
|
||||
.install-box {
|
||||
width: 50em;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -25em;
|
||||
top: 1em;
|
||||
bottom: 1em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.install-box .button.margin {
|
||||
margin-top: 1em;
|
||||
}
|
||||
.install-box .button.primary {
|
||||
float: right;
|
||||
}
|
||||
.install-box .button.disabled {
|
||||
float: right;
|
||||
}
|
||||
.install-box table td {
|
||||
vertical-align: top;
|
||||
}
|
||||
.install-box table td.title {
|
||||
width: 10em;
|
||||
}
|
||||
.install-box .radio {
|
||||
margin-right: 1em;
|
||||
}
|
||||
.install-box .radio label {
|
||||
cursor: pointer !important;
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
.install-box h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
.install-box .content-box {
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
top: 5em;
|
||||
bottom: 5em;
|
||||
left: 50%;
|
||||
width: 50em;
|
||||
padding-right: 1em;
|
||||
margin-left: -25em;
|
||||
z-index: 1;
|
||||
}
|
||||
.install-box .content-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.install-box .button-group {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -25em;
|
||||
z-index: 1;
|
||||
width: 50em;
|
||||
bottom: 1em;
|
||||
}
|
||||
.install-box .button-group button {
|
||||
z-index: 10;
|
||||
}
|
||||
.install-box .button-group .status-box {
|
||||
position: absolute;
|
||||
top: 3em;
|
||||
left: 8em;
|
||||
right: 8em;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
.install-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
EdgeAdmin/web/views/@default/setup/index.css.map
Normal file
1
EdgeAdmin/web/views/@default/setup/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EAIC,WAAA;EACA,eAAA;EACA,SAAA;EACA,kBAAA;EACA,QAAA;EACA,WAAA;EACA,gBAAA;;AAVD,YAYC,QAAO;EACN,eAAA;;AAbF,YAgBC,QAAO;EACN,YAAA;;AAjBF,YAoBC,QAAO;EACN,YAAA;;AArBF,YAwBC,MACC;EACC,mBAAA;;AA1BH,YAwBC,MAKC,GAAE;EACD,WAAA;;AA9BH,YAkCC;EACC,iBAAA;;AAnCF,YAkCC,OAGC;EACC,0BAAA;EACA,gBAAA;;AAvCH,YA2CC;EACC,mBAAA;;AA5CF,YA+CC;EACC,gBAAA;EACA,eAAA;EACA,QAAA;EACA,WAAA;EACA,SAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,UAAA;;AAxDF,YA2DC,aAAY;EACX,UAAA;;AA5DF,YA+DC;EACC,eAAA;EACA,SAAA;EACA,kBAAA;EACA,UAAA;EACA,WAAA;EACA,WAAA;;AArEF,YA+DC,cAQC;EACC,WAAA;;AAxEH,YA+DC,cAYC;EACC,kBAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,SAAA;EACA,kBAAA;EACA,UAAA;;AAKH,YAAY;EACX,UAAA","file":"index.css"}
|
||||
367
EdgeAdmin/web/views/@default/setup/index.html
Normal file
367
EdgeAdmin/web/views/@default/setup/index.html
Normal file
@@ -0,0 +1,367 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.png"/>
|
||||
<title>安装GoEdge管理系统</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
|
||||
{$TEA.VUE}
|
||||
{$TEA.SEMANTIC}
|
||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||
<script type="text/javascript" src="/js/utils.min.js"></script>
|
||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||
<script type="text/javascript" src="/js/components.js"></script>
|
||||
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="install-box">
|
||||
<!-- 步骤列表 -->
|
||||
<div class="ui steps fluid small">
|
||||
<div class="ui step" :class="{active: step == STEP_INTRO}">
|
||||
<div class="content">
|
||||
<div :class="{title: step == STEP_INTRO}">1. 介绍</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui step" :class="{active: step == STEP_API}">
|
||||
<div class="content">
|
||||
<div :class="{title: step == STEP_API}">2. 设置API节点</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui step" :class="{active: step == STEP_DB}">
|
||||
<div class="content">
|
||||
<div :class="{title: step == STEP_DB}">3. 设置MySQL数据库</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui step" :class="{active: step == STEP_ADMIN}">
|
||||
<div class="content">
|
||||
<div :class="{title: step == STEP_ADMIN}">4. 设置管理员账号</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui step" :class="{active: step == STEP_FINISH}">
|
||||
<div class="content">
|
||||
<div :class="{title: step == STEP_FINISH}">5. 完成安装</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 介绍 -->
|
||||
<div v-show="step == STEP_INTRO">
|
||||
<div>感谢你选择使用<strong>GoEdge</strong> CDN系统,下面让我们一起开始配置系统。</div>
|
||||
<div class="margin">在这之前如果你还没有可用的MySQL数据库(支持MySQL 5.7.8/8.0/8.1/TiDB 3.0及以上版本),请先安装MySQL数据库再进行。</div>
|
||||
<div class="margin" style="color: grey">免责声明:GoEdge软件开发者并不对您的软件使用方法、服务对象、服务内容负道德或法律上的约束责任,在使用本软件时产生的一切法律风险自负。</div>
|
||||
<div class="margin" style="color: grey">用户协议:请在遵守中华人民共和国政策、法律、法规的前提下使用本软件;自愿承担因不当使用本软件产生的一切法律后果;承认GoEdge开发者拥有本软件的所有著作权;点击"开始"安装表示你同意此用户协议。</div>
|
||||
<button class="ui button primary" style="margin-top: 10em" type="button" @click.prevent="goIntroNext()">开始<i class="icon long arrow right"></i></button>
|
||||
</div>
|
||||
|
||||
<!-- 设置API节点 -->
|
||||
<div v-show="step == STEP_API">
|
||||
<div class="ui message"><strong>API节点</strong>是管理系统和数据库之间通讯的桥梁,新安装时可以先使用自动启动的API节点,等系统变得庞大时再扩展新的API节点。</div>
|
||||
<form method="post" class="ui form" data-tea-action=".validateApi" data-tea-success="apiSuccess" data-tea-before="apiSubmit" data-tea-done="apiDone">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">API节点类型</td>
|
||||
<td>
|
||||
<div class="ui radio checkbox">
|
||||
<input type="radio" name="mode" value="new" id="auto-start-api-node" v-model="apiNodeMode"/>
|
||||
<label for="auto-start-api-node">自动启动新API节点</label>
|
||||
</div>
|
||||
<div class="ui radio checkbox">
|
||||
<input type="radio" name="mode" value="old" id="use-old-api-node" v-model="apiNodeMode"/>
|
||||
<label for="use-old-api-node">使用已安装节点</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tbody v-show="apiNodeMode == 'new'">
|
||||
<tr>
|
||||
<td>节点端口 *</td>
|
||||
<td>
|
||||
<input type="text" name="newPort" style="width:6em" maxlength="5" v-model="newAPINodePort"/>
|
||||
<p class="comment">选一个在1024-65535之间并且没有正在使用的端口作为要启动的节点端口。如果你的服务器上有防火墙或者其他安全策略,请记得设置这个端口为通过。<strong>如果你是一名Linux新手,请不要轻易修改此端口。</strong></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>节点主机地址 *</td>
|
||||
<td>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<input type="text" name="newHost" value="" ref="newHostRef" placeholder="x.x.x.x" v-model="currentHost"/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="comment">API节点IP地址或者域名。其他节点访问此API节点的主机地址,可以是IP或者域名,第一次安装时通常是<strong>当前服务器</strong>的公网IP地址。后期可以修改这个地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody v-show="apiNodeMode == 'old'">
|
||||
<tr>
|
||||
<td>节点协议 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="oldProtocol">
|
||||
<option value="http">HTTP</option>
|
||||
<option value="https">HTTPS</option>
|
||||
</select>
|
||||
<p class="comment">API节点使用的协议。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>主机地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="oldHost" maxlength="100" style="width:20em"/>
|
||||
<p class="comment">API节点所在主机地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>服务端口 *</td>
|
||||
<td>
|
||||
<input type="text" name="oldPort" style="width:6em" maxlength="5"/>
|
||||
<p class="comment">API节点启动的端口。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>节点nodeId *</td>
|
||||
<td>
|
||||
<input type="text" name="oldNodeId" maxlength="100"/>
|
||||
<p class="comment">在节点的配置文件中<code-label>configs/api.yaml</code-label>中获取,不需要带双引号。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>节点secret *</td>
|
||||
<td>
|
||||
<input type="password" name="oldNodeSecret" maxlength="100"/>
|
||||
<p class="comment">在节点的配置文件中<code-label>configs/api.yaml</code-label>中获取,不需要带双引号。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="ui button" type="button" @click.prevent="goBackIntro"><i class="icon long arrow left"></i>上一步</button>
|
||||
<button class="ui button primary" type="submit" v-if="!apiRequesting">下一步<i class="icon long arrow right"></i></button>
|
||||
<button class="ui button primary" type="button" v-if="apiRequesting">提交中</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 设置数据库 -->
|
||||
<div v-show="step == STEP_DB">
|
||||
<div v-show="apiNodeMode == 'new'">
|
||||
<form method="post" class="ui form" data-tea-action=".validateDb" data-tea-success="dbSuccess" data-tea-before="dbSubmit" data-tea-done="dbDone">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">MySQL主机地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="host" maxlength="100" placeholder="比如 192.168.1.100" style="width:16em" ref="dbHost" v-model="localDB.host" @change="checkDBIP" @input="localDB.isLocal = true"/>
|
||||
<p class="comment" v-if="localDBHost.length > 0 && localDBHost == localDB.host"><span class="blue">已经自动填入从当前服务器发现的MySQL数据库信息。</span></p>
|
||||
<p class="comment" v-if="!localDB.isLocal"><span class="red">当前地址不是局域网IP,可能会严重影响系统运行性能,请优先选择局域网IP。</span></p>
|
||||
<p class="comment" v-if="localDB.host.length == 0 && localDB.canInstall">如果你还没有安装MySQL,可以 <a href="" @click.prevent="installMySQL">尝试自动安装</a> 。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据库连接端口 *</td>
|
||||
<td>
|
||||
<input type="text" name="port" maxlength="5" placeholder="比如 3306" style="width:7em" v-model="localDB.port"/>
|
||||
<p class="comment">MySQL默认端口为3306。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据库名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="database" value="edges" style="width:16em"/>
|
||||
<p class="comment">请事先创建好此数据库,如果不存在,则会尝试自动创建。手动创建数据库语句<code-label>CREATE DATABASE `数据库名称` CHARSET utf8mb4;</code-label>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>连接用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" style="width:16em" maxlength="100" v-model="localDB.username"/>
|
||||
<p class="comment">此用户需要可以在数据库中有操作数据和创建数据表的权限。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>连接密码</td>
|
||||
<td>
|
||||
<input type="password" name="password" style="width:16em" maxlength="100" v-model="localDB.password"/>
|
||||
<p class="comment">连接数据库所需密码,没有密码的话就不需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>访问日志保留天数</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="number" name="accessLogKeepDays" style="width: 5em" maxlength="4" value="7"/>
|
||||
<span class="ui label">天</span>
|
||||
</div>
|
||||
<p class="comment">网站等服务记录的访问日志保留天数,防止无限制地占用数据库空间,如果你的数据库空间比较小,请适当调小此值。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<button class="ui button" type="button" @click.prevent="goBackAPI"><i class="icon long arrow left"></i>上一步</button>
|
||||
<button class="ui button primary" v-if="!dbRequesting" type="submit">下一步<i class="icon long arrow right"></i></button>
|
||||
<button class="ui button primary" v-if="dbRequesting" type="button">提交中...</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div v-show="apiNodeMode == 'old'">
|
||||
<div style="margin-bottom: 2em">你选择使用了已安装节点,无需重新配置数据库。</div>
|
||||
<button class="ui button margin" type="button" @click.prevent="goBackAPI"><i class="icon long arrow left"></i>上一步</button>
|
||||
<button class="ui button primary margin" type="button" @click.prevent="goDBNext()">下一步<i class="icon long arrow right"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 设置管理员账号 -->
|
||||
<div v-show="step == STEP_ADMIN">
|
||||
<form method="post" class="ui form" data-tea-action=".validateAdmin" data-tea-success="adminSuccess">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">登录用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="adminUsername" style="width:16em" maxlength="100" value="admin" tabindex="1"/>
|
||||
<p class="comment">只能是英文、数字和下划线的组合。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>登录密码 *</td>
|
||||
<td>
|
||||
<input type="password" name="adminPassword" maxlength="100" style="width:16em" v-model="adminPassword" v-show="!adminPasswordVisible" tabindex="2" ref="adminPasswordInput"/>
|
||||
<input type="text" value="" v-model="adminPassword" style="width:16em" v-show="adminPasswordVisible"/>
|
||||
<p class="comment">只能是英文、数字和下划线的组合 <a href="" title="显示明文密码" @click.prevent="showAdminPassword"><i class="icon eye grey"></i></a>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>确认密码 *</td>
|
||||
<td>
|
||||
<input type="password" name="adminPassword2" maxlength="100" style="width:16em" v-model="adminPassword2" v-show="!adminPasswordVisible" tabindex="3"/>
|
||||
<input type="text" value="" v-model="adminPassword2" style="width:16em" v-show="adminPasswordVisible"/>
|
||||
<p class="comment">再次输入密码以便于确认 <a href="" title="显示明文密码" @click.prevent="showAdminPassword"><i class="icon eye grey"></i></a>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<button class="ui button margin" type="button" @click.prevent="goBackDB"><i class="icon long arrow left"></i>上一步</button>
|
||||
<button class="ui button primary margin" type="submit">下一步<i class="icon long arrow right"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 完成安装 -->
|
||||
<div v-show="step == STEP_FINISH">
|
||||
<form method="post" class="ui form" data-tea-action=".install" data-tea-success="finishSuccess" data-tea-before="finishSubmit" data-tea-done="finishDone" data-tea-timeout="1200">
|
||||
<input type="hidden" name="apiNodeJSON" :value="JSON.stringify(apiNodeInfo)"/>
|
||||
<input type="hidden" name="dbJSON" :value="JSON.stringify(dbInfo)"/>
|
||||
<input type="hidden" name="adminJSON" :value="JSON.stringify(adminInfo)"/>
|
||||
|
||||
<div class="content-box">
|
||||
<h3>API节点信息</h3>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">API节点类型</td>
|
||||
<td>
|
||||
<span v-if="apiNodeInfo.mode == 'new'">自动启动新API节点</span>
|
||||
<span v-if="apiNodeInfo.mode == 'old'">使用已安装节点</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tbody v-show="apiNodeInfo.mode == 'new'">
|
||||
<tr>
|
||||
<td>节点端口 *</td>
|
||||
<td>
|
||||
{{apiNodeInfo.newPort}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>节点主机地址 *</td>
|
||||
<td>
|
||||
{{apiNodeInfo.newHost}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody v-show="apiNodeInfo.mode == 'old'">
|
||||
<tr>
|
||||
<td>节点协议 *</td>
|
||||
<td>
|
||||
{{apiNodeInfo.oldProtocol}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>主机地址 *</td>
|
||||
<td>
|
||||
{{apiNodeInfo.oldHost}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>服务端口 *</td>
|
||||
<td>
|
||||
{{apiNodeInfo.oldPort}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 v-if="apiNodeMode == 'new'">数据库信息</h3>
|
||||
<table class="ui table definition selectable" v-if="apiNodeMode == 'new'">
|
||||
<tr>
|
||||
<td class="title">MySQL主机地址 *</td>
|
||||
<td>
|
||||
{{dbInfo.host}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据库连接端口 *</td>
|
||||
<td>
|
||||
{{dbInfo.port}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据库名称 *</td>
|
||||
<td>
|
||||
{{dbInfo.database}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>连接用户名 *</td>
|
||||
<td>
|
||||
{{dbInfo.username}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>连接密码</td>
|
||||
<td>
|
||||
<span v-if="dbInfo.passwordMask != null && dbInfo.passwordMask.length > 0">{{dbInfo.passwordMask}}</span>
|
||||
<span v-else class="disabled">未填入密码</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>访问日志保留天数</td>
|
||||
<td>
|
||||
{{dbInfo.accessLogKeepDays}}天
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>管理员信息</h3>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">登录用户名</td>
|
||||
<td>{{adminInfo.username}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>登录密码</td>
|
||||
<td>{{adminInfo.passwordMask}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="button-group">
|
||||
<div class="ui divider"></div>
|
||||
<div class="status-box" v-show="statusText != null && statusText.length > 0"><span class="blue">{{statusText}}</span></div>
|
||||
|
||||
<button class="ui button" type="button" @click.prevent="goBackAdmin"><i class="icon long arrow left"></i>上一步</button>
|
||||
<button class="ui button primary" type="submit" v-if="!isInstalling">确认并开始安装</button>
|
||||
<button class="ui button disabled" type="button" v-if="isInstalling">安装中...</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
188
EdgeAdmin/web/views/@default/setup/index.js
Normal file
188
EdgeAdmin/web/views/@default/setup/index.js
Normal file
@@ -0,0 +1,188 @@
|
||||
Tea.context(function () {
|
||||
this.STEP_INTRO = "intro"
|
||||
this.STEP_API = "api"
|
||||
this.STEP_DB = "db"
|
||||
this.STEP_ADMIN = "admin"
|
||||
this.STEP_FINISH = "finish"
|
||||
|
||||
this.step = this.STEP_INTRO
|
||||
|
||||
this.$delay(function () {
|
||||
this.loadStatusText()
|
||||
})
|
||||
|
||||
// 介绍
|
||||
this.goIntroNext = function () {
|
||||
this.step = this.STEP_API
|
||||
}
|
||||
|
||||
// API节点
|
||||
this.apiNodeInfo = {}
|
||||
this.apiNodeMode = "new"
|
||||
this.newAPINodePort = "8001"
|
||||
this.apiRequesting = false
|
||||
|
||||
this.apiHostInput = false // 是否手工输入
|
||||
|
||||
this.apiSubmit = function () {
|
||||
this.apiRequesting = true
|
||||
}
|
||||
|
||||
this.apiDone = function () {
|
||||
this.apiRequesting = false
|
||||
}
|
||||
|
||||
this.apiSuccess = function (resp) {
|
||||
this.step = this.STEP_DB
|
||||
this.detectDB()
|
||||
this.apiNodeInfo = resp.data.apiNode
|
||||
|
||||
if (this.apiNodeMode == "new") {
|
||||
this.$delay(function () {
|
||||
this.$refs.dbHost.focus()
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
|
||||
this.goBackIntro = function () {
|
||||
this.step = this.STEP_INTRO
|
||||
}
|
||||
|
||||
this.inputAPIHost = function () {
|
||||
this.apiHostInput = true
|
||||
this.$delay(function () {
|
||||
this.$refs.newHostRef.focus()
|
||||
})
|
||||
}
|
||||
|
||||
// 数据库
|
||||
this.dbInfo = {}
|
||||
this.localDB = {"host": "", "port": "", "username": "", "port": "", "isLocal": true, "canInstall": false}
|
||||
this.localDBHost = ""
|
||||
this.dbRequesting = false
|
||||
|
||||
this.detectDB = function () {
|
||||
this.$post(".detectDB")
|
||||
.success(function (resp) {
|
||||
this.localDB = resp.data.localDB
|
||||
this.localDB["isLocal"] = true
|
||||
this.localDBHost = this.localDB.host
|
||||
})
|
||||
}
|
||||
|
||||
this.checkDBIP = function () {
|
||||
this.localDB["isLocal"] = true
|
||||
if (this.localDB.host.length == 0) {
|
||||
return
|
||||
}
|
||||
this.$post(".checkLocalIP")
|
||||
.params({
|
||||
host: this.localDB.host
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.localDB["isLocal"] = resp.data.isLocal
|
||||
this.$forceUpdate()
|
||||
})
|
||||
}
|
||||
|
||||
this.dbSubmit = function () {
|
||||
this.dbRequesting = true
|
||||
}
|
||||
|
||||
this.dbSuccess = function (resp) {
|
||||
this.step = this.STEP_ADMIN
|
||||
this.dbInfo = resp.data.db
|
||||
|
||||
this.$delay(function () {
|
||||
if (this.$refs.adminPasswordInput != null) {
|
||||
this.$refs.adminPasswordInput.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.dbDone = function () {
|
||||
this.dbRequesting = false
|
||||
}
|
||||
|
||||
this.goBackAPI = function () {
|
||||
this.step = this.STEP_API
|
||||
}
|
||||
|
||||
this.goDBNext = function () {
|
||||
this.step = this.STEP_ADMIN
|
||||
}
|
||||
|
||||
// 管理员
|
||||
this.goBackDB = function () {
|
||||
this.step = this.STEP_DB
|
||||
}
|
||||
|
||||
this.adminInfo = {}
|
||||
this.adminPassword = ""
|
||||
this.adminPassword2 = ""
|
||||
this.adminPasswordVisible = false
|
||||
|
||||
this.showAdminPassword = function () {
|
||||
this.adminPasswordVisible = !this.adminPasswordVisible
|
||||
|
||||
// TODO 切换密码显示的时候应该focus输入框
|
||||
}
|
||||
|
||||
this.adminSuccess = function (resp) {
|
||||
this.step = this.STEP_FINISH
|
||||
this.adminInfo = resp.data.admin
|
||||
}
|
||||
|
||||
// 结束
|
||||
this.goBackAdmin = function () {
|
||||
this.step = this.STEP_ADMIN
|
||||
}
|
||||
|
||||
this.isInstalling = false
|
||||
this.finishSubmit = function () {
|
||||
this.isInstalling = true
|
||||
}
|
||||
|
||||
this.finishDone = function () {
|
||||
this.isInstalling = false
|
||||
}
|
||||
|
||||
this.finishSuccess = function () {
|
||||
teaweb.success("html:恭喜你!安装完成!<br/>请记住你创建的管理员账号,现在跳转到登录界面。", function () {
|
||||
window.location = "/"
|
||||
})
|
||||
}
|
||||
|
||||
this.statusText = ""
|
||||
this.loadStatusText = function () {
|
||||
if (!this.isInstalling) {
|
||||
this.statusText = ""
|
||||
this.$delay(function () {
|
||||
this.loadStatusText()
|
||||
}, 1000)
|
||||
return
|
||||
}
|
||||
this.$post(".status")
|
||||
.success(function (resp) {
|
||||
this.statusText = resp.data.statusText
|
||||
})
|
||||
.done(function () {
|
||||
this.$delay(function () {
|
||||
this.loadStatusText()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* MySQL
|
||||
*/
|
||||
this.installMySQL = function () {
|
||||
let that = this
|
||||
teaweb.popup("/setup/mysql/installPopup", {
|
||||
height: "28em",
|
||||
onClose: function () {
|
||||
that.detectDB()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
90
EdgeAdmin/web/views/@default/setup/index.less
Normal file
90
EdgeAdmin/web/views/@default/setup/index.less
Normal file
@@ -0,0 +1,90 @@
|
||||
.install-box {
|
||||
@width: 50em;
|
||||
@half-width: 25em;
|
||||
|
||||
width: @width;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -@half-width;
|
||||
top: 1em;
|
||||
bottom: 1em;
|
||||
overflow-y: auto;
|
||||
|
||||
.button.margin {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.button.primary {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.button.disabled {
|
||||
float: right;
|
||||
}
|
||||
|
||||
table {
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td.title {
|
||||
width: 10em;
|
||||
}
|
||||
}
|
||||
|
||||
.radio {
|
||||
margin-right: 1em;
|
||||
|
||||
label {
|
||||
cursor: pointer !important;
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.content-box {
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
top: 5em;
|
||||
bottom: 5em;
|
||||
left: 50%;
|
||||
width: @width;
|
||||
padding-right: 1em;
|
||||
margin-left: -@half-width;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.content-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -@half-width;
|
||||
z-index: 1;
|
||||
width: @width;
|
||||
bottom: 1em;
|
||||
|
||||
button {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.status-box {
|
||||
position: absolute;
|
||||
top: 3em;
|
||||
left: 8em;
|
||||
right: 8em;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.install-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
32
EdgeAdmin/web/views/@default/setup/mysql/installPopup.css
Normal file
32
EdgeAdmin/web/views/@default/setup/mysql/installPopup.css
Normal file
@@ -0,0 +1,32 @@
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
td.title {
|
||||
width: 10em;
|
||||
}
|
||||
.result-box .row {
|
||||
line-height: 1.8;
|
||||
}
|
||||
.result-box .button-box {
|
||||
margin-top: 1em;
|
||||
}
|
||||
.logs-box {
|
||||
max-height: 12em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.logs-box .row {
|
||||
line-height: 1.8;
|
||||
}
|
||||
.logs-box::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
h4 {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
.green {
|
||||
color: #21ba45;
|
||||
}
|
||||
.red {
|
||||
color: #db2828;
|
||||
}
|
||||
/*# sourceMappingURL=installPopup.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["installPopup.less"],"names":[],"mappings":"AAAA;EACC,mBAAA;;AAGD,EAAE;EACD,WAAA;;AAGD,WACC;EACC,gBAAA;;AAFF,WAKC;EACC,eAAA;;AAIF;EACC,gBAAA;EACA,gBAAA;;AAFD,SAIC;EACC,gBAAA;;AAIF,SAAS;EACR,UAAA;;AAGD;EACC,8BAAA;;AAGD;EACC,cAAA;;AAGD;EACC,cAAA","file":"installPopup.css"}
|
||||
74
EdgeAdmin/web/views/@default/setup/mysql/installPopup.html
Normal file
74
EdgeAdmin/web/views/@default/setup/mysql/installPopup.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.png"/>
|
||||
<title>安装GoEdge管理系统</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
|
||||
<link rel="stylesheet" href="/_/@default/@layout_popup.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/css/semantic.iframe.min.css?v=bRafhK" media="all"/>
|
||||
{$TEA.VUE}
|
||||
<link rel="stylesheet" type="text/css" href="/_/@default/@layout_override.css" media="all"/>
|
||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||
<script type="text/javascript" src="/js/utils.min.js"></script>
|
||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||
<script type="text/javascript" src="/js/components.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div>
|
||||
<div class="margin"></div>
|
||||
<h4>方法1:使用命令安装MySQL</h4>
|
||||
<table class="ui table selectable">
|
||||
<tr>
|
||||
<td>可以在你要安装MySQL的服务器上运行以下命令<span class="grey">(目前仅支持Linux系统和X86架构服务器,安装后的MySQL版本是8.x.x)</span>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sudo sh -c "$(wget https://goedge.cn/install-mysql.sh -O -)"</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>方法2:在本机自动安装MySQL</h4>
|
||||
<table class="ui table selectable">
|
||||
<tr>
|
||||
<td colspan="2">如果你想在当前管理系统所在服务器上安装MySQL,可以点击下面的按钮自动开始尝试安装,如果安装不成功,请自行安装<span class="grey">(建议仅在小流量应用场景或测试期间使用此功能)</span>:</td>
|
||||
</tr>
|
||||
<tr v-show="!result.isInstalling">
|
||||
<td colspan="2">
|
||||
<button class="ui button small" type="button" @click.prevent="install" v-if="!result.isInstalled">尝试在本机安装</button>
|
||||
<button class="ui button small" type="button" @click.prevent="install" v-if="result.isInstalled && !result.isOk">重新尝试安装</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="result.isInstalled">
|
||||
<td class="title">安装结果</td>
|
||||
<td>
|
||||
<div v-if="result.isOk" class="green result-box">
|
||||
<div class="row">安装成功,请使用记事本或其他工具记录下面MySQL信息,防止以后忘记:</div>
|
||||
<div class="row">安装目录:{{result.dir}}</div>
|
||||
<div class="row">用户:{{result.user}}</div>
|
||||
<div class="row">密码:{{result.password}}</div>
|
||||
<div class="button-box">
|
||||
<button class="ui button small" type="button" @click.prevent="finish">我已完成记录</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!result.isOk" class="red">
|
||||
<div>
|
||||
安装失败:{{result.err}}
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
<div>请将以上错误信息报告给开发者,并改用其他方式安装MySQL。</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="result.isInstalling || (result.isInstalled && !result.isOk)">
|
||||
<td class="title">安装过程</td>
|
||||
<td>
|
||||
<div class="logs-box">
|
||||
<div v-for="log in result.logs" class="row">{{log}}</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
65
EdgeAdmin/web/views/@default/setup/mysql/installPopup.js
Normal file
65
EdgeAdmin/web/views/@default/setup/mysql/installPopup.js
Normal file
@@ -0,0 +1,65 @@
|
||||
Tea.context(function () {
|
||||
this.result = {
|
||||
isInstalling: false,
|
||||
isInstalled: false,
|
||||
isOk: false,
|
||||
err: "",
|
||||
|
||||
user: "",
|
||||
password: "",
|
||||
dir: "",
|
||||
|
||||
logs: []
|
||||
}
|
||||
|
||||
this.$delay(function () {
|
||||
this.checkStatus()
|
||||
})
|
||||
|
||||
this.install = function () {
|
||||
this.result.isInstalling = true
|
||||
this.result.isInstalled = false
|
||||
this.result.logs = []
|
||||
|
||||
this.$post(".installPopup")
|
||||
.timeout(3600)
|
||||
.success(function (resp) {
|
||||
this.result.isOk = resp.data.isOk
|
||||
if (!resp.data.isOk) {
|
||||
this.result.err = resp.data.err
|
||||
} else {
|
||||
this.result.user = resp.data.user
|
||||
this.result.password = resp.data.password
|
||||
this.result.dir = resp.data.dir
|
||||
}
|
||||
this.result.isInstalled = true
|
||||
this.result.isInstalling = false
|
||||
})
|
||||
}
|
||||
|
||||
this.checkStatus = function () {
|
||||
if (!this.result.isInstalling) {
|
||||
this.$delay(function () {
|
||||
this.checkStatus()
|
||||
}, 1000)
|
||||
return
|
||||
}
|
||||
|
||||
this.$post(".installLogs")
|
||||
.success(function (resp) {
|
||||
let that = this
|
||||
resp.data.logs.forEach(function (log) {
|
||||
that.result.logs.unshift(log)
|
||||
})
|
||||
})
|
||||
.done(function () {
|
||||
this.$delay(function () {
|
||||
this.checkStatus()
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
|
||||
this.finish = function () {
|
||||
teaweb.closePopup()
|
||||
}
|
||||
})
|
||||
42
EdgeAdmin/web/views/@default/setup/mysql/installPopup.less
Normal file
42
EdgeAdmin/web/views/@default/setup/mysql/installPopup.less
Normal file
@@ -0,0 +1,42 @@
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td.title {
|
||||
width: 10em;
|
||||
}
|
||||
|
||||
.result-box {
|
||||
.row {
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.button-box {
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.logs-box {
|
||||
max-height: 12em;
|
||||
overflow-y: auto;
|
||||
|
||||
.row {
|
||||
line-height: 1.8;
|
||||
}
|
||||
}
|
||||
|
||||
.logs-box::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #21ba45;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #db2828;
|
||||
}
|
||||
Reference in New Issue
Block a user