新增 地址会话参数

This commit is contained in:
Suwings 2020-03-01 22:39:19 +08:00
parent c08eecded0
commit c0eb0aa3b2
19 changed files with 114 additions and 37 deletions

View File

@ -8,7 +8,7 @@
name: '用户中心', //菜单名
link: './template/gen_home.html', //单击时跳转目的
api: 'genuser/home', //通过 Webscoket 后端请求的API,null为不请求,
select: true
select: false
}, {
class: 'glyphicon-th-list', //html元素 类
name: '文件管理', //菜单名
@ -30,7 +30,7 @@
name: '监控数据中心',
link: './template/center.html',
api: 'center/show',
select: true
select: false
}, {
class: 'glyphicon-tasks',
name: '服务端管理',

View File

@ -244,4 +244,50 @@
oReq.send(oMyForm);
}
TOOLS.page = function (toUrl) {
var url = window.location.href;
//page=template/component/console.html&api=server/console&v=sds
var parameter = url.split("#")[1];
if (!parameter) return false;
// [api=server/console,xxx=xxx]
parameter = parameter.split("&");
var parameters = {};
for (var k in parameter) {
var z = parameter[k].split("=");
parameters[z[0]] = z[1];
}
console.log(parameters)
if (parameters['page']) {
RES.redirectPage('./' + parameters['page'] + ".html", parameters['api'], parameters['listen']);
return true
} else {
return false;
}
}
TOOLS.definePage = function (v1, v2, v3) {
if (MCSERVER.listenServername) {
v3 = MCSERVER.listenServername;
} else {
v3 = MCSERVER.listenServername = TOOLS.pageParameter('listen');
}
console.log('definePage:', "#page=" + v1 + "&api=" + v2 + "&listen=" + v3);
window.location.hash = "#page=" + v1 + "&api=" + v2 + "&listen=" + v3;
}
TOOLS.pageParameter = function (pageKey) {
var hash = window.location.hash;
var parameter = hash.split("&");
for (var k in parameter) {
var z = parameter[k].split("=");
if (z[0] == pageKey) {
return z[1];
}
}
return null;
}
})();

View File

@ -214,7 +214,6 @@
RES.getToken(function (token) {
RES.TOKEN = token;
console.log('用户登陆:' + MCSERVER.username);
//初始化 Websocket
WS.init(function () {
@ -223,22 +222,22 @@
WS.sendMsg('menu', '');
//异步自动获取单页
setTimeout(function () {
//是否登陆
if (!MCSERVER.username) {
window.location.href = MCSERVER.URL("login");
return;
}
//是否登陆
if (!MCSERVER.username) {
window.location.href = MCSERVER.URL("login");
return;
}
// 判断是否需要进行页面转移
if (!TOOLS.page(true)) {
//判断是否是#权限用户,请放心,后端也会给予判断并不只是前端
if (MCSERVER.username.substr(0, 1) == '#') {
RES.redirectPage('./template/center.html', 'center/show', '--- 更新页面 ---');
} else {
RES.redirectPage('./template/gen_home.html', 'genuser/home', '--- 更新页面 ---');
}
}, 300);
}
});
});

View File

