@hostlink/nuxt-light 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +106 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.ts +7 -0
  4. package/dist/module.json +5 -0
  5. package/dist/module.mjs +51 -0
  6. package/dist/runtime/assets/element.css +15925 -0
  7. package/dist/runtime/assets/element.css.map +1 -0
  8. package/dist/runtime/assets/main.css +13 -0
  9. package/dist/runtime/components/l-add-btn.vue +22 -0
  10. package/dist/runtime/components/l-app-main.vue +214 -0
  11. package/dist/runtime/components/l-app.vue +17 -0
  12. package/dist/runtime/components/l-back-btn.vue +7 -0
  13. package/dist/runtime/components/l-btn.vue +19 -0
  14. package/dist/runtime/components/l-card.vue +19 -0
  15. package/dist/runtime/components/l-checkbox.vue +6 -0
  16. package/dist/runtime/components/l-col.vue +14 -0
  17. package/dist/runtime/components/l-customizer.vue +102 -0
  18. package/dist/runtime/components/l-date-picker.vue +78 -0
  19. package/dist/runtime/components/l-delete-btn.vue +23 -0
  20. package/dist/runtime/components/l-edit-btn.vue +3 -0
  21. package/dist/runtime/components/l-file-manager-labels.vue +55 -0
  22. package/dist/runtime/components/l-file-manager-move.vue +185 -0
  23. package/dist/runtime/components/l-file-manager-preview.vue +59 -0
  24. package/dist/runtime/components/l-file-manager.vue +618 -0
  25. package/dist/runtime/components/l-file.vue +33 -0
  26. package/dist/runtime/components/l-form.vue +73 -0
  27. package/dist/runtime/components/l-input.vue +48 -0
  28. package/dist/runtime/components/l-item.vue +14 -0
  29. package/dist/runtime/components/l-link.vue +24 -0
  30. package/dist/runtime/components/l-list.vue +5 -0
  31. package/dist/runtime/components/l-login.vue +128 -0
  32. package/dist/runtime/components/l-menu.vue +37 -0
  33. package/dist/runtime/components/l-page.vue +94 -0
  34. package/dist/runtime/components/l-row.vue +5 -0
  35. package/dist/runtime/components/l-save-btn.vue +3 -0
  36. package/dist/runtime/components/l-select.vue +77 -0
  37. package/dist/runtime/components/l-table.vue +333 -0
  38. package/dist/runtime/components/l-tabs.vue +5 -0
  39. package/dist/runtime/components/l-time-picker.vue +28 -0
  40. package/dist/runtime/components/l-view-btn.vue +3 -0
  41. package/dist/runtime/composables/addObject.d.ts +2 -0
  42. package/dist/runtime/composables/addObject.mjs +6 -0
  43. package/dist/runtime/composables/f.d.ts +1 -0
  44. package/dist/runtime/composables/f.mjs +27 -0
  45. package/dist/runtime/composables/getApiUrl.d.ts +1 -0
  46. package/dist/runtime/composables/getApiUrl.mjs +4 -0
  47. package/dist/runtime/composables/getCurrentUser.d.ts +2 -0
  48. package/dist/runtime/composables/getCurrentUser.mjs +8 -0
  49. package/dist/runtime/composables/getObject.d.ts +1 -0
  50. package/dist/runtime/composables/getObject.mjs +20 -0
  51. package/dist/runtime/composables/id.d.ts +2 -0
  52. package/dist/runtime/composables/id.mjs +12 -0
  53. package/dist/runtime/composables/list.d.ts +1 -0
  54. package/dist/runtime/composables/list.mjs +33 -0
  55. package/dist/runtime/composables/listData.d.ts +1 -0
  56. package/dist/runtime/composables/listData.mjs +30 -0
  57. package/dist/runtime/composables/login.d.ts +2 -0
  58. package/dist/runtime/composables/login.mjs +17 -0
  59. package/dist/runtime/composables/m.d.ts +1 -0
  60. package/dist/runtime/composables/m.mjs +73 -0
  61. package/dist/runtime/composables/mutation.d.ts +1 -0
  62. package/dist/runtime/composables/mutation.mjs +23 -0
  63. package/dist/runtime/composables/q.d.ts +1 -0
  64. package/dist/runtime/composables/q.mjs +18 -0
  65. package/dist/runtime/composables/removeObject.d.ts +1 -0
  66. package/dist/runtime/composables/removeObject.mjs +15 -0
  67. package/dist/runtime/composables/t.d.ts +1 -0
  68. package/dist/runtime/composables/t.mjs +8 -0
  69. package/dist/runtime/composables/updateObject.d.ts +2 -0
  70. package/dist/runtime/composables/updateObject.mjs +10 -0
  71. package/dist/runtime/composables/useLight.d.ts +7 -0
  72. package/dist/runtime/composables/useLight.mjs +17 -0
  73. package/dist/runtime/composables/viewAs.d.ts +1 -0
  74. package/dist/runtime/composables/viewAs.mjs +15 -0
  75. package/dist/runtime/locales/en.json +14 -0
  76. package/dist/runtime/locales/zh-hk.json +140 -0
  77. package/dist/runtime/pages/EventLog/_eventlog_id/view.vue +21 -0
  78. package/dist/runtime/pages/EventLog/index.vue +56 -0
  79. package/dist/runtime/pages/FileManager/index.vue +5 -0
  80. package/dist/runtime/pages/MailLog/index.vue +48 -0
  81. package/dist/runtime/pages/Permission/add.vue +47 -0
  82. package/dist/runtime/pages/Permission/all.vue +85 -0
  83. package/dist/runtime/pages/Permission/index.vue +26 -0
  84. package/dist/runtime/pages/Role/add.vue +28 -0
  85. package/dist/runtime/pages/Role/index.vue +51 -0
  86. package/dist/runtime/pages/System/database/backup.vue +5 -0
  87. package/dist/runtime/pages/System/database/table.vue +19 -0
  88. package/dist/runtime/pages/System/index.vue +8 -0
  89. package/dist/runtime/pages/System/mailtest.vue +22 -0
  90. package/dist/runtime/pages/System/package.vue +8 -0
  91. package/dist/runtime/pages/System/phpinfo.vue +8 -0
  92. package/dist/runtime/pages/System/setting.vue +68 -0
  93. package/dist/runtime/pages/System/view_as.vue +56 -0
  94. package/dist/runtime/pages/User/_user_id/change-password.vue +49 -0
  95. package/dist/runtime/pages/User/_user_id/edit.vue +49 -0
  96. package/dist/runtime/pages/User/_user_id/view.vue +21 -0
  97. package/dist/runtime/pages/User/add.vue +64 -0
  98. package/dist/runtime/pages/User/index.vue +47 -0
  99. package/dist/runtime/pages/User/profile.vue +25 -0
  100. package/dist/runtime/pages/User/update-password.vue +45 -0
  101. package/dist/runtime/pages/UserLog/index.vue +53 -0
  102. package/dist/runtime/pages/index.vue +9 -0
  103. package/dist/runtime/pages/logout.vue +10 -0
  104. package/dist/runtime/plugin.d.ts +4 -0
  105. package/dist/runtime/plugin.mjs +58 -0
  106. package/dist/runtime/routes.d.ts +7 -0
  107. package/dist/runtime/routes.mjs +261 -0
  108. package/dist/runtime/system_menus.d.ts +10 -0
  109. package/dist/runtime/system_menus.mjs +37 -0
  110. package/dist/types.d.ts +15 -0
  111. package/package.json +57 -0
