Vue widget example

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,328
Location
LT, EU
Hello,

I'm attaching "Your Account" widget to show how native elements/translations etc. could be used in vue widgets (native widgets without any iframe, using skin elements, notification system etc.). You may change the text of the widget title in in user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/template.html, you will also find "user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/lang/lt.json" as an example for the single string to translate, you may remove word "Customized" from there, and default DA translation would cover it then, as it'd have it in translation strings.

Thank you!

View attachment your_account.tar.gz
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
I can't understand anything..
I never did anything in Direct Admin, so I do not know where the filrs are..
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,328
Location
LT, EU
Just download the attachment and install it as a plugin, you'll then find the files under /usr/local/directadmin/plugins/your_account.
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
How to add it by default, when user open his/her direct admin panel it should be there added in sidebar by default on top , not added by user.
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
Where user.conf file is located, it is not there in EVOLUTION skins, skin.conf files is there only...
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,328
Location
LT, EU
/usr/local/directadmin/data/users/USER/user.conf. Widget order can also be set in skin.conf.
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
I tried it but it does not effect anything
Code:
admin_widgets=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS
reseller_widgets=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS
user_widgets=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
user_widgets_default=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
It does not showing the widget which should be shown by default.
I have to manually add this...
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
8,919
Hello,

I'm seeing 2 different questions here.
1) The ability to control the order when it's added
2) It not being added to existing accounts

Let me know if that's not correct.

I'll use the "user" options for discussion to keep things simple.
The user_widgets setting by default is not in the user.conf.
When a User logs in for the first time, if there is no user_widgets entry in the user.conf, one it assembled and added.
If the plugin is added to the system after the User already has the user_widgets line, then this rule doesn't apply

Proposals:
A) This could be changed the moment a plugin is installed, to go through all existing Users and add the plugins user_widgets_defaults to each user.conf user_widgets. In your case, should we implement this change, simply re-install the plugin to reset all plugin widgets.

B) As for the order, there is nothing for this currently, unless you manually change the skin.conf defaults to include the plugin widgets, since they're 2 different default lists (skin.conf and plugin.conf, plugin.conf comes 2nd). The plugin.conf could have a new setting to request priority order when added.

Let me know your thoughts, if those would help, or if I'm missing anything :)

John
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
How to change the skin.conf defaults to include the plugin widgets...
Widget will show only for users, not for admin or reseller
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
8,919
In case there is any confusion, the above example was only for "user" widgets in the user.conf.
Reseller and Admin widget settings would respectively be in their other files:
reseller.conf: reseller_widgets=
admin.conf: admin_widgets=

Where the "*_widgets_default=" still only lives in the skin.conf and plugin.conf files.

I couldn't say using the data/skins/evolution/skin.conf for default order would be a great, since it will be overwritten anytime the skin gets updated.
However, I was just going through the code and forgot about this one which would be useful for you:

So you can setup a skin.conf override containing ONLY the 3 default lines you want
Code:
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES:WGT_IP_MANAGER
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
user_widgets_default=WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
plus the plugin widget, to the left, if you want them to be at the top for new accounts.

Note that the file would be:
Code:
/usr/local/directadmin/data/users/CREATOR/skin_customizations/evolution/skin.conf
where CREATOR is the name of the account that created the Reseller or User.. this would very often be "admin".

====
For Existing Accounts

any accounts that already exist will likely already have their user.conf, reseller.conf and/or admin.conf files loaded in with those respective widget orders.. so the defaults wont' apply here.
If you want to fully reset everyone's widget settings, and reload all defaults, simply delete those widget lines from all admin.conf, reseller.conf, user.conf files. (Or only the files in question).

So for example, if you're only having issues with the new default plugin widgets not showing for Resellers.. you'd just clear all "reseller_widget=" lines from all reseller.conf files, which means the next time that account logins, the default list is reset, and loaded with whatever you've sorted out in the new skin.conf override (in theory).
 

ShobhaPatwal

New member
Joined
Nov 19, 2019
Messages
18
In case there is any confusion, the above example was only for "user" widgets in the user.conf.
Reseller and Admin widget settings would respectively be in their other files:
reseller.conf: reseller_widgets=
admin.conf: admin_widgets=

Where the "*_widgets_default=" still only lives in the skin.conf and plugin.conf files.

I couldn't say using the data/skins/evolution/skin.conf for default order would be a great, since it will be overwritten anytime the skin gets updated.
However, I was just going through the code and forgot about this one which would be useful for you:

So you can setup a skin.conf override containing ONLY the 3 default lines you want
Code:
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES:WGT_IP_MANAGER
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
user_widgets_default=WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
plus the plugin widget, to the left, if you want them to be at the top for new accounts.

Note that the file would be:
Code:
/usr/local/directadmin/data/users/CREATOR/skin_customizations/evolution/skin.conf
where CREATOR is the name of the account that created the Reseller or User.. this would very often be "admin".

====
For Existing Accounts

any accounts that already exist will likely already have their user.conf, reseller.conf and/or admin.conf files loaded in with those respective widget orders.. so the defaults wont' apply here.
If you want to fully reset everyone's widget settings, and reload all defaults, simply delete those widget lines from all admin.conf, reseller.conf, user.conf files. (Or only the files in question).

So for example, if you're only having issues with the new default plugin widgets not showing for Resellers.. you'd just clear all "reseller_widget=" lines from all reseller.conf files, which means the next time that account logins, the default list is reset, and loaded with whatever you've sorted out in the new skin.conf override (in theory).
Where I will add these lines,
admin_widgets=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS
reseller_widgets=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS
user_widgets=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
user_widgets_default=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS

Please tell me the path
 

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
31
Location
The Netherlands
Hello,

I'm attaching "Your Account" widget to show how native elements/translations etc. could be used in vue widgets (native widgets without any iframe, using skin elements, notification system etc.). You may change the text of the widget title in in user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/template.html, you will also find "user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/lang/lt.json" as an example for the single string to translate, you may remove word "Customized" from there, and default DA translation would cover it then, as it'd have it in translation strings.

Thank you!

View attachment 2570
Where can i find a list of all tokens avalible to use ? for custom design.

Also is it possible to create tokens ?
What I mean is I am looking at Vue for new plugin and to make sub theme just wondering if I can attach to DA and get acces to the variables and tokens like a API ?
 
Last edited:
Top