<!DOCTYPE html>
<html>

<head>
    <!-- meta -->
    <meta name="mobile-web-app-capable" charset="utf-8" content="yes">
    <meta name="viewport"
          content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1,target-densitydpi=device-dpi" />
    <!-- title -->
    <title>Update...</title>
    <script>
        window.nodeRequire = require;
        delete window.require;
        delete window.exports;
        delete window.module;
    </script>
    <link rel="stylesheet" href="JSplugins/angular-material-lite/material-design-lite/material.min.css" />
    <link rel="stylesheet" href="JSplugins/angular-material-lite/angular-material-lite.css" />
    <link rel="stylesheet" href="css/app.css" />
    <link rel="stylesheet" href="css/kmi-client.css" />

    <script defer src="JSplugins/jQuery/jquery-2.2.4.min.js"></script>
    <script defer src="JSplugins/angular-material-lite/material-design-lite/material.js"></script>
    <script defer src="JSplugins/moment/moment.min.js"></script>
    <script defer src="JSplugins/angular/angular.min.js"></script>
    <script defer src="JSplugins/angular-translate/angular-translate.min.js"></script>
    <script defer src="JSplugins/angular-translate/loader-static-files.min.js"></script>
    <script defer src="JSplugins/angular-css/angular-css.js"></script>
    <script defer src="JSplugins/angular-material-lite/angular-material-lite.js"></script>
    <script defer src="startup.js"></script>
    <script src="cordova.js"></script>
    <script src="JSplugins/cordova/Insomnia.js"></script>
    <!-- style -->
    <style type="text/css">
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            background: url(image/BG.jpg);
            background-size: cover;
        }

        .update-content {
            background: #eeefef;
            width: 80%;
            border-radius: 4px;
            padding: 20px;
            box-sizing: border-box;
        }

        .update-title {
            margin: 8px;
        }
    </style>
</head>

