Skip to content

Commit

Permalink
style: display logic & operation confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyzyykk committed Feb 24, 2025
1 parent feccb73 commit 6f1c9c0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public enum ResultCodeEnum {

COOPERATE_KEY_INVALID(-2, "Cooperate Key is invalid"),
COOPERATE_KEY_INVALID(-2, "Cooperate Key is Invalid"),

CONNECT_FAIL(-1,"Fail to connect remote server"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void onOpen(Session sessionSocket, @PathParam("env") String env) throws I
// 成功加入协作
if(maxHeadCount > sessions.size()) {
state = ResultCodeEnum.CONNECT_SUCCESS.getState();
msg = (readOnly ? "ReadOnly" : "Edit") + " cooperate connect success";
msg = (readOnly ? "ReadOnly" : "Edit") + " Cooperation Success";
sessions.add(sessionSocket);
this.sshKey = sshKey;
this.cooperator = true;
Expand All @@ -124,7 +124,7 @@ public void onOpen(Session sessionSocket, @PathParam("env") String env) throws I
sendMessage(webSocketServer.sessionSocket, ResultCodeEnum.COOPERATE_NUMBER_UPDATE.getDesc(),
"success", ResultCodeEnum.COOPERATE_NUMBER_UPDATE.getState(), Integer.toString(sessions.size()));
}
else msg = "Cooperators limit exceeded";
else msg = "Cooperators Limit Exceeded";
}
} catch (Exception e) {
e.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion front/terminal/src/components/MkFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="kk-flex">
<div>
<FileIcons :style="{display: 'flex', alignItems: 'center'}" :width="24" :height="24" v-if="isDirectory == true" name="kk.txt" :isFolder="true" />
<FileIcons :style="{display: 'flex', alignItems: 'center'}" :width="24" :height="24" v-else name="kk.txt" :isFolder="false" />
<FileIcons :style="{display: 'flex', alignItems: 'center'}" :width="24" :height="24" v-else :name="name" :isFolder="false" />
</div>
<div style="width: 10px;"></div>
<div style="flex: 1;">
Expand Down
19 changes: 13 additions & 6 deletions front/terminal/src/components/advance/DockerBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button :disabled="!(selectedItems.length > 0 && containerType != 0)" size="small" type="primary" @click="containerOperate" style="margin-left: 10px;" >
<el-button :disabled="!(selectedItems.length > 0 && containerType != 0)" size="small" type="primary" @click="operateConfirm" style="margin-left: 10px;" >
{{ $t('确定') }}
</el-button>
</div>
Expand All @@ -62,7 +62,7 @@
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button :disabled="!(selectedItems.length > 0 && deleteType != 0)" size="small" type="primary" @click="dockerDelete" style="margin-left: 10px;" >
<el-button :disabled="!(selectedItems.length > 0 && deleteType != 0)" size="small" type="primary" @click="deleteConfirm" style="margin-left: 10px;" >
{{ $t('确定') }}
</el-button>
</div>
Expand All @@ -87,7 +87,7 @@
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button :disabled="!(selectedItems.length > 0 && deleteType != 0)" size="small" type="primary" @click="dockerDelete" style="margin-left: 10px;" >
<el-button :disabled="!(selectedItems.length > 0 && deleteType != 0)" size="small" type="primary" @click="deleteConfirm" style="margin-left: 10px;" >
{{ $t('确定') }}
</el-button>
</div>
Expand All @@ -111,7 +111,7 @@
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button :disabled="!(selectedItems.length > 0 && deleteType != 0)" size="small" type="primary" @click="dockerDelete" style="margin-left: 10px;" >
<el-button :disabled="!(selectedItems.length > 0 && deleteType != 0)" size="small" type="primary" @click="deleteConfirm" style="margin-left: 10px;" >
{{ $t('确定') }}
</el-button>
</div>
Expand Down Expand Up @@ -145,6 +145,7 @@ import { http_base_url } from "@/env/BaseUrl";
import { ArrowDown } from '@element-plus/icons-vue';
import i18n from "@/locales/i18n";
import {ElMessage} from "element-plus";
import { deleteDialog } from "@/utils/DeleteDialog";
export default {
name: 'DockerBlock',
Expand Down Expand Up @@ -349,6 +350,12 @@ export default {
}
});
};
const operateConfirm = () => {
deleteDialog(i18n.global.t('提示'), i18n.global.t('确定进行此操作吗?'), containerOperate);
};
const deleteConfirm = () => {
deleteDialog(i18n.global.t('提示'), i18n.global.t('确定进行此操作吗?'), dockerDelete);
};
// 安装Docker
const installDocker = () => {
Expand Down Expand Up @@ -407,11 +414,11 @@ export default {
tableSelect,
containerType,
deleteType,
containerOperate,
dockerDelete,
selectedItems,
containerTypeArr,
deleteTypeArr,
operateConfirm,
deleteConfirm,
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion front/terminal/src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,6 @@
"删除镜像": "Delete Image",
"删除网络": "Delete NetWork",
"删除数据卷": "Delete Volume",
"Docker未安装?": "Docker is not installed?"
"Docker未安装?": "Docker is not installed?",
"确定进行此操作吗?": "Sure to do this operation?"
}

0 comments on commit 6f1c9c0

Please sign in to comment.