@@ -0,0 +1,18 @@
1
+ import axios from "axios";
2
+ export default async function(operation, args, fields = []) {
3
+ if (arguments.length === 2) {
4
+ fields = args;
5
+ args = {};
6
+ }
7
+ let service = axios.create({
8
+ withCredentials: true
9
+ });
10
+ const query = f(operation, args, fields);
11
+ const resp = (await service.post("/api/", {
12
+ query: `{ ${query} }`
13
+ })).data;
14
+ if (resp.errors) {
15
+ throw resp.errors[0].message;
16
+ }
17
+ return resp.data[operation];
18
+ }
@@ -0,0 +1 @@
1
+ export default function removeObject(name: string, id: number): Promise<any>;
@@ -0,0 +1,15 @@
1
+ import { useQuasar } from "quasar";
2
+ const qua = useQuasar();
3
+ export default async function removeObject(name, id) {
4
+ let { data } = await m(`remove${name}`, { id });
5
+ let result = data[`remove${name}`];
6
+ console.log(result);
7
+ if (result.errors) {
8
+ qua.dialog({
9
+ title: "Error",
10
+ message: result.errors[0].message
11
+ });
12
+ throw new Error(result.errors[0].message);
13
+ }
14
+ return result;
15
+ }
@@ -0,0 +1 @@
1
+ export default function _default(x: any): string;
@@ -0,0 +1,8 @@
1
+ import { useI18n } from 'vue-i18n';
2
+
3
+ export default function (x) {
4
+ const i18n = useI18n();
5
+
6
+ return i18n.t(x);
7
+
8
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (name: string, id: number, data: Object) => Promise<any>;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export default async (name, id, data) => {
2
+ let resp = await m(`update${name}`, {
3
+ id,
4
+ data
5
+ });
6
+ if (resp.errors) {
7
+ throw new Error(resp.errors[0].message);
8
+ }
9
+ return resp.data[`update${name}`];
10
+ };
@@ -0,0 +1,7 @@
1
+ interface Light {
2
+ addError: (error: String) => void;
3
+ getErrors: () => String[];
4
+ removeError: (error: String) => void;
5
+ }
6
+ export declare function useLight(): Light;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ const errors = [];
2
+ export function useLight() {
3
+ return {
4
+ addError: (error) => {
5
+ errors.push(error);
6
+ },
7
+ getErrors: () => {
8
+ return errors;
9
+ },
10
+ removeError: (error) => {
11
+ const index = errors.indexOf(error);
12
+ if (index > -1) {
13
+ errors.splice(index, 1);
14
+ }
15
+ }
16
+ };
17
+ }
@@ -0,0 +1 @@
1
+ export default function viewAs(id: Number): Promise<boolean>;
@@ -0,0 +1,15 @@
1
+ export default async function viewAs(id) {
2
+ let { data } = await mutation({
3
+ operation: `viewAs`,
4
+ variables: {
5
+ user_id: {
6
+ value: id,
7
+ required: true
8
+ }
9
+ }
10
+ });
11
+ if (data.viewAs) {
12
+ return true;
13
+ }
14
+ return false;
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "SystemBackup": "System backup",
3
+ "SystemValue": "System value",
4
+ "UserGroup": "User group",
5
+ "UserLog": "User log",
6
+ "FileManager": "File manager",
7
+ "mail-test": "Mail test",
8
+ "vx-table-message": "Showing {0} to {1} of {2} entries",
9
+ "vx-per-page": "Per page",
10
+ "Dashboard": "Dashboard",
11
+ "Theme Customizer": "Theme Customizer",
12
+ "Customize & Preview in Real Time": "Customize & Preview in Real Time",
13
+ "Permission": "Permission"
14
+ }
@@ -0,0 +1,140 @@
1
+ {
2
+ "Date": "日期",
3
+ "Online": "在線",
4
+ "Update": "更新",
5
+ "MailLog": "電郵記錄",
6
+ "Remark": "備註",
7
+ "Status": "狀態",
8
+ "Copyright": "著作權",
9
+ "All rights reserved": "版權所有",
10
+ "ACL": "權限控制",
11
+ "Calendar": "月曆",
12
+ "Config": "配置",
13
+ "Logout": "登出",
14
+ "Module": "模組",
15
+ "ModuleGroup": "模組組合",
16
+ "My Info": "我的資料",
17
+ "Server Time": "系統時間",
18
+ "System": "系統",
19
+ "SystemBackup": "系統備份",
20
+ "SystemValue": "系統值",
21
+ "Translate": "翻譯",
22
+ "User": "使用者",
23
+ "Setting": "設定",
24
+ "setting": "設定",
25
+ "Email": "電郵",
26
+ "Phone": "電話",
27
+ "UserGroup": "使用者群組",
28
+ "User group": "使用者群組",
29
+ "Submit": "提交",
30
+ "Back": "返回",
31
+ "Password": "密碼",
32
+ "Address": "地址",
33
+ "username": "使用者名稱",
34
+ "Fax": "傳真",
35
+ "City": "城市",
36
+ "Website": "網站",
37
+ "Add": "新增",
38
+ "add": "新增",
39
+ "Edit": "編輯",
40
+ "edit": "編輯",
41
+ "UserLog": "使用者紀錄",
42
+ "EventLog": "事件紀錄",
43
+ "Sign out": "登出",
44
+ "Username": "使用者名稱",
45
+ "First name": "名稱",
46
+ "Last name": "姓氏",
47
+ "Created time": "建立時間",
48
+ "Updated time": "更新時間",
49
+ "Reset password": "重設密碼",
50
+ "Login time": "登入時間",
51
+ "Logout time": "登出時間",
52
+ "File name": "檔案名稱",
53
+ "Join date": "加入日期",
54
+ "Default page": "預設頁",
55
+ "2 step verification": "二步認證",
56
+ "Expiry date": "有效日期",
57
+ "List": "列表",
58
+ "Access deny": "拒絶存取",
59
+ "Language": "語言",
60
+ "General settings": "一般設定",
61
+ "Profile": "基本資料",
62
+ "User profile": "使用者基本資料",
63
+ "Blue": "藍色",
64
+ "Black": "黑色",
65
+ "Purple": "紫色",
66
+ "Green": "綠色",
67
+ "Red": "紅色",
68
+ "Yellow": "黃色",
69
+ "My favorite": "我的最愛",
70
+ "IP address": "IP地址",
71
+ "User agent": "使用者代理",
72
+ "Version": "版本",
73
+ "Home": "主頁",
74
+ "2 Step verification": "雙重認證",
75
+ "FileManager": "檔案管理器",
76
+ "Settings": "設定",
77
+ "Change Password": "更改密碼",
78
+ "Theme Customizer": "主題定制器",
79
+ "Theme customizer": "主題定制器",
80
+ "Customize & Preview in Real Time": "實時自定義和預覽",
81
+ "Delete": "刪除",
82
+ "View": "檢視",
83
+ "view": "檢視",
84
+ "Biometric authentication": "生物認證",
85
+ "New Password": "新密碼",
86
+ "Permissions": "權限",
87
+ "Information": "資訊",
88
+ "Save": "儲存",
89
+ "Save changes": "儲存更改",
90
+ "Activate biometric authentication on this device": "在此設備上啟用生物識別身份驗證",
91
+ "Time": "時間",
92
+ "Style": "風格",
93
+ "Mail test": "郵件測試",
94
+ "mail-test": "郵件測試",
95
+ "Documents": "文件",
96
+ "Images": "圖像",
97
+ "Videos": "影像",
98
+ "Audio": "音訊",
99
+ "Name": "名稱",
100
+ "Date modified": "修改日期",
101
+ "Size": "大小",
102
+ "File": "檔案",
103
+ "Folder": "資料夾",
104
+ "Search": "搜尋",
105
+ "Reset": "重設",
106
+ "Reload": "重新載入",
107
+ "Rename": "重新命名",
108
+ "Database": "資料庫",
109
+ "Charset": "字元編碼",
110
+ "vx-table-message": "顯示 {0} 至 {1} 共 {2} 項資料",
111
+ "vx-per-page": "每頁顯示",
112
+ "Role": "角色",
113
+ "Permission": "權限",
114
+ "Old password": "舊密碼",
115
+ "New password": "新密碼",
116
+ "Confirm password": "確認密碼",
117
+ "General": "一般",
118
+ "Roles": "角色",
119
+ "Change password": "更改密碼",
120
+ "Change role": "更改角色",
121
+ "Address1": "地址1",
122
+ "Address2": "地址2",
123
+ "Address3": "地址3",
124
+ "Address 1": "地址1",
125
+ "Address 2": "地址2",
126
+ "Address 3": "地址3",
127
+ "Archives": "檔案",
128
+ "Labels": "標籤",
129
+ "Last Modified": "最後修改",
130
+ "Upload file": "上傳檔案",
131
+ "Storage": "儲存空間",
132
+ "Search for file name": "搜尋檔案名稱",
133
+ "database": "資料庫",
134
+ "Backup": "備份",
135
+ "backup": "備份",
136
+ "Restore": "還原",
137
+ "restore": "還原",
138
+ "Content": "內容",
139
+ "Download": "下載"
140
+ }
@@ -0,0 +1,21 @@
1
+ <script setup>
2
+ const obj = await getObject(["eventlog_id", "class", "id", "action", "created_time", "username"]);
3
+
4
+
5
+ </script>
6
+ <template>
7
+ <l-page>
8
+ <l-card>
9
+ <l-list>
10
+ <l-item label="EventLog ID">{{ obj.eventlog_id }}</l-item>
11
+ <l-item label="Class">{{ obj.class }}</l-item>
12
+ <l-item label="ID">{{ obj.id }}</l-item>
13
+ <l-item label="Action">{{ obj.action }}</l-item>
14
+ <l-item label="Created time">{{ obj.created_time }}</l-item>
15
+ <l-item label="Username">{{ obj.username }}</l-item>
16
+
17
+
18
+ </l-list>
19
+ </l-card>
20
+ </l-page>
21
+ </template>
@@ -0,0 +1,56 @@
1
+ <script setup>
2
+ const onRequest = async (params) => {
3
+ listData("EventLog", params, ["canRead"]);
4
+ };
5
+
6
+ const columns = [
7
+ {
8
+ label: "EventLog ID",
9
+ name: "eventlog_id",
10
+ sortable: true,
11
+ searchable: true,
12
+ },
13
+
14
+ {
15
+ label: "Class",
16
+ name: "class",
17
+ sortable: true,
18
+ searchable: true,
19
+ },
20
+
21
+ {
22
+ label: "ID",
23
+ name: "id",
24
+ sortable: true,
25
+ searchable: true,
26
+ },
27
+ {
28
+ label: "Action",
29
+ name: "action",
30
+ sortable: true,
31
+ searchable: true,
32
+ }, {
33
+ label: "Created time",
34
+ name: "created_time",
35
+ sortable: true,
36
+ searchable: true,
37
+ }, {
38
+ label: "Username",
39
+ name: "username",
40
+ sortable: true,
41
+ searchable: true,
42
+ }
43
+
44
+
45
+
46
+ ]
47
+
48
+ </script>
49
+
50
+ <template>
51
+ <l-page>
52
+ <l-table @request="onRequest" :columns="columns" sort-by="eventlog_id:desc" :show-actions="['view']">
53
+
54
+ </l-table>
55
+ </l-page>
56
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <l-page>
3
+ <l-file-manager></l-file-manager>
4
+ </l-page>
5
+ </template>
@@ -0,0 +1,48 @@
1
+ <script setup>
2
+ const onRequest = async (params) => {
3
+ listData("MailLog", params, ["body"]);
4
+ };
5
+
6
+ const columns = [
7
+ {
8
+ label: "ID",
9
+ name: "maillog_id",
10
+ sortable: true,
11
+ searchable: true,
12
+ }, {
13
+ label: "From",
14
+ name: "from",
15
+ sortable: true,
16
+ searchable: true,
17
+ }, {
18
+ label: "To",
19
+ name: "to",
20
+ sortable: true,
21
+ searchable: true,
22
+ },
23
+ {
24
+ label: "Subject",
25
+ name: "subject",
26
+ sortable: true,
27
+ searchable: true,
28
+ },
29
+ {
30
+ label: "Created time",
31
+ name: "created_time",
32
+ sortable: true,
33
+ searchable: true,
34
+ searchType: "date",
35
+
36
+ }
37
+ ]
38
+
39
+ </script>
40
+
41
+ <template>
42
+ <l-page>
43
+ <l-table @request="onRequest" :columns="columns" sort-by="maillog_id:desc">
44
+
45
+
46
+ </l-table>
47
+ </l-page>
48
+ </template>
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ const obj = reactive({
3
+ roles: []
4
+ });
5
+ let roles = await q("listRole", ["name"]);
6
+ roles = roles.map((role) => {
7
+ return {
8
+ label: role.name,
9
+ value: role.name,
10
+ };
11
+ });
12
+
13
+ const router = useRouter();
14
+ const onSave = async () => {
15
+ await mutation({
16
+ operation: "addPermissionRoles",
17
+ variables: {
18
+ value: {
19
+ value: obj.value,
20
+ required: true
21
+ },
22
+ roles: {
23
+ value: obj.roles,
24
+ type: "[String!]!"
25
+ }
26
+ },
27
+
28
+
29
+ });
30
+ router.push(`/Permission`);
31
+ }
32
+
33
+ </script>
34
+ <template>
35
+ <l-page>
36
+ <l-form @save="onSave">
37
+
38
+ <l-input label="Permission name" v-model="obj.value" required></l-input>
39
+
40
+ <q-option-group type="checkbox" :options="roles" v-model="obj.roles">
41
+
42
+ </q-option-group>
43
+
44
+ </l-form>
45
+
46
+ </l-page>
47
+ </template>
@@ -0,0 +1,85 @@
1
+ <script setup>
2
+ const app = await q("app", ["permissions"])
3
+
4
+ const roles = await q("listRole", ["name", "permissions"])
5
+
6
+ const columns = [{
7
+ label: "Permission",
8
+ field: "permission",
9
+ align: "left",
10
+ }];
11
+
12
+ //push roles to columns
13
+ roles.forEach(role => {
14
+ columns.push({
15
+ label: role.name,
16
+ field: role.name,
17
+ align: "left",
18
+
19
+ })
20
+ });
21
+
22
+ const rows = reactive([]);
23
+
24
+ //push permissions to rows
25
+ app.permissions.forEach(permission => {
26
+ let row = {
27
+ permission: permission
28
+ };
29
+
30
+ roles.forEach(role => {
31
+ if (role.permissions.indexOf(permission) != -1) {
32
+ row[role.name] = true;
33
+ } else {
34
+ row[role.name] = false;
35
+ }
36
+ });
37
+
38
+ rows.push(row);
39
+ });
40
+
41
+ const onUpdate = (value, role, permission) => {
42
+ /* if (value) {
43
+ app.permissions.push(role);
44
+ } else {
45
+ app.permissions.splice(app.permissions.indexOf(role), 1);
46
+ }
47
+ app.save(); */
48
+
49
+ if (value) {
50
+ m("addPermission", { value: permission, role })
51
+ } else {
52
+ m("removePermission", { value: permission, role })
53
+ }
54
+
55
+ //update rows
56
+ rows.forEach(row => {
57
+ if (row.permission == permission) {
58
+ row[role] = value;
59
+ }
60
+ });
61
+
62
+
63
+ }
64
+
65
+ </script>
66
+
67
+
68
+ <template>
69
+ <l-page>
70
+ <q-table :columns="columns" flat bordered :rows="rows" :pagination="{ rowsPerPage: 0 }">
71
+ <template #body="props">
72
+ <q-tr :props="props">
73
+ <q-td>
74
+ {{ props.row.permission }}
75
+ </q-td>
76
+ <q-td v-for="role in roles">
77
+ <q-checkbox v-model="props.row[role.name]"
78
+ @update:model-value="onUpdate($event, role.name, props.row.permission)" />
79
+ </q-td>
80
+ </q-tr>
81
+
82
+ </template>
83
+ </q-table>
84
+ </l-page>
85
+ </template>
@@ -0,0 +1,26 @@
1
+ <script setup>
2
+ const onRequest = async (params) => {
3
+ listData("Permission", params, ["permission_id"]);
4
+ };
5
+
6
+ const columns = [
7
+ {
8
+ label: "Role",
9
+ name: "role",
10
+ sortable: true,
11
+ searchable: true,
12
+ },
13
+ {
14
+ label: "Permission",
15
+ name: "value",
16
+ sortable: true,
17
+ searchable: true,
18
+ }
19
+ ]
20
+
21
+ </script>
22
+ <template>
23
+ <l-page add-btn>
24
+ <l-table @request="onRequest" :columns="columns" :show-actions="['delete']"></l-table>
25
+ </l-page>
26
+ </template>
@@ -0,0 +1,28 @@
1
+ <script setup>
2
+ const obj = reactive({
3
+ childs: ["Users"],
4
+ })
5
+
6
+ let roles = await q("listRole", ["name"]);
7
+ roles = roles.map((role) => {
8
+ return {
9
+ label: role.name,
10
+ value: role.name,
11
+ };
12
+ });
13
+
14
+ </script>
15
+
16
+ <template>
17
+ <l-page>
18
+ <l-form v-model="obj">
19
+ <l-input v-model="obj.name" label="Name" required />
20
+ <q-field label="Child" stack-label>
21
+ <q-option-group type="checkbox" :options="roles" v-model="obj.childs" inline>
22
+ </q-option-group>
23
+ </q-field>
24
+
25
+ </l-form>
26
+
27
+ </l-page>
28
+ </template>
@@ -0,0 +1,51 @@
1
+ <script setup>
2
+
3
+ const qua = useQuasar();
4
+
5
+ const loadData = async () => {
6
+ return await q("listRole", ["name", "canDelete", { parents: ["name"] }]);
7
+
8
+ }
9
+
10
+
11
+ const roles = ref(await loadData());
12
+
13
+ const onDelete = async (role) => {
14
+ //confirm
15
+ qua.dialog({
16
+ title: "Delete",
17
+ message: "Are you sure you want to delete this role and related role relations?",
18
+ cancel: true,
19
+ persistent: true,
20
+ }).onOk(async () => {
21
+
22
+ m("removeRole", { name: role })
23
+ //refresh
24
+ roles.value = await loadData();
25
+ });
26
+
27
+ }
28
+
29
+ </script>
30
+
31
+ <template>
32
+ <l-page>
33
+
34
+ <el-table :data="roles">
35
+
36
+ <el-table-column width="60px" #default="{ row }">
37
+ <q-btn v-if="row.canDelete" flat round dense icon="sym_o_delete" @click="onDelete(row.name)" />
38
+ </el-table-column>
39
+ <el-table-column prop="name" label="Name" sortable width="200px"></el-table-column>
40
+ <el-table-column label="Parent">
41
+
42
+ <template #default="{ row }">
43
+
44
+ <el-table :data="row.parents">
45
+ <el-table-column prop="name" label="Name"></el-table-column>
46
+ </el-table>
47
+ </template>
48
+ </el-table-column>
49
+ </el-table>
50
+ </l-page>
51
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <l-page>
3
+
4
+ </l-page>
5
+ </template>
@@ -0,0 +1,19 @@
1
+ <script setup>
2
+ const { database } = await q("system", [f("database", ["table"])])
3
+ </script>
4
+ <template>
5
+ <l-page>
6
+ <q-card flat bordered>
7
+ <q-list bordered class="rounded-borders" separator >
8
+ <q-expansion-item :label="table.name" v-for="table in database.table" expand-separator>
9
+ <div class=" q-ma-sm">
10
+ <q-table :rows="table.columns" :rows-per-page-options="[0]" hide-pagination flat bordered></q-table>
11
+ </div>
12
+
13
+ </q-expansion-item>
14
+ </q-list>
15
+ </q-card>
16
+
17
+
18
+ </l-page>
19
+ </template>
@@ -0,0 +1,8 @@
1
+ <script setup>
2
+ const system = await q("system", ["server"])
3
+ </script>
4
+ <template>
5
+ <l-page>
6
+ <q-table :rows="system.server" :rows-per-page-options="[0]" hide-pagination flat bordered></q-table>
7
+ </l-page>
8
+ </template>