mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
feat: Text check before synchronization (#689)
* fix: icon * fix: web selector * fix: web selector * perf: link sync * dev doc * chomd doc * perf: git intro * 466 intro * intro img * add json editor (#5) * team limit * websync limit * json editor * text editor * perf: search test * change cq value type * doc * intro img --------- Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
8
scripts/icon/index.js
Normal file → Executable file
8
scripts/icon/index.js
Normal file → Executable file
@@ -33,7 +33,7 @@ app.get('/', (req, res) => {
|
||||
|
||||
svgPaths.forEach((filePath) => {
|
||||
const name = filePath.split('.')[0];
|
||||
iconHtml += `<div class="item" id="${name}" onclick="onclickCopy(${name})">
|
||||
iconHtml += `<div class="item" id="${name}" onclick="onclickCopy('${name}')">
|
||||
<img src="/icons/${filePath}" width="30" height="30" />
|
||||
<div>${name}</div>
|
||||
</div>`;
|
||||
@@ -76,16 +76,16 @@ app.get('/', (req, res) => {
|
||||
</body>
|
||||
<script>
|
||||
const onclickCopy = (name) => {
|
||||
console.log(name.id)
|
||||
console.log(name)
|
||||
try {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(name.id);
|
||||
navigator.clipboard.writeText(name);
|
||||
} else {
|
||||
throw new Error('');
|
||||
}
|
||||
} catch (error) {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = name.id;
|
||||
textarea.value = name;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
|
Reference in New Issue
Block a user