Skip to content

Commit

Permalink
feat: improve ui
Browse files Browse the repository at this point in the history
  • Loading branch information
light0x00 committed Mar 5, 2020
1 parent 6278c0d commit 998615c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/web/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<body>
<div id="app"></div>
<div style="position:fixed;left:0;top:0">
<div style="position:fixed;left:0;top:0;display: none;">
<a href="https://clustrmaps.com/site/1b4d1" title="Visit tracker"><img src="//www.clustrmaps.com/map_v2.png?d=FEE2eoLvDM94uAXhSMOFvARTGVEptJCcBKXVl0T-hs4&cl=ffffff"></a>
</div>
</body>
Expand Down
30 changes: 26 additions & 4 deletions packages/web/src/views/tools/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
rows="20"
show-word-limit
/>
<el-alert v-show="errorMsg!=''" :title="errorMsg" type="error" show-icon />
<el-alert v-show="errorMsg!=''" :title="errorMsg" type="error" show-icon :closable="false" />
<el-alert v-show="successMsg!=''" :title="successMsg" type="success" show-icon :closable="false" />

<el-row type="flex">
<el-select v-model="options.parser" placeholder="parser type">
Expand Down Expand Up @@ -63,8 +64,8 @@
<!-- LR 自动机 -->
<collapse>
<template slot="head">LR Automata</template>
<div slot="body" style="width:calc(100% - 2px);height:500px;overflow: auto; border:1px solid #e1e4e8; ">
<network ref="automata" :value="output.lrAutomata" style="height:900px; background-color:white;width: calc(100% - 20px) resize: both;" />
<div slot="body" style="width:calc(100% - 2px);height:600px;overflow: auto; border:1px solid #e1e4e8;resize: vertical ">
<network ref="automata" :value="output.lrAutomata" style="height:900px; background-color:white;width: calc(100% - 20px) ;" />
</div>
</collapse>

Expand Down Expand Up @@ -128,7 +129,8 @@ export default Vue.extend({
parser: "LR1",
lang: "TS"
},
errorMsg: ""
errorMsg0: "",
successMsg0: ""
};
},
computed: {
Expand All @@ -140,6 +142,24 @@ export default Vue.extend({
},
outputVisible() {
return this.output.code != "";
},
successMsg: {
get (){
return this.successMsg0;
},
set(v){
this.errorMsg0="";
this.successMsg0 = v;
}
},
errorMsg :{
get(){
return this.errorMsg0;
},
set(v){
this.successMsg0 ="";
this.errorMsg0= v;
}
}
},
methods: {
Expand Down Expand Up @@ -173,9 +193,11 @@ export default Vue.extend({
this.output.lrAutomata = adapter.lrAutomataToGraph(
lrAutomata
);
this.successMsg = "success!";
} catch (e) {
console.error(e);
this.errorMsg = e.message;
}
},
downloadSourceCode() {
Expand Down

0 comments on commit 998615c

Please sign in to comment.