From 9746a2914cf8709e2ab45b79d748f6927c8bb162 Mon Sep 17 00:00:00 2001 From: infidel Date: Thu, 1 Dec 2022 13:05:00 +0700 Subject: [PATCH] Apply config function added, synced with django backend --- public/assets/styles/tailwind.css | 28 +++++--------- src/components/Cards/CardWGControl.svelte | 44 +++++++++++++++------- src/components/Cards/CardWGProfiles.svelte | 2 +- 3 files changed, 41 insertions(+), 33 deletions(-) diff --git a/public/assets/styles/tailwind.css b/public/assets/styles/tailwind.css index 160b2c4..2ce42e5 100644 --- a/public/assets/styles/tailwind.css +++ b/public/assets/styles/tailwind.css @@ -2609,11 +2609,6 @@ select { border-style: none; } -.border-teal-600 { - --tw-border-opacity: 1; - border-color: rgba(13, 148, 136, var(--tw-border-opacity)); -} - .border-red-600 { --tw-border-opacity: 1; border-color: rgba(220, 38, 38, var(--tw-border-opacity)); @@ -2769,6 +2764,11 @@ select { background-color: rgba(234, 179, 8, var(--tw-bg-opacity)); } +.bg-amber-500 { + --tw-bg-opacity: 1; + background-color: rgba(245, 158, 11, var(--tw-bg-opacity)); +} + .bg-orange-200 { --tw-bg-opacity: 1; background-color: rgba(254, 215, 170, var(--tw-bg-opacity)); @@ -3466,11 +3466,6 @@ select { color: rgba(79, 70, 229, var(--tw-text-opacity)); } -.text-blue-600 { - --tw-text-opacity: 1; - color: rgba(37, 99, 235, var(--tw-text-opacity)); -} - .text-lightBlue-400 { --tw-text-opacity: 1; color: rgba(56, 189, 248, var(--tw-text-opacity)); @@ -3506,6 +3501,11 @@ select { color: rgba(16, 185, 129, var(--tw-text-opacity)); } +.text-amber-100 { + --tw-text-opacity: 1; + color: rgba(254, 243, 199, var(--tw-text-opacity)); +} + .text-orange-500 { --tw-text-opacity: 1; color: rgba(249, 115, 22, var(--tw-text-opacity)); @@ -4050,18 +4050,10 @@ select { display: block; } - .sm\:flex { - display: flex; - } - .sm\:w-6\/12 { width: 50%; } - .sm\:flex-col { - flex-direction: column; - } - .sm\:pt-0 { padding-top: 0px; } diff --git a/src/components/Cards/CardWGControl.svelte b/src/components/Cards/CardWGControl.svelte index 209768f..e552747 100644 --- a/src/components/Cards/CardWGControl.svelte +++ b/src/components/Cards/CardWGControl.svelte @@ -14,12 +14,16 @@ export let checked_vals; let submitFilter = ""; - $: getCookie("csrftoken") == null? - login_wg() : console.log("Cookie Error"); + + async function apply_sys_config() { + const rawResponse = await fetch('/api2/wgSysApply'); + console.log("Apply system config"); + console.log(rawResponse); + } - function login_wg() { + async function login_wg() { - const rawResponse = fetch('/api2/wgLogin', { + const rawResponse = await fetch('/api2/wgLogin', { method: 'GET', headers: { 'Authorization': 'Basic ' + btoa('tipadmin:tiplab123'), @@ -27,8 +31,6 @@ 'Content-Type': 'application/json' } }); - - console.log(rawResponse); } $: submitFilter != ""? @@ -75,11 +77,19 @@ } return cookieValue; } - + async function bulk_disable_req(state) { - login_wg(); + // login_wg(); + + let tmp_filter = filter + filter = ""; + filter = tmp_filter; + let csrftoken = getCookie('csrftoken'); + + console.log("Bulk Disable -->"); console.log(csrftoken); + console.log("-<>-"+checked_vals); const rawResponse = await fetch('/api2/wgEditState?id=bulk&state='+state, { method: 'POST', @@ -93,9 +103,11 @@ body: JSON.stringify(checked_vals) }); - const content = await rawResponse.json(); + // const content = await rawResponse.json(); } + + login_wg();
@@ -170,6 +183,7 @@
Create Filter
+ + +
@@ -212,17 +228,17 @@