-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Use
element-plus
instead of naive-ui
When some components need custom rendering, slot cannot be used, only the h function can be used in `naive-ui`. As a typical example, when using a table component, you often need to do a custom rendering of a column of data returned by the background. At this point in the `.vue` single file can only use the h function to perform custom rendering. Signed-off-by: Jianhui Zhao <[email protected]>
- Loading branch information
Showing
48 changed files
with
6,206 additions
and
4,260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
local file = require 'eco.file' | ||
local cjson = require 'cjson' | ||
local rpc = require 'oui.rpc' | ||
|
||
local M = {} | ||
|
||
function M.load() | ||
local res = {} | ||
|
||
for group, acls in pairs(rpc.get_acls()) do | ||
local acl = {} | ||
|
||
for cls, info in pairs(acls) do | ||
acl[#acl + 1] = { | ||
cls = cls, | ||
matchs = info.matchs, | ||
reverse = not not info.reverse | ||
} | ||
end | ||
|
||
res[group] = acl | ||
end | ||
|
||
return res | ||
end | ||
|
||
function M.set(params) | ||
for name in file.dir('/usr/share/oui/acl') do | ||
if name ~= '.' and name ~= '..' then | ||
os.remove('/usr/share/oui/acl/' .. name) | ||
end | ||
end | ||
|
||
for group, acls in pairs((params.acls)) do | ||
local acl = {} | ||
for _, info in ipairs(acls) do | ||
acl[info.cls] = { | ||
matchs = info.matchs, | ||
reverse = info.reverse | ||
} | ||
end | ||
file.writefile('/usr/share/oui/acl/' .. group .. '.json', cjson.encode(acl)) | ||
end | ||
|
||
rpc.load_acl() | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<el-tag v-for="tag in modelValue" :key="tag" style="margin-right: 10px;" closable @close="handleClose(tag)">{{ tag }}</el-tag> | ||
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" style="width: 200px;" size="small" | ||
@keyup.enter="handleInputConfirm" @blur="handleInputConfirm"/> | ||
<el-button v-else class="button" size="small" @click="showInput">+</el-button> | ||
</template> | ||
|
||
<script> | ||
import { nextTick } from 'vue' | ||
export default { | ||
props: { | ||
modelValue: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
emits: ['update:modelValue'], | ||
data() { | ||
return { | ||
inputVisible: false, | ||
inputValue: '' | ||
} | ||
}, | ||
methods: { | ||
handleClose(tag) { | ||
this.$emit('update:modelValue', this.modelValue.filter(x => x !== tag)) | ||
}, | ||
showInput() { | ||
this.inputVisible = true | ||
nextTick(() => this.$refs.InputRef.input.focus()) | ||
}, | ||
handleInputConfirm() { | ||
if (this.inputValue) | ||
this.$emit('update:modelValue', [...this.modelValue, this.inputValue]) | ||
this.inputVisible = false | ||
this.inputValue = '' | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.