feat(chmod-calculator): added symbolic representation (#455)

This commit is contained in:
myztillx 2023-06-18 05:01:54 -04:00 committed by GitHub
parent cf7b1f000a
commit f771e7a99f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 82 additions and 3 deletions

View file

@ -2,7 +2,7 @@
import { useThemeVars } from 'naive-ui';
import InputCopyable from '../../components/InputCopyable.vue';
import { computeChmodOctalRepresentation } from './chmod-calculator.service';
import { computeChmodOctalRepresentation, computeChmodSymbolicRepresentation } from './chmod-calculator.service';
import type { Group, Scope } from './chmod-calculator.types';
@ -22,6 +22,7 @@ const permissions = ref({
});
const octal = computed(() => computeChmodOctalRepresentation({ permissions: permissions.value }));
const symbolic = computed(() => computeChmodSymbolicRepresentation({ permissions: permissions.value }));
</script>
<template>
@ -57,6 +58,9 @@ const octal = computed(() => computeChmodOctalRepresentation({ permissions: perm
<div class="octal-result">
{{ octal }}
</div>
<div class="octal-result">
{{ symbolic }}
</div>
<InputCopyable :value="`chmod ${octal} path`" readonly />
</div>