Skip to content

Commit

Permalink
cosmetic change
Browse files Browse the repository at this point in the history
  • Loading branch information
so5 committed Oct 25, 2024
1 parent 0a89919 commit a9b5f53
Show file tree
Hide file tree
Showing 135 changed files with 3,082 additions and 3,135 deletions.
92 changes: 47 additions & 45 deletions client/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default {
applicationToolBar,
fileBrowser,
buttons,
removeConfirmDialog,
removeConfirmDialog
},
data: ()=>{
return {
Expand All @@ -214,35 +214,35 @@ export default {
{ title: "Path", key: "path", width: "20vw" },
{ title: "Create time", key: "ctime" },
{ title: "Last modified time", key: "mtime" },
{ title: "State", key: "state" },
{ title: "State", key: "state" }
],
dialogTitle: "",
newProjectName: "",
newProjectDescription: "",
removeCandidates: [],
pathSep: "/",
home: "/",
renameDialog:[],
editDescriptionDialog:[],
newVal:null,
edittingIndex:null
renameDialog: [],
editDescriptionDialog: [],
newVal: null,
edittingIndex: null
};
},
watch:{
batchMode(newMode){
if(!newMode){
this.selectedInTable.splice(0,this.selectedInTable.length);
watch: {
batchMode(newMode) {
if (!newMode) {
this.selectedInTable.splice(0, this.selectedInTable.length);
}
}
},
computed: {
selected () {
selected() {
if (this.selectedInTree) {
return this.selectedInTree.replace(reProjectJsonFilename, "");
}
return this.selectedInTable.length > 0 ? this.selectedInTable[0].path : this.home;
},
buttons () {
buttons() {
const open = { icon: "mdi-check", label: "open" };
const create = { icon: "mdi-plus", label: "create", disabled: this.hasError };
const cancel = { icon: "mdi-close", label: "cancel" };
Expand All @@ -257,17 +257,17 @@ export default {
}
return rt;
},
removeProjectMessage () {
removeProjectMessage() {
return this.removeFromList ? "remove following projects from list" : "remove following project files";
},
hasError(){
hasError() {
return this.required(this.newProjectName) !== true;
}
},
mounted: function () {
this.pathSep = readCookie("pathSep");
this.home = readCookie("home");
const baseURL=readCookie("socketIOPath");
const baseURL = readCookie("socketIOPath");
debug(`beseURL=${baseURL}`);
SIO.init(null, baseURL);
SIO.onGlobal("projectList", (data)=>{
Expand All @@ -277,18 +277,18 @@ export default {
},
methods: {
required,
openInlineEditDialog(name, index, prop){
this.newVal=name
this.oldVal=name
this.edittingIndex=index
openInlineEditDialog(name, index, prop) {
this.newVal = name;
this.oldVal = name;
this.edittingIndex = index;
if(prop === "name"){
this.renameDialog[index]=true
}else if(prop === "description"){
this.editDescriptionDialog[index]=true
if (prop === "name") {
this.renameDialog[index] = true;
} else if (prop === "description") {
this.editDescriptionDialog[index] = true;
}
},
forceUpdateProjectList(){
forceUpdateProjectList() {
SIO.emitGlobal("getProjectList", (data)=>{
if (!Array.isArray(data)) {
console.log("unexpected projectlist recieved", data);
Expand All @@ -297,25 +297,25 @@ export default {
this.projectList.splice(0, this.projectList.length, ...data);
});
},
closeDialog () {
closeDialog() {
this.dialog = false;
this.dialogMode = "default";
this.selectedInTree = null;
this.newProjectName = "";
this.newProjectDescription = "";
this.dialogTitle = "";
},
createProject () {
createProject() {
const path = `${this.selected || "."}/${this.newProjectName}`;
SIO.emitGlobal("addProject", path, this.newProjectDescription, (rt)=>{
if(!rt){
if (!rt) {
console.log("create project failed", this.selected, this.newProjectName, this.newProjectDescription, path);
this.forceUpdateProjectList();
}
});
this.closeDialog();
},
openProject () {
openProject() {
if (this.selected === this.home) {
this.dialogTitle = "select project path";
this.dialogMode = "default";
Expand All @@ -335,52 +335,54 @@ export default {
form.appendChild(input);
form.submit();
},
changeDescripton(item, index){
if(this.newVal === item.description){
changeDescripton(item, index) {
if (this.newVal === item.description) {
console.log("project name not changed");
}else{
SIO.emitGlobal("updateProjectDescription", item.path, this.newVal,(rt)=>{
if(!rt){
} else {
SIO.emitGlobal("updateProjectDescription", item.path, this.newVal, (rt)=>{
if (!rt) {
console.log("update description failed", item.path, this.newVal);
this.forceUpdateProjectList();
}
});
}
this.editDescriptionDialog[index]=false
this.editDescriptionDialog[index] = false;
},
renameProject (item, index) {
if(this.newVal === item.name){
renameProject(item, index) {
if (this.newVal === item.name) {
console.log("project name not changed");
}else{
} else {
SIO.emitGlobal("renameProject", item.id, this.newVal, item.path, (rt)=>{
if(!rt){
if (!rt) {
console.log("rename failed", item.id, this.newVal, item.path);
this.forceUpdateProjectList();
}
});
}
this.renameDialog[index]=false
this.renameDialog[index] = false;
},
openDeleteProjectDialog (fromListOnly) {
openDeleteProjectDialog(fromListOnly) {
this.removeFromList = fromListOnly;
this.removeCandidates = this.selectedInTable.map((e)=>{ return e.name; });
this.removeCandidates = this.selectedInTable.map((e)=>{
return e.name;
});
this.rmDialog = true;
},
commitRemoveProjects () {
commitRemoveProjects() {
const removeIDs = this.selectedInTable
.map((e)=>{
return e.id;
});
const eventName = this.removeFromList ? "removeProjectsFromList" : "removeProjects";
SIO.emitGlobal(eventName, removeIDs, (rt)=>{
if(!rt){
if (!rt) {
console.log("remove failed", eventName, removeIDs);
this.forceUpdateProjectList();
}
this.selectedInTable = [];
});
},
},
}
}
};
</script>
<style>
Expand Down
14 changes: 7 additions & 7 deletions client/src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ export default {
password: null,
loading: false,
showPassword: false
}},
};
},
methods: {
async onSubmit () {
if (!this.form) return
this.loading = true
async onSubmit() {
if (!this.form) return;
this.loading = true;
const form = document.createElement("form");
form.setAttribute("action", "./login");
form.setAttribute("method", "post");
Expand All @@ -103,7 +104,6 @@ export default {
form.submit();
},
required
},
}
}
};
</script>

Loading

0 comments on commit a9b5f53

Please sign in to comment.