diff --git a/.env.development b/.env.development
index b69176e..a47b479 100644
--- a/.env.development
+++ b/.env.development
@@ -1,3 +1,3 @@
NODE_ENV="preview"
# VUE_APP_BASE_URL="http://172.16.16.120:8080"
-VUE_APP_BASE_URL="http://localhost"
\ No newline at end of file
+VUE_APP_BASE_URL="http://10.100.0.108:8082"
\ No newline at end of file
diff --git a/examples/App.vue b/examples/App.vue
index 28bbdc4..c6f15c9 100644
--- a/examples/App.vue
+++ b/examples/App.vue
@@ -1,5 +1,5 @@
- console.log(pwd)" :checkUser="true" username="超级管理员" :closeAble="true"
+ console.log(pwd)" :checkUser="false" username="超级管理员" :closeAble="true"
mode="horizontal">
diff --git a/examples/view/home.vue b/examples/view/home.vue
index 82ba547..765c77e 100644
--- a/examples/view/home.vue
+++ b/examples/view/home.vue
@@ -1,15 +1,16 @@
- {{ t('title') }}
- {{ t('title') }}
+
+
\ No newline at end of file
diff --git a/packages/base/data/list-table.vue b/packages/base/data/list-table.vue
index 214a2cc..3b7e64d 100644
--- a/packages/base/data/list-table.vue
+++ b/packages/base/data/list-table.vue
@@ -1,7 +1,7 @@
-
@@ -82,7 +82,7 @@ const prop = defineProps({
},
});
-const emit = defineEmits(["query", "selection-change"]);
+const emit = defineEmits(["query", "selection-change", "row-click"]);
const selectionChange = selection => {
emit("selection-change", selection);
@@ -199,7 +199,7 @@ onUpdated(() => {
}
::v-deep .el-table .el-table__cell {
- padding: v-bind('state.size.tablePad') 0px;
+ padding: v-bind('state.size.tablePad');
}
.my-pagination * {
diff --git a/packages/base/item/select.vue b/packages/base/item/select.vue
index 6cfab90..898f1d1 100644
--- a/packages/base/item/select.vue
+++ b/packages/base/item/select.vue
@@ -1,8 +1,9 @@
-
+ :clearable="clearable" @change="$emit('change', myValue)" :teleported="false" :remote="remote"
+ :remote-method="remoteMethod">
+
@@ -58,6 +59,14 @@ const prop = defineProps({
type: String,
default: 'value'
},
+ remote: {
+ type: Boolean,
+ default: false,
+ },
+ remoteMethod: {
+ type: Function,
+ default: null,
+ }
});
const emit = defineEmits(["update:modelValue", 'change']);
const myValue = ref(null);
diff --git a/packages/manage/common/login.vue b/packages/manage/common/login.vue
index dc760f9..e8103d5 100644
--- a/packages/manage/common/login.vue
+++ b/packages/manage/common/login.vue
@@ -83,8 +83,6 @@ const login = () => {
});
}
const enter_up = (e) => {
- console.log(e);
-
if (e.keyCode == 13 || e.keyCode == 100) {
login();
}
diff --git a/packages/manage/router/index.vue b/packages/manage/router/index.vue
index 6057d60..ac71dc9 100644
--- a/packages/manage/router/index.vue
+++ b/packages/manage/router/index.vue
@@ -208,8 +208,11 @@ body {
#app {
.el-input,
- .el-textarea {
+ .el-textarea,
+ .el-date-editor,
+ .el-input__wrapper {
--el-input-bg-color: v-bind('state.style.itemBg') !important;
+ --el-fill-color-blank: v-bind('state.style.itemBg') !important;
--el-input-text-color: v-bind('state.style.color') !important;
}
diff --git a/packages/manage/views/user.vue b/packages/manage/views/user.vue
index d73c89f..c47c867 100644
--- a/packages/manage/views/user.vue
+++ b/packages/manage/views/user.vue
@@ -36,7 +36,7 @@
+
\ No newline at end of file
diff --git a/packages/tool/index.ts b/packages/tool/index.ts
index a0d3687..2497ee8 100644
--- a/packages/tool/index.ts
+++ b/packages/tool/index.ts
@@ -1,5 +1,6 @@
import Terminal from './terminal.vue';
import TerminalSplit from './terminal-split.vue';
import Color from './color.vue';
+import GrafanaIframe from './grafana-iframe.vue';
-export { TerminalSplit, Terminal, Color };
+export { TerminalSplit, Terminal, Color, GrafanaIframe };
diff --git a/packages/tool/terminal-split.vue b/packages/tool/terminal-split.vue
index 257ee79..3ce8e72 100644
--- a/packages/tool/terminal-split.vue
+++ b/packages/tool/terminal-split.vue
@@ -31,6 +31,14 @@ const prop = defineProps({
prmt: {
type: String,
default: ">"
+ },
+ cols: {
+ type: Number,
+ default: 80
+ },
+ rows: {
+ type: Number,
+ default: 40
}
});
const flag = reactive({
@@ -95,31 +103,69 @@ const onKey = e => {
//\x1B ESC
//\x1BOP-\x1B[24~ F1-F12
const key = e.key;
- if (key.indexOf("\u001b") !== -1) {
+
+ if (key.indexOf("\u001b") !== -1 || !isWsOpen()) {
return;
}
- if (isWsOpen()) {
- if (key === '\x7F') {
- if (text.length > 0) {
- term.value.write("\b \b");
- text = text.substring(0, text.length - 1)
- }
- return;
- }
- if (key == '\r') {
- term.value.writeln(key)
- if (e.domEvent.ctrlKey) {
- text += key;
- } else {
- sendText(text);
- text = "";
- }
- } else {
- text += key
- term.value.write(key)
- }
+ if (back(e) || newLine(e) || cancel(e) || copy(e) || paste(e))
+ return;
+ text += key;
+ term.value.write(key);
+}
+
+const back = e => {
+ if (e.key !== '\x7F') {//回退
+ return false;
}
+ if (text.length > 0) {
+ term.value.write("\b \b");
+ text = text.substring(0, text.length - 1)
+ }
+ return true;
}
+const newLine = (e) => {
+ const key = e.key;
+ if (key !== '\r') {//回车
+ return false;
+ }
+ term.value.writeln(key)
+ if (e.domEvent.ctrlKey) {
+ text += key;
+ } else {
+ sendText(text);
+ text = "";
+ }
+ return true;
+}
+const cancel = (e) => {
+ if (e.key !== '\x1A') {//ctrl+z
+ return false;
+ }
+ if(text){
+ term.value.writeln("\r");
+ term.value.write(prop.prmt);
+ text = "";
+ }
+ return true;
+}
+const copy = e => {
+ if (e.key !== '\x03') {//ctrl+c
+ return false;
+ }
+
+ return true;
+}
+const paste = (e) => {
+ if (e.key !== '\x16') {//粘贴
+ return false;
+ }
+ navigator.clipboard.readText().then(val => {
+ text += val;
+ term.value.write(val);
+ })
+ return true;
+}
+
const initTerm = () => {
const options: any = {
lineHeight: 1.2,
@@ -133,9 +179,9 @@ const initTerm = () => {
cursorStyle: 'underline',
scrollback: 100,
tabStopWidth: 2,
- cols: 80
+ cols: prop.cols,
+ rows: prop.rows
}
- options.cols = Math.ceil((window.innerWidth - 80) / 20)
term.value = new Terminal(options);
term.value.open(terminal.value);
term.value.onKey(onKey);
@@ -166,11 +212,11 @@ const showClear = e => {
document.oncontextmenu = function (e) {
e.preventDefault();
};
- navigator.clipboard.readText().then(content => {
- term.value.write(content)
- text += content;
- // sendText(content);
- })
+ // navigator.clipboard.readText().then(content => {
+ // term.value.write(content)
+ // text += content;
+ // sendText(content);
+ // })
// term.value.clear();
}
diff --git a/plugs/http/axios.ts b/plugs/http/axios.ts
index 2a48000..d8bf87c 100644
--- a/plugs/http/axios.ts
+++ b/plugs/http/axios.ts
@@ -164,6 +164,7 @@ function handResponse(response, resolve, noMsg, noLoading) {
} else {
if (response.message == 'session timeout') {
router?.push('/login');
+ response.message = t('http.unLogin');
}
if (response.message == 'no permission') {
response.message = t('http.unPermission');
diff --git a/plugs/i18n/zh.ts b/plugs/i18n/zh.ts
index ad06892..c426b68 100644
--- a/plugs/i18n/zh.ts
+++ b/plugs/i18n/zh.ts
@@ -82,6 +82,7 @@ export default class Zh {
noPermission: '此权限尚未开放,请勿越权访问',
error: '网络错误',
downFail: '下载失败,网络异常!',
+ unLogin: '请先登录系统',
};
preMenu = {
diff --git a/plugs/store/index.ts b/plugs/store/index.ts
index 14d0a47..f42aa90 100644
--- a/plugs/store/index.ts
+++ b/plugs/store/index.ts
@@ -76,7 +76,7 @@ export class Mutations {
size.tableHeight = size.height - 2 * (mainPad + searchRowPad) - 3 - searchRow - head;
size.pTableHeight = size.tableHeight - size.pageHeight;
- size.headLeftWidth = size.width - headRightWidth - 10 + 'px';
+ size.headLeftWidth = size.width - headRightWidth - 20 + 'px';
};
updateDict = (state, param) => {
state.dict[param[0]] = param[1];