<body>
    <div class="update-content mdl-shadow--8dp" id='update_controller' ng-controller="update_controller"
         ng-init="init();" style="display:none;">
        <div style="display:flex;">
            <div class="mdl-spinner mdl-spinner--single-color mdl-js-spinner is-active" ng-show="mode != 'setting'">
            </div>
            <div class="update-title" id="update_log"></div>
        </div>
        <div ng-show="mode == 'setting'">
            <div class="perfect-scrollbar bar" style="height: 231px;">
                <div class="kmi-text-fields--triangle fields-ip" ng-if="!isHideRetry">
                    <div class="label">
                        <label ng-bind="'Setting.deviceName' | translate"></label>
                        <label class="triangle"></label>
                    </div>
                    <div class="input">
                        <input ng-model="config.setting.deviceName"></input>
                    </div>
                </div>
                <div class="kmi-text-fields--triangle">
                    <div class="label">
                        <label ng-bind="'Setting.connectionMode' | translate"></label>
                        <label class="triangle"></label>
                    </div>
                    <button class="mdl-button mdl-js-button kmi-checkbox ng-binding" ng-click="config.setting.DNSMode = false;" style="flex: 1 1 150px;height: 32px;">
                        <img ng-src="{{config.setting.DNSMode == false || config.setting.DNSMode  == undefined ?'image/icons/check1.png':'image/icons/check0.png'}}"></img>
                        <label>IP</label>
                    </button>

                    <button class="mdl-button mdl-js-button kmi-checkbox ng-binding" ng-click="config.setting.DNSMode = true;" style="flex: 1 1 150px;height: 32px;">
                        <img ng-src="{{config.setting.DNSMode == true ?'image/icons/check1.png':'image/icons/check0.png'}}"></img>
                        <label>DNS</label>
                    </button>
                </div>
                <div class="kmi-text-fields--triangle fields-ip" ng-if="!isHideRetry">
                    <div class="label" ng-click="showWSClick();">
                        <label ng-bind="'Setting.server.ip' | translate"></label>
                        <label class="triangle"></label>
                    </div>
                    <div class="input" ng-show="config.setting.DNSMode == false || config.setting.DNSMode  == undefined">
                        <input ng-repeat="ip in serverIp track by $index" type="text"
                               mdl-calculater="serverIp[$index]"></input>
                    </div>
                    <div class="input" ng-show="config.setting.DNSMode == true">
                        <input ng-model="config.server.DNS"></input>
                    </div>
                </div>
                <div ng-show="showWS">
                    <div class="kmi-text-fields--triangle fields-ip">
                        <div class="label">
                            <label ng-bind="'Setting.server.prodSTD' | translate"></label>
                            <label class="triangle"></label>
                        </div>
                        <div class="input">
                            <input ng-model="config.serverList.Production.name"></input>
                        </div>
                    </div>
                    <div class="kmi-text-fields--triangle fields-ip">
                        <div class="label">
                            <label ng-bind="'Setting.server.prodEAI' | translate"></label>
                            <label class="triangle"></label>
                        </div>
                        <div class="input">
                            <input ng-model="config.serverList.Production.eainame"></input>
                        </div>
                    </div>
                    <div class="kmi-text-fields--triangle fields-ip">
                        <div class="label">
                            <label ng-bind="'Setting.server.prodSC' | translate"></label>
                            <label class="triangle"></label>
                        </div>
                        <div class="input">
                            <input ng-model="config.serverList.Production.scname"></input>
                        </div>
                    </div>
                    <div class="kmi-text-fields--triangle fields-ip">
                        <div class="label">
                            <label ng-bind="'Setting.server.testSTD' | translate"></label>
                            <label class="triangle"></label>
                        </div>
                        <div class="input">
                            <input ng-model="config.serverList.Test.name"></input>
                        </div>
                    </div>
                    <div class="kmi-text-fields--triangle fields-ip">
                        <div class="label">
                            <label ng-bind="'Setting.server.testEAI' | translate"></label>
                            <label class="triangle"></label>
                        </div>
                        <div class="input">
                            <input ng-model="config.serverList.Test.eainame"></input>
                        </div>
                    </div>
                    <div class="kmi-text-fields--triangle fields-ip">
                        <div class="label">
                            <label ng-bind="'Setting.server.testSC' | translate"></label>
                            <label class="triangle"></label>
                        </div>
                        <div class="input">
                            <input ng-model="config.serverList.Test.scname"></input>
                        </div>
                    </div>
                </div>
                <div class="kmi-text-fields--triangle" ng-if="!isHideRetry">
                    <div class="label">
                        <label ng-bind="'Setting.server.port' | translate"></label>
                        <label class="triangle"></label>
                    </div>
                    <div class="input">
                        <input type="text" mdl-calculater="config.server.port"></input>
                    </div>
                </div>
                <div class="kmi-text-fields--triangle" ng-if="!isHideRetry">
                    <div class="label">
                        <label ng-bind="'Login.environment' | translate"></label>
                        <label class="triangle"></label>
                    </div>
                    <div class="input">
                        <input type="text" ng-value="'Login.env.' + environment | translate" readonly="readonly"
                               ng-click="loadServerList();"></input>
                    </div>
                </div>
            </div>
            <div style="display:flex;justify-content: flex-end;">
                <div class="kmi-button kmi-button-confirm" ng-if="!isHideRetry" ng-click="checkNecessaryInformation() || reCheckUpdate()" ng-disabled="checkNecessaryInformation();"
                     style="width:100px">
                    <label ng-bind="'common.btn.retry' | translate"></label></label>
                    <div class="kmi-can-click"></div>
                </div>
                <div class="kmi-button kmi-button-confirm" ng-if="isElectron" ng-click="close();" style="width:100px">
                    <label ng-bind="'common.btn.close' | translate"></label></label>
                    <div class="kmi-can-click"></div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>