@ -180,6 +180,9 @@
<script>
//创建
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/center', 'center/show', null);
PAGE.time = function (value) {
return function () {
var theTime = parseInt(Math.floor(this.uptime)); // 秒

View File

@ -176,8 +176,12 @@
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/component/console', 'server/console', MCSERVER.listenServername);
var serverName = MCSERVER.listenServername;
var serverName = MCSERVER.listenServername || "";
VIEW_MODEL.newVue('ConsolePanel', {
el: '#ConsolePanel',

View File

@ -25,35 +25,29 @@
<tr>
<th>原密码</th>
<th>
<center>
<div class="input-group input-group-sm">
<input type="password" class="form-control"
aria-describedby="basic-addon1" v-model="oldPassword" />
</div>
</center>
<div class="input-group input-group-sm">
<input type="password" class="form-control" aria-describedby="basic-addon1"
v-model="oldPassword" />
</div>
</th>
</tr>
<tr>
<th>新密码</th>
<th>
<center>
<div class="input-group input-group-sm">
<input type="password" class="form-control"
aria-describedby="basic-addon1" v-model="newPassword1" />
</div>
</center>
<div class="input-group input-group-sm">
<input type="password" class="form-control" aria-describedby="basic-addon1"
v-model="newPassword1" />
</div>
</th>
</tr>
<tr>
<th>确认新密码</th>
<th>
<center>
<div class="input-group input-group-sm">
<input type="password" class="form-control"
aria-describedby="basic-addon1" v-model="newPassword2" />
</div>
</center>
<div class="input-group input-group-sm">
<input type="password" class="form-control" aria-describedby="basic-addon1"
v-model="newPassword2" />
</div>
</th>
</tr>
</table>
@ -75,7 +69,9 @@
<!--js-->
<script>
MI.rListener('onload', function () {
// MCSERVER.colmSet(false);
// 定义页面地址
TOOLS.definePage('template/component/gen_repassword', '', '');
new Vue({
el: '#gen_re_password',
data: {

View File

@ -55,6 +55,8 @@
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/component/new_docker_image', 'genuser/home', null);
new Vue({
el: "#NewDockerImage",
data: {

View File

@ -97,6 +97,9 @@
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/component/newserver', 'genuser/home', '');
VIEW_MODEL.newVue('CreateServerView', {
el: '#CreateServerView',
data: {

View File

@ -227,6 +227,10 @@
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/component/newserverx', 'genuser/home', '');
VIEW_MODEL.newVue('CreateServerViewx', {
el: '#CreateServerViewx',
data: {

View File

@ -71,6 +71,9 @@
<script src="./common/js/properties.js"></script>
<script>
// 定义页面地址
TOOLS.definePage('template/component/properties', 'server/properties', MCSERVER.listenServername);
MI.rListener('onload', function () {
// MCSERVER.autoColmDo();

View File

@ -56,6 +56,9 @@
MI.rListener('onload', function () {
MCSERVER.website.schedule = {};
// 定义页面地址
TOOLS.definePage('template/component/schedule', 'schedule/list', MCSERVER.listenServername);
VIEW_MODEL.newVue('ServerSchedule', {
el: '#ServerSchedule',
methods: {

View File

@ -40,8 +40,8 @@
</div>
<script>
MI.rListener('onload', function () {
//默认隐藏控制台
// MCSERVER.colmSet(false);
// 定义页面地址
TOOLS.definePage('template/component/terminal', 'server/console', MCSERVER.listenServername);
PAGE.nowPage = 0; //当前最低页
PAGE.serverName = MCSERVER.listenServername;

View File

@ -66,6 +66,9 @@
</div>
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/feelback', '', null);
//请求早已缓存的 最新动态
RES.ajax({
type: 'GET',

View File

@ -58,6 +58,9 @@
<!--js-->
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/filemanager', 'genuser/home', null);
// MCSERVER.colmSet(false);
VIEW_MODEL.newVue('GenHome', {
el: '#QuickOperation',

View File

@ -25,9 +25,8 @@
</div>
<script>
MI.rListener('onload', function () {
//自動調整菜單
// MCSERVER.autoColmDo();
// 定义页面地址
TOOLS.definePage('template/gen_about', 'genuser/home', '');
})
MI.rListener('onend', function () { })

View File

@ -101,6 +101,9 @@
<!--js-->
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/gen_home', 'genuser/home', '');
// MCSERVER.colmSet(false);
VIEW_MODEL.newVue('GenHome', {
el: '#GenHome',

View File

@ -222,6 +222,9 @@
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/server', 'server/view', null);
VIEW_MODEL.newVue('ServerList', {
el: '#ServerList',
methods: {

View File

@ -112,6 +112,9 @@
</div>
<script>
MI.rListener('onload', function () {
// 定义页面地址
TOOLS.definePage('template/userset', 'userset/update', null);
VIEW_MODEL.newVue('UsersetList', {
el: '#UsersetList',
data: {

View File

@ -16,5 +16,5 @@ WebSocketObserver().listener('menu', (data) => {
response.wsSend(data.ws, 'ws/muem', {
username: data.WsSession.username,
});
response.wsMsgWindow(data.ws, '欢迎上线 ' + data.WsSession.username);
// response.wsMsgWindow(data.ws, '欢迎上线 ' + data.WsSession.username